freetype-devel
[Top][All Lists]
Advanced

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

[Devel] Problems with retrieving kerning adjustments out of PFR font


From: Adam Piotrowski
Subject: [Devel] Problems with retrieving kerning adjustments out of PFR font
Date: Wed, 28 Jan 2004 15:33:53 +0100

Dear Freetypers,

I have found 3 problems with retrieving kerning adjustments out of PFR font.
(I have tested with Tiresias Screenfont v7.51)

1. Negative kerning adjustments are handled incorrectly.

   In the file freetype2/src/pfr/pfrload.c, in function
   pfr_sort_kerning_pairs(), line 724 looks like:
     kerning = item->base_adj + FT_NEXT_CHAR( p );
   but should be:
     kerning = item->base_adj + FT_NEXT_BYTE( p );

   (single byte adjustments are unsigned - see the spec of PFR format:
    http://www.davic.org/Download/Spec1_4_1/141_part09.pdf - Information
    Representation, Annex A - Coding of the Outline Fonts, par. A.10 Kerning
    data)

2. service->get_kerning method for PFR returns void, but is called in the
   context where FT_Error is expected.

   In the file freetype2/src/base/ftpfr.c, in function FT_Get_PFR_Kerning(),
   line 93 service->get_kerning is called.
   It is set to point to pfr_face_get_kerning() (freetype2/src/pfr/pfrdrivr.c,
   line 131). pfr_face_get_kerning() is defined in freetype2/src/pfr/pfrobjs.c,
   line 414 and has return value of the type void.

   Previously (FreeType2 v2.1.4) service->get_kerning was set to point to
   pfr_get_kerning() (returning FT_Error, defined in 
freetype2/src/pfr/pfrdrivr.c,
   line 31) but has been changed to pfr_face_get_kerning(), because (I guess)
   pfr_get_kerning() returned kerning adjustment in outline resolution instead
   of metrics resolution.

   I'm not sure about the right solution here, any suggestions?

3. ft_pfr_check() returns invalid pointer to face driver services when
   compiled with optimisation enabled (-O2 option). It works fine when
   compiled with no optimisation (-O0).

   ft_pfr_check() uses macro FT_FACE_LOOKUP_SERVICE()
   (defined in freetype2/include/freetype/internal/ftserv.h, line 202)
   I observed that if at the end of macro after the line 220:
     *pptr = svc;
   I add the following:
     ptr = svc;
   correct pointer to services is returned even when compiled with optimisation
   enabled. This might be platform or compiler specific problems (I use
   Cygwin on WinXP, Pentium IV, gcc v3.2)
   Did anyone else observed similar problems?

 Best Regards.


 Adam



reply via email to

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