FreeType Tutorial / III

III. Examples

For completeness, here again a link to the example used and explained in the first part of the tutorial.

Erik Möller contributed a very nice C++ example that shows renderer callbacks in action to draw a coloured glyph with a differently coloured outline. The source code can be found here.

Another example demonstrates how to use FreeType's stand-alone B/W rasterizer, ftraster.c. You need files from FreeType version 2.3.10 or newer.

Róbert Márki contributed a small Qt demonstration program (together with its qmake file) that shows both direct rendering with a callback and rendering with a buffer, yielding the same result. You need FreeType 2.4.3 or newer.

Here is some simple C++ code (contributed by Static Jobs LLC) that uses FT_Outline_Decompose to convert a glyph outline to the SVG format. As an example, here is the resulting file of the call

example5 LiberationSerif-Bold.ttf @ > example5.svg

(you can find the Liberation font family here).

Last update: 13-Feb-2018