| [ Return to Bugs & Features | Roadmap 1.3 | SVN ⇄ GIT ]
STR #3397
Application: | FLTK Library |
Status: | 1 - Closed w/Resolution |
Priority: | 3 - Moderate, e.g. unable to compile the software |
Scope: | 2 - Specific to an operating system |
Subsystem: | X11 |
Summary: | Font size/type not working inside GL window with gl_font(), gl_draw() |
Version: | 1.3.4 |
Created By: | dragonlord |
Assigned To: | manolo |
Fix Version: | 1.3-current (SVN: v12403) |
Update Notification: | |
Trouble Report Files:
Trouble Report Comments:
|
#1 | dragonlord 12:46 Aug 21, 2017 |
| FLTK 1.3.4-1 under Lubuntu running Ubuntu 16.04.2 LTS 64-bit Linux 4.10, Nvidia card.
gl_draw display of text always uses 10-point default font when drawn inside a Fl_Gl_Window. Neither gl_font(f,s) nor fl_font(f,s) change this. But the fonts work fine if fl_draw used on a regular Fl_Window outside of GL. Since the font-testing routines use regular not GL windows, this goes undetected in tests. Remaking the FLTK system with Xft disabled does not fix. I seem to remember they were working in 2015. How to fix or workaround?
[Also, the char *q_name method variable seems to have disappeared from class Fl_Font_Descriptor circa 2014.] | |
|
#2 | manolo 08:19 Aug 26, 2017 |
| Yes indeed. Under Ubuntu with its default set of fonts, always the same font+size is produced by gl_font().
That is because Ubuntu does not contain the fonts searched by function load_xfont_for_xft2() in file src/fl_font_xft.cxx.
After a series of attempts, FLTK tries -*-courier-medium-r-*--*-260-* to get a font (of size 26 for example here) which works with Debian, for example, but not with Ubuntu.
Since this query gives no match, FLTK tries as last attempt "fixed" which loads a font, but always the same one, whatever gl_font() asks.
Here, the command xlsfonts | grep courier shows that the font family name under Ubuntu is "courier 10 pitch", rather than just "courier".
A fix is therefore either to tweak fonts to create one that matches -*-courier-medium-r-* or to modify line 502 of source file src/fl_font_xft.cxx adding an asterisk after "courier" to obtain that : snprintf(xlfd, 128, "-*-courier*-medium-%c-*--*-%d-*-*-*-*-*-*", slant, (size*10)); and recompile FLTK. | |
|
#3 | manolo 00:29 Aug 27, 2017 |
| @dragonlord: could you, please, try with the fixed version from the svn repository (r.12403) and report whether it works correctly. Size and style font requests should be honored, but the requested family may not be respected. | |
|
#4 | manolo 00:44 Mar 07, 2018 |
| Fixed in Subversion repository. | |
[ Return to Bugs & Features ]
|
| |