freetype-devel
[Top][All Lists]
Advanced

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

Re: [Devel] What's sub-banding?


From: David Turner
Subject: Re: [Devel] What's sub-banding?
Date: Thu, 15 Mar 2001 18:45:39 +0100

"Zhu, Jon" a écrit :
> 
> Hello,
> 
>         I am a FREETYPE user. While reading the source, I just cannot
> understand some codes concerning sub-banding. Could you give me some comment
> on it? Any help will be appreciated.
> 

Sub-Banding is related to the way FreeType converts glyph images to
bitmaps or anti-aliased pixmaps.

Basically, all scan-line operations are performed with the help of a
single
block of memory called the "render pool". The pool is used as a simple
growing
heap during a FT_Outline_Render call, holding temporary data required to
render
a glyph outline. This allows very fast allocations, as well as quick
freeing of
all temporaries once the job is completed.

When a glyph is very complex, or very large, the pool isn't big enough
to
hold all of the required data. The scanline conversion routine detects
such
cases (through a heursitic as well as through runtime detection) and
automatically partitions the rendering operation into two "sub-bands"

this means that the conversion is restarted. It will first try to render
the
"upper half" of the glyph bitmap, then the "lower half". Additionally,
the
sub-banding process is recursive.

Usually, this means that very complex or large glyphs are always
rendered
with constant memory use, even if more slowly than simple ones. If you
think that your glyphs are rendered too slow, try changing the value of
the FT_RENDER_POOL_SIZE macro in "include/freetype/config/ftoption.h"

It is set to 32Kb by default, but I've been working with render pools of
8 Kb without problems on some systems.

Note also that the render pool is only used during scanling conversion.
It is thus possible to share its content with other algorithms that need
a "temporary workspace" too (when using the scan-line converter in
stand-alone mode, as it's certainly more difficult in FT2 itself)

Regards,

- David



reply via email to

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