freetype-devel
[Top][All Lists]
Advanced

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

Re: [Devel] FT_Face_GetAdvancesFunc


From: Werner LEMBERG
Subject: Re: [Devel] FT_Face_GetAdvancesFunc
Date: Sun, 07 Dec 2003 05:05:58 +0100 (CET)

> I'd like to know about FT_Face_GetAdvancesFunc and
> FT_Driver_ClassRec::get_advances.
>
> It seems that none driver uses this field. Right?

Correct.

> Will you use this field in the future?  Will you move this field to
> a service?

Good questions.  David, what was the intention to add this field?
It reminds me to /Widths array in PDFs, something like this:

  <</BaseFont/CVDCZD+msmin17
    /FontDescriptor 67 0 R
    /Type/Font
    /FirstChar 0
    /LastChar 117
    /Widths[
      0 0 0 1000 0 0 0 0 0 0 0 0 0 0 0 0
      0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
      0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
      0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
      0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
      0 0 0 0 0 0 0 0 0 0 0 0 1000 0 0 0
      0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
      0 0 0 0 0 1000]
    /Encoding 255 0 R
    /Subtype/Type1>>

Anyway, I don't think that we need a special function for that.

>   typedef FT_Error
>   (*FT_Face_GetAdvancesFunc)( FT_Face     face,
>                               FT_UInt     first,
>                               FT_UInt     count,
>                               FT_Bool     vertical,
>                               FT_UShort*  advances );
>
>   /*    get_advances     :: A function handle used to return the advances  */
>   /*                        of 'count' glyphs, starting at `index'.  the   */
>   /*                        `vertical' flags must be set when vertical     */
>   /*                        advances are queried.  The advances buffer is  */
>   /*                        caller-allocated.                              */
>
> I cannot find `index' in the typedef.  Maybe the correct typedef is
>
>   typedef FT_Error
>   (*FT_Face_GetAdvancesFunc)( FT_Face     face,
>                               FT_UInt*    index,
>                               FT_UInt     count,
>                               FT_Bool     vertical,
>                               FT_UShort*  advances );

I don't think so.  I rather believe that you simply should replace
`index' with `first' in the documentation comment.

> BTW, what is `advance'?  I guess the the advance is something like
> kerning: kerning value between index[n-1] and index[n] is
> advance[n].  Right?  Misunderstanding?

I think this is not correct.  `Advance' appears to be the advance
value as stored in a font, in font units.

> If my guessing is correct, I propose to change the typedef to
>
>
>   typedef FT_Error
>   (*FT_Face_GetAdvancesFunc)( FT_Face     face,
>                               FT_UInt*    index,
>                               FT_UInt     count,
>                               FT_Bool     vertical,
>                               FT_Vector*  advances );
>
> So we can support cross-stream kerning like TeX.

Cross-stream kerning?  Standard TeX doesn't support this AFAIK, except
if you use virtual fonts -- but then you can add almost arbitrary code
into a glyph slot.  What exactly do you mean?

I'm open to any suggestion since you've found dead code.


    Werner



reply via email to

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