freetype
[Top][All Lists]
Advanced

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

Re: [Freetype] Caching glyph metrics


From: Michael Day
Subject: Re: [Freetype] Caching glyph metrics
Date: Thu, 18 Apr 2002 09:16:17 +1000

Hi David,

> Yes. There are several reasons:

...

>   - to encourage application developers to realize that they
>     should not use it to perform text layout naively.

Ah. I think this is what I am doing :)

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

Hmm. So, please correct me if I'm wrong:

 - linearHoriAdvance is the advance width of the glyph if rendered on a 
very very very high (infinite?) resolution device

 - on a screen at 96dpi, the width may be different, as hinting may make
an 'm' wider to fit all three stems, for example

 - so using linearHoriAdvance to calculate glyph placement on a 96dpi 
screen (particularly for small text?) could result in glyphs partially 
overlapping or spaced too far apart

 - but if you use only the hinted glyph metrics for layout, you will get
different results for different output resolutions (like Word).

 - as the only glyph that can be transparently stretched is space, your 
solution is to use the hinted glyph metrics for layout, but stretch or 
shrink spaces to compensate for the difference between the hinted metrics 
and linearHoriAdvance. This way the text should look good even at low 
resolutions, but still have the same layout regardless of the resolution

Is that right? It sounds pretty clever, although I can't help wondering
what happens if-there-is-a-big-string-of-words-with-no-spaces :)

One last question: if you are performing layout for a PDF file, you would
use the unhinted glyph metrics exclusively?

Michael




reply via email to

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