[Top][All Lists]

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

Re: [Freetype] Why 26.6 ?

From: David Turner
Subject: Re: [Freetype] Why 26.6 ?
Date: Thu, 19 Sep 2002 01:09:33 +0200
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.1) Gecko/20020826


Peter Montgomery wrote:

Folks, you're getting things all mixed up.  26.6 refers to the placement
of a pixel on a grid with fractional accuracy - in this case the
fraction is 2 ^ 64.  If the 26 refers to pixels (as opposed to inches,
centimeters, etc) , this simply means that you can position text to any
of 64 possible sub-pixel positions.

Levels of anti-aliasing has <nothing> to do with sub-pixel positioning.
You can position text to a fractional position and then render it as 1
bit per pixel monochrome.  This will effectively round off your
positioning to the nearest whole pixel, but you can still specify the
positioning as a fractional pixel.  If you render with 256 levels of
gray, then you have that many levels of anti-aliasing available <no
matter where you position it>!

Think about it.  Suppose that FreeType only allowed you to position text
in whole pixel increments, but you rendered the text with 256 levels of
anti-aliasing.  Does that mean that suddenly the text would become
monochrome?  Of course not.  The positioning accuracy and the
anti-aliasing are completely different aspects of graphics that are not
connected.  In creating a graphics rendering system you can

1 - Have 256 levels of anti-aliasing and no fractional positioning
2 - No anti-aliasing with fractional positioning
3  - Both
4 - Neither

The choice is up to you when you design the renderer.  Among other
choices, FreeType happens to allow fractional positioning with 256
levels of anti-aliasing.

The sole relationship between anti-aliasing and sub-pixel positioning is
that if you expect to see your fractional positioning, then you better
have some anti-aliasing going on.  FreeType uses 256 levels of grayscale
anti-aliasing which is as much as virtually all common display systems
on PCs allow.

Peter is right on topic. The 26.6 convention is necessary to implement
TrueType hinting correctly (with the bytecode interpreter), so using
6 bits of fractional pixel units was a minimum. Experience shows that
it is also largely sufficient to hint other kind of bezier curves, so
it staid in FreeType.

And the reason why we don't use floats are multiple:

  - most embedded systems don't have efficient FPUs, so forget
    about using floats and doubles on these platforms

  - TrueType hinting _requires_ and extensively uses 26.6 fixed
    point computations, using floats/doubles has strictly _no_
    advantage here, except slower operations, even on modern PCs

Hope this helps,

- David Turner
- The FreeType Project  (


----- Original Message -----
From: "Boris Letocha" <address@hidden>
To: <address@hidden>
Sent: Tuesday, September 17, 2002 2:32 AM
Subject: RE: [Freetype] Why 26.6 ?

26.6 the .6 refers 2^6 = 64, isn't it??

Yes, but you have 64 in both axises. 64*64 is 4096 different subpixels.


Freetype mailing list

reply via email to

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