On 1 Feb 2009, at 14:24, cage wrote: >> >> If you change the '18' to '*' then it should wildcard >> the size so that FLTK can control the sizes. > > I was expecting this too, but on my system the size of the rendered > text do not change, i have write this few lines > to check this behaviour:
That *might* not be so surprising - the XLFD fonts used by Xlib tend, in general, to be older types of fonts, often bitmap fonts, and often not truly scalable. So there is a real chance that the font that is being picked using the XLFD name perhaps only exists on your machine in a single pitch, with no scaling information in the font. So as a result, the font that gets picked on the basis of this name, does not then respond to scaling requests... > > ./test -*-courier-medium-r-*-*-*-*-*-*-*-*-*-* > > give a fixed font size even if we are forcing to draw the text with > a size of 49 but if you do: > > ./test courier > > on my system all works fine... I would assume that in this case, the font that gets picked for just "courier" is a scalable font, whereas the one that gets picked for "- *-courier-medium-r-*-*-*-*-*-*-*-*-*-*" is perhaps not... Is the same face getting picked in both cases? I assume not. Pick a few key glyphs and check if they are the same shape or not in each case. Anyway, an option is this; rather than setting the XLFD size to *, try setting it to the size you actually want, and when you change the font size, call set_font(....) again, with the new size inserted in the string. Note also that XLFD names allow you to specify either POINT size or PIXEL size in the name (I have no idea what happens if you set both in an incompatible way!) so you may get different results with either. The details are here, if you really need to know. It's not the most exciting read though! http://ftp.xfree86.org/pub/XFree86/4.5.0/doc/xlfd.txt I would expect that as you change the sizes in the XLFD name, you may actually get different font faces at different sizes, as the font engine tries to find a match that can support the size you are requesting... Alternately, if you can find a fully scalable font installed on your system, that has the face you want, then selecting that is probably the best bet, as then the renderer can deal with the sizing and scaling issues for you. However, it would appear that the face the font engine is picking, on your system, when given the name "courier" is a scalable font, but not *actually* a courier face... There are a whole bunch of extra font sets that can be installed on a debian system, but most are not installed by default. They tend to heavily favour the FOSS/libre fonts, as you might expect. So you may find that you can apt-get some extra font packages and get a much better, scalable, courier face from one of them. Or just accept, as I have learned, that font rendering is a mess. It is bad enough just moving from one linux to another - throw in some OSX and some Windows ports of your application, and... Generally, no one ever has the fonts you expect pre-installed, and things never look quite the same! -- Ian _______________________________________________ fltk mailing list [email protected] http://lists.easysw.com/mailman/listinfo/fltk

