freetype
[Top][All Lists]
Advanced

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

Re: [ft] Algorithm Of Freetype


From: Peter Grandi
Subject: Re: [ft] Algorithm Of Freetype
Date: Mon, 20 Mar 2017 20:41:33 +0000

> I am an algorithm engineer in image processing. Here I have
> some question to ask you (maybe about the history of these
> algorithm )

I am not a freetype developer but I have been following font
rendering issues for a while.

> research the panel sub pixel arrangement and sub pixel
> rendering for oled screen.

Good, let's hope we get them soon.

> 1. what does mac or apple system using for "font display".
>    Is that the “truetype”?

Truetype is not a font display system, it is a font format with
many complicated aspects.

Roughly all font display systems have several components, like:

* A font format that given a character code allows a font
  rasterizer to generate a glyph made of pixels. There are
  several different font formats, the most popular are
  TrueType, PostScript Type 1, and OpenType.
* A font rasterizer like FreeType that produces a pixel raster
  from some font file and a character code. There are many
  different font rasterizer implementations.
* A text renderer that takes a string of character codes and
  layout instructions, and using a font rasterizer and font
  files creates a pixmap with the glyphs for the character
  codes rendered in it according to the layout instructions.
  There are very many text renderer implementations.

The whole complicated stack of concepts is briefly summarized
here:

  http://www.sabi.co.uk/Notes/linuxFonts.html#importantConcepts

> 2. ClearType using 3 channel to calculate the rendering
>    font. I can't understand it. I also see the freetype code
>    doing like this.

Rasterizing a glyph often is done by first rasterizing to a
bitmap and then scaling doing to a graylevel or color pixmap
using some kind of filter, sometimes preserving even subpixel
positioning, not just rendering. Sometimes that can be done in a
single pass. The biggest problem as you know for color pixemap
rasterization is fringing.

There are many online and printed articles on how glyph
rasterization is done. Almost all techniques are patented, but
many patents have expired. Some links about terminology and
examples:

* General introduction with several interesting links:
    https://en.wikipedia.org/wiki/Subpixel_rendering#See_also
* Another nice illustrated introduction:
    https://www.grc.com/ctwhat.htm
* "A Treatise on Font Rasterisation With an Emphasis on Free
  Software"
    https://freddie.witherden.org/pages/font-rasterisation/
* "The Raster Tragedy at Low-Resolution Revisited"
    http://www.beatstamm.com/Typography/
* Random subpixel rendering patent:
    https://www.google.ie/patents/US6384839

> 3. Because the ClearType only do the horizontal so some
>    Vertical Shape may have sawtooth? There are many reason:
>    1. horizontal have three subpixel;
>    2. human visual system are sensitive to the horzontal direction.

AFAIK that's 1), simply because that is the way LCD screens are
subpixeled. Why did LCD engineer decide to subpixel them
horizontally? I don't know.



reply via email to

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