freetype-devel
[Top][All Lists]
Advanced

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

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


From: Werner LEMBERG
Subject: Re: [Devel] Problems with retrieving kerning adjustments out of PFR font
Date: Wed, 25 Feb 2004 22:50:23 +0100 (CET)

> Below is my post to the group I have sent on January 28, and
> acoording to Your warning it could have been lost among the spam
> generated by MyDoom virus.
>
> I just wanted to ask if this was the case or there was no response
> on group due to lack of resources/lack of interest in PFR fonts
> support.

Lack of resources, I think.  Our PFR expert is David, and he is
*very* busy -- hopefully he has time to comment your report.

> If You do not have time to deal with the matter please tell me not
> to bother You any more :)

Exactly the opposite!  Without remainders it is fairly possible that
nothing happens.  So please be a `pain in the ass', so to say.

> By all means I'm willing to contribute resolution to reported
> problems, I just need some advice.  (1st problem is clear, as far as
> 2nd is concerned I'm not sure wether the policy is that
> service->get_kerning should return void or not, 3rd is most unclear
> to me, I don't understand the reason of the strange type casting.)

I think David can help you.


    Werner


======================================================================

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