freetype-devel
[Top][All Lists]
Advanced

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

RE: [Devel] Questions about freetype...


From: Graham Asher
Subject: RE: [Devel] Questions about freetype...
Date: Tue, 11 Jun 2002 12:14:45 +0100

<<<<<<
Second problem is how to achieve outline effect (only edges of letter should
be visible). I'm trying do it with Outline functions, but it renders whole
letter....
>>>>>>

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.

Best regards,

Graham Asher
software architect






reply via email to

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