Richard Shih-Ping Chan <[EMAIL PROTECTED]> writes:

> Hi,
> 
> When using bitmap PCF fonts with pango/Xft2/fontconfig, what is the
> relationship between pixelsize and pointsize? I.e. how do I specify
> pointsize to select a specific bitmap font?
> 
> E.g
> 
> If I install 10x20.pcf
> 
> 10x20.pcf Fixed:style=Regular:slant=0:weight=100:pixelsize=20
> 
> Now if I want to select it via pango/Xft2/fc I try
> 
> PangoFontDescription* font_desc = pango_description_from_string("Fixed 20")
> 
> which seems to work  so my naive guess would be SIZE=pixelsize.
> 
> However I also have two terminal fonts
> 
> terminal-16-m-r-iso10646-1.pcf 0
> Terminal:style=Regular:slant=0:weight=100:pixelsize=16:
> terminal-10-m-r-sc.pcf 0
> Terminal:style=Regular:slant=0:weight=100:pixelsize=10
> 
> If I use SIZE=10 I get the larger font i.e. pixelsize=16.
> If I want pixelsize=10 I must use SIZE=8.
> 
> So my question is: in order to select a specfic PCF font what should one put
> in the SIZE part.

Depends on what resolution fontconfig/Xft are using. On a raw 
install, the resolution that Xft uses to turn points
to pixels comes from physical resolution of the screen.

Red Hat 8.0 explicitely sets this "logical" resolution to 96dpi
by default. (It can be configured, but normally won't be)

 pixels = points * (logical resolution / 72.)

[ Fontconfig uses the postscript point rather than the traditional
  point of 1/72.27 inch ]

So for Red Hat 8, to get a pixel size of 10 pixels, you want a 
point size of:

 10 * 72. / 96. = 7.5 points

So, "Terminal 7.5" is what you want for the Pango string. (Pango
accepts fractional point sizes, though "Terminal 8" probably
will give you the same font as well.)

Regards,
                                        Owen
_______________________________________________
Fonts mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/fonts

Reply via email to