On Sun, Feb 01, 2009 at 07:38:15PM +0000, imacarthur wrote:
> 
> 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. 

Unfortunately this would not be an optimal solution for me because not all 
sizes 
beetween a given range are available for a XLFD font :-(

> 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.

I think this is the best solution available...
 
> 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.

these are wise words! :-)

At this time, as you explained me, i have realized that i should force both the 
screen and the export rendering to 
use the same font.

Hovewer libplot is really old and only permits to specify a few postscript and 
PCL font, so i think i will 
switch library for a recent one, i was thinking cairo+pango.

So thank you really thank you to you and greg for this thread because i have a 
way to try to exit from this 
nightmare now! :-D


Bye!
C.

_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to