h2><a name="example4">Example 4: formatted text processing</a></h2>

<p>
See <a href="../example/html.cpp">source code</a>.
</p>

<p>
A classic example of application of the flyweight pattern is that of a
text processor which handles characters with rich formatting information,
like font type, size, color and special options (boldness, italics, etc.)
Coding the formatting information of each character takes considerable
space, but, given the high degree of repetition typical in a document,
maintaining forma