freetype
[Top][All Lists]
Advanced

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

[ft] repeated file access by SBit cache for blank character


From: Ingmar Frank
Subject: [ft] repeated file access by SBit cache for blank character
Date: Wed, 09 Mar 2011 09:34:43 +0100
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.15) Gecko/20110303 Lightning/1.0b2 Thunderbird/3.1.9

Hello everybody,

we've noticed repeated file access by the small bitmap cache when looking up the blank character (code 32). Our rendering engine iterates over the string to be printed, calling FTC_SBitCache_Lookup() to obtain the glyph for each character. The problem seems to be that for the blank there is no glyph image, which makes sense, but we need the x advance. When performing this look-up FreeType accesses the file each time.

We've supplied our own callbacks for file access which made it easy to determine that this is the source of some major slowdowns, especially when the fonts are stored on slow media (like SD cards).

We currently have a workaround in place that stores the x advance for each size in our application. But we would like to avoid this kind of thing. So the question is, is this a bug, or are we not using the API correctly? We suspect that since there is no glyph image (or its width and height is 0) the cache assumes that it needs to create the glyph and therefore opens the file over and over again.

Kind regards,
Ingmar Frank




reply via email to

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