freetype-devel
[Top][All Lists]
Advanced

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

RE: [Devel] FT_Face_GetAdvancesFunc


From: Turner David
Subject: RE: [Devel] FT_Face_GetAdvancesFunc
Date: Tue, 16 Dec 2003 11:27:29 +0100

Hello all,

> -----Original Message-----
> From: address@hidden [mailto:address@hidden
> Behalf Of Werner LEMBERG
> Sent: Sunday, December 07, 2003 5:06 AM
> To: address@hidden; address@hidden
> Subject: Re: [Devel] FT_Face_GetAdvancesFunc
> 
> 
> 
> > 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 was to provide a function that would be capable of returning the
glyph advances in _font_units_ or a given _range_ of glyphs. This being
much faster than loading each glyph individually.

Basically, the idea is to be able to perform device-independent text
layout without loading a single glyph image.

I have never implemented it, though it shouldn't be very difficult
to do.

This has nothing to do with kerning, by the way. The "vertical"
parameter is only used to distinguish horizontal and vertical advances
for a given glyph range.

Regards,

- David Turner
- The FreeType Project  (www.freetype.org)


> 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
> 
> _______________________________________________
> Devel mailing list
> address@hidden
> http://www.freetype.org/mailman/listinfo/devel
> 

--
This message and any attachments (the "message") is intended solely for the
addressees and is confidential. If you receive this message in error, please
delete it and immediately notify the sender.
Any use not in accordance with its purpose, any dissemination or disclosure,
either whole or partial, is prohibited except formal approval.
The E-Mail transmission can not guarantee the integrity of this message.
CANAL+TECHNOLOGIES will not therefore be liable for the message if modified.





reply via email to

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