[ Return to Bugs & Features | Roadmap 2.0 | Post Text | Post File ]
|Status:||5 - New|
|Priority:||2 - Low, e.g. a documentation error or undocumented side-effect|
|Scope:||2 - Specific to an operating system|
|Summary:||fltk::setfont() documentation error on linux/x11/xft|
Trouble Report Files:
[ Post File ]
Trouble Report Comments:
[ Post Text ]
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. |
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.
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 ]