freetype-devel
[Top][All Lists]
Advanced

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

Re: [Devel] Freetype and contours...


From: Vincent Caron
Subject: Re: [Devel] Freetype and contours...
Date: 19 Jun 2002 14:22:30 +0200

On Wed, 2002-06-19 at 11:13, robal wrote:
> Hi !
> I have an question about rendering contours and outlines with fonts. I mean,
> i want to render font normally and add to it an outline in different colour
> in a diferent width, with antialiasing of course. Is it any simple way to do
> it with freetype functions? I prefer ready, free solutions - can You help
> me? Or maybe some links, everything is needed...

The simplest technique requires you to draw the same string multiple
times with the 'border color', then once with the text color. Graham
Asher provided more details only 8 days ago, quoting him :

"The easiest way to draw an outline, given a bitmap, is to draw the
bitmap five times. Draw it the first 4 times in black, at positions one
pixel above, left, right and below the normal position. Then draw it a
final time at the origin in white.

For an outline with square rather than rounded corners, draw 9 times:
the first 8 times in black at all positions one pixel away from the
origin, the the ninth time at the origin in white as before.

You can also, of course, draw the outline as a series of strokes, but
that is *much* more difficult and will actually give worse results for
small sizes. It's more difficult because for perfect results you have to
compute the envelopes of strokes defined as quadratic or cubic splines,
which is a very hard problem in analytic geometry."






reply via email to

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