Anti-Grain Geometry Tutorial
Font - Advanced

Using font glyphs as path objects, it is possible to use them besides drawing plain texts.

In this tutorial, drawImage function in Image - Path and Transformation is modified a bit to take on different fill rules.

And instead of directly drawing glyphs immediately, they are saved to agg::path_storage. Then we pass the generated path to drawImage function.

Example

tutorial_font_2.cpp uses font path as clip region to draw images.

tutorial_font_2.png

A more or less equivalent SVG is the following. SVG has limited clip path manipulation, so mask has to be used.

tutorial_font_2.svg