freetype
[Top][All Lists]
Advanced

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

Re: [ft] face->size->metrics.max_advance should not be used?


From: Werner LEMBERG
Subject: Re: [ft] face->size->metrics.max_advance should not be used?
Date: Thu, 02 Jun 2005 09:27:29 +0200 (CEST)

> I am reading the part II of the tutorial and in section 3.b, it says
> face->size->metrics.height is the only field of face->size->metrics
> one should really use.

Read: 

  ... face->size->metrics.height is the only field of
 face->size->metrics which is useful in general.

> In other words, it says face->size->metrics.max_advance should not
> be used. But then how should one render equally-spaced string?

You mean to render glyphs equally-spaced even if the glyphs have
different widths?

> I have this question because I imagined that this is done by
> rendering each glyph and advancing the pen position by, instead of
> the glyph's advance width, face's max advance width.  If this is not
> the case, then what should be used as the common advance width?

Well, `max_advance' is not a reliable value.  Most CJK fonts which are
declared as `monospaced' have both single-width and double-width
glyphs.  This is unfortunate, but it is rather simple code to check
this.

IMHO you have to trust the font, this is, to use the glyph's advance
widths.  A (non-CJK) font which declares itself as monospaced but has
non-equal widths is simply broken.


    Werner




reply via email to

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