STR #3465

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 Home  |  Articles & FAQs  |  Bugs & Features  |  Documentation  |  Download  |  Screenshots  ]

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
Created By:greg.ercolano
Assigned To:Unassigned
Fix Version:Unassigned
Update Notification:

Receive EMails Don't Receive EMails

Trouble Report Files:

Post File ]
Name/Time/Date Filename/Size top right image
#1 greg.ercolano
19:43 Apr 20, 2018
#2 greg.ercolano
19:44 Apr 20, 2018
bottom left image   bottom right image

Trouble Report Comments:

Post Text ]
Name/Time/Date Text top right image
#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.


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.
bottom left image   bottom right image

Return to Bugs & Features | Post Text | Post File ]


Comments are owned by the poster. All other content is copyright 1998-2023 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to ''.