freetype-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Devel] PCF problem


From: Detlef Würkner
Subject: [Devel] PCF problem
Date: Thu, 03 Jul 2003 16:14:16 +0200

Hello!

Werner, let me first thank you for the new definition of FT_Bitmap_Size,
I like it. Currently trying to switch back from my home-brewn bdf/pcf
bitmap size testing functions to unmodified FT2 sources.

With the PCF driver there are problems when the font file does not
contain the PIXEL_SIZE property which is used for the height.
There is a fallback builtin that does not seem to work correct:

        prop = pcf_find_property( face, "PIXEL_SIZE" );
        if ( prop != NULL )
          bsize->height = (FT_Short)prop->value.integer;
[...]
        prop = pcf_find_property( face, "POINT_SIZE" );
        if ( prop != NULL )
          /* convert from 722,7 decipoints to 72 points per inch */
          bsize->size =
            (FT_Pos)( ( prop->value.integer * 64 * 7200 + 36135L ) / 72270L );
[...]
        prop = pcf_find_property( face, "RESOLUTION_Y" );
        if ( prop != NULL )
          bsize->y_ppem =
            (FT_Pos)( ( prop->value.integer * bsize->size + 36 ) / 72 );

        if ( bsize->height == 0 )
          bsize->height =
            (FT_Short)( ( bsize->size * bsize->y_ppem + 2048 ) / 64 / 64 );

For example I have a PCF font here with

no PIXEL_SIZE
POINT_SIZE 170 (= 17pt)
RESOLUTION_Y 78

with above code this results in

size 1084 (= point size 16.9x)
y_ppem 1174 (= 18.x ppem)
height 311 ???

Is this a problem with the font or the formula?

Ciao, Detlef
-- 
_ // address@hidden
\X/  Detlef Wuerkner, Langgoens/Germany



reply via email to

[Prev in Thread] Current Thread [Next in Thread]