freetype
[Top][All Lists]
Advanced

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

Re: [ft] Faster computation of text width?


From: Werner LEMBERG
Subject: Re: [ft] Faster computation of text width?
Date: Fri, 13 Mar 2015 19:51:16 +0100 (CET)

> Indeed, working more on this issue I realized, that using
> FT_ADVANCE_FLAG_FAST_ONLY together with FT_LOAD_TARGET_LCD causes
> FT_Get_Advance to fail always.  Removing FT_ADVANCE_FLAG_FAST_ONLY,
> makes it work but very slow.
> 
> On the other hand, using FT_LOAD_NO_HINTING makes it to work really
> fast, but the computed width is not the same as the width of the
> rendered string with hinting enabled.
> 
> Which makes this function almost useless in the real world... :(

Well, caching is the solution.  Additionally, in case a font has a
hdmx table, and you are in non-ClearType mode, you can use the
pre-computed advance widths for a given PPEM value.

> Well I tested it with the following code (I simplified it in order
> to be more clear).  [...]

Uh, oh, please provide a C snippet, and tell us which font you are
using.  I apologize for not being able to work with ASM.


    Werner



reply via email to

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