freetype-devel
[Top][All Lists]
Advanced

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

Re: how can I set exactly pixel?


From: Werner LEMBERG
Subject: Re: how can I set exactly pixel?
Date: Fri, 27 Dec 2019 19:00:58 +0100 (CET)

>> For most outline fonts, it is not possible to get exact glyph
>> dimensions in advance (exception: the font contains an `hdmx' table
>> that holds horizontal, device-dependent information for selected
>> pixel sizes).  In other words, you have to render all (needed)
>> glyphs to get their widths and heights, adjusting the scaling value
>> as necessary in an iterative process until you are done.
>> 

>> To avoid rendering again you should use a glyph image and metrics
>> cache.
> 
> Then what is the story about monospace outline fonts?
> 
> (For instance, liberation/dejavu monospace otf/ttf outline fonts?)

As the name of such font says, all glyphs have the same advance width.
However, there is *zero* guarantee that the outline stays in a certain
rectangle that is as wide as this advance width.  For example, imagine
a slanted monospace font, where a lot of glyphs will stick out to the
right that varies from glyph to glyph.


    Werner



reply via email to

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