| [ Return to Bugs & Features | Post Text | Post File | Prev | Next ]
STR #3465
Application: | FLTK Library |
Status: | 5 - New |
Priority: | 3 - Moderate, e.g. unable to compile the software |
Scope: | 2 - Specific to an operating system |
Subsystem: | Core Library |
Summary: | scilinux 6.3: Setting FL_SCREEN font falling back to FL_HELVETICA |
Version: | 1.4-current |
Created By: | greg.ercolano |
Assigned To: | Unassigned |
Fix Version: | Unassigned |
Update Notification: | |
Trouble Report Files:
[ Post File ]
|
#1 | greg.ercolano 19:43 Apr 20, 2018 |
| bug.cxx 1k | |
|
#2 | greg.ercolano 19:44 Apr 20, 2018 |
| bug.png 2k | |
Trouble Report Comments:
[ Post Text ]
|
#1 | greg.ercolano 19:43 Apr 20, 2018 |
| Using the FL_SCREEN font is yielding a FL_HELVETICA-like font instead of a monospaced font. Bad for apps needing text alignment.
FL_COURIER works OK.
Will investigate further and follow up. Attaching a test program and screenshot showing the problem. | |
|
#2 | AlbrechtS 06:18 Apr 21, 2018 |
| Confirmed on Ubuntu 16.04.
Search for built_in_table[] to see which font names are used to build the default font list. Source files are:
src/drivers/Xlib/Fl_Xlib_Graphics_Driver_font_x.cxx:393:static Fl_Xlib_Fontdesc built_in_table[] = { src/drivers/Xlib/Fl_Xlib_Graphics_Driver_font_xft.cxx:64:static Fl_Fontdesc built_in_table[] = {
According to these files the font name is either "-*-lucidatypewriter-medium-r-normal-sans-*" (X11 w/o Xft) or simply "screen" (Xft).
The latter used to be "lucidatypewriter" in an earlier version (#ifdef).
I don't seem to have either font (lucidatypewriter or screen) on my system.
Hard coded font names look suspicious to me anyway. We might want to make the default font name configurable at build time or we could document the chosen font names and ask users to select a font they have on their system at runtime.
If I add this:
Fl::set_font(FL_SCREEN, " mono");
right at the beginning of your test program I can see the FL_SCREEN font as expected on my system.
Actually I used this for further testing:
printf("Default FL_SCREEN font = '%s'\n", Fl::get_font(FL_SCREEN)); Fl::set_font(FL_SCREEN, "Bmono"); printf("FL_SCREEN font = '%s'\n", Fl::get_font(FL_SCREEN)); Fl::set_font(FL_SCREEN, " mono"); printf("FL_SCREEN font = '%s'\n", Fl::get_font(FL_SCREEN));
and found:
Default FL_SCREEN font = ' screen' FL_SCREEN font = 'Bmono' FL_SCREEN font = ' mono'
as expected. | |
[ Return to Bugs & Features | Post Text | Post File ]
|
| |