[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Freetype] Caching glyph metrics
From: |
David Turner |
Subject: |
Re: [Freetype] Caching glyph metrics |
Date: |
Wed, 17 Apr 2002 14:51:33 +0200 |
Hi Michael,
Michael Day a écrit :
>
> > > What do you not understand in the cache sub-system ? Are you aware of the
> > > following draft (that is part of the "ft2docs" package):
> > >
> > > http://www.freetype.org/freetype2/docs/cache.html
>
> I've written a basic glyph metrics cache by copying the image cache,
> however I've noticed that linearHoriAdvance (which I need) is stored in
> the glyph slot rather than the glyph metrics. Any particular reason for
> that?
>
Yes. There are several reasons:
- because the glyph metrics structure is used to report the
metrics of the current glyph image, which is generally
altered by hinting (or embedded bitmap substitution)
- because it's in different units than the rest of the
glyph metrics (i.e. 16.16 fixed point pixels or integer
font units)
- to encourage application developers to realize that they
should not use it to perform text layout naively.
at low resolutions, this always produces crap results.
at high resolution, you'd better use the hinted metrics
anyway, since you shouldn't spot the difference
and if you want to be WYSIWYG, you should only use them
to compute line lengths, use the hinted metrics to
compute glyph placement on the line, while adjusting
inter-word or even inter-letter spacing to correct for
any difference between the hinted and linear line width..
Hope this is clear..
- David Turner
- The FreeType Project