| [ Return to Bugs & Features | Roadmap 2.0 | Post Text | Post File ]
STR #1977
Application: | FLTK Library |
Status: | 5 - New |
Priority: | 2 - Low, e.g. a documentation error or undocumented side-effect |
Scope: | 2 - Specific to an operating system |
Subsystem: | Unassigned |
Summary: | fltk::setfont() documentation error on linux/x11/xft |
Version: | 2.0-current |
Created By: | ddurham |
Assigned To: | Unassigned |
Fix Version: | Unassigned |
Update Notification: | |
Trouble Report Files:
[ Post File ]No files
Trouble Report Comments:
[ Post Text ]
|
#1 | ddurham 14:07 Jun 04, 2008 |
| I've been having some inconsistant font sizing in my linux/x11 application written in fltk2 when it runs on various disroes. I finally found time to try and diagnose the problem and discovered a possible error in the documentation.
-> http://fltk.org/doc-2.0/html/draw_8h.html#a80 I my app, I'm using drawtext() to custom draw some text on the window but the font sizing has been big on some machines and small on others (linux only here)
It states that you should pass pixel size to fltk::setfont() and gives you a formula for converting your desired point size into a pixel size acceptable to fltk::setfont().
So I started a debugger to see what fltk itself passes to setfont() when it, for example, draws a widget's label. (src/Widget_draw.cxx -> draw_label())
I see it passing "12" to fltk::setfont() which seems like a reasonable point size.
But moreover, then I traced into (all in src/x11/Font_xft.cxx) fltk::setfont() which calls fontopen() which calls XftFontOpen and passes it the size given to fltk::setFont() unmodified. And, the reference for XftOpenFont() indicates that it should be passed point size. http://linux.die.net/man/3/xft
I don't know if this is an inconsitancy between, say, win32 and x11, or just an error in the docs for both platforms.
Also, x11 has another font implementation in Font_xlfd.cxx (which I believe is much more rarely used), but I have not checked if xlfd's font opening/listing function deals natively with point or pixel sizes. | |
[ Return to Bugs & Features | Post Text | Post File ]
|
| |