freetype
[Top][All Lists]
Advanced

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

Re: [Freetype] glyph caching


From: Leonard Rosenthol
Subject: Re: [Freetype] glyph caching
Date: Wed, 22 Nov 2000 09:54:11 -0500

At 12:58 PM +0200 11/22/00, George Petrov Georgiev wrote:
freetype is too slow for direct rendering of each char in the text,
without any chaching.

True, but it's not just FreeType - it's ANY vector/outline-based type engine. (you don't really think that Mac OS and Windows (for example) don't do caching, do you??)


I can spend 10~15Mb for  glyph->bitmap cache for gaining 20-30 times faster
text layouting. Is this a dream? I think that itsn't :).

Nope, caching the bitmaps (and even the font information) is the right approach to the problem. I do this two applications of mine that use FreeType, and it noticeably improves performance - though I don't know if it's 20-30x. It's really going to depend on the text in question. Rendering lots of the same character in the same font/face will certainly improve, but text in lots of fonts/faces with different characters won't (since it's still going to have to raster them at least once).

If you are looking for a glyph cache implementation, check out rsvg-ft.c, which is part of librsvg which is part of nautilus which is part of GNOME. (<http://cvs.gnome.org/registry/file.cgi?cvsroot=/cvs/gnome&file=rsvg-ft.c&dir=nautilus/librsvg>)


Don't ask me why I
don't  render all needed fonts and sizes in advance, if and I want to have a
so fast engine :).

I don't believe that this will actually speed things up any more than a "cache as you go" scheme (and might actually make total processing slower) since the delay is the first rasterization not secondary ones, and a "cache as you go" would only rasterizer USED glyphs, rather than every glyph (which can be expensive time wise).


Leonard
--
----------------------------------------------------------------------------
Leonard Rosenthol                       <mailto:address@hidden>
Sr. Software Engineer                   (215) 922-3509 (voice)
Digital Applications                    (215) 440-0504 (fax)

PGP Fingerprint: 8CC9 8878 921E C627 0BC1  15BB FC19 64A9 0016 1397





reply via email to

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