freetype
[Top][All Lists]
Advanced

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

RE: [ft] Thick contours


From: Turner, David
Subject: RE: [ft] Thick contours
Date: Wed, 30 Mar 2005 16:29:34 +0200

Salut Arnaud,
As the attached screenshot shows, I’d like to render “outlined” fonts. On the left, this is the Photoshop version, on the right this is mine.

I don’t know how Photoshop does, but my method is quite simple:

- I render 4 times in black, with a 1 pixel offset in X and Y -> it gives (x+1, y+1), then (x-1, y+1), then (x-1, y-1), and finally (x+1, y-1)

- Then I render in white on top of that on location (x, y)

 

My rendering is pixel aligned, and the generated texture font too (it’s an OpenGL application, so I render all glyphs in a memory texture for faster access). I use exactly the same font in all 5 render steps. As an example, I attached you the plain standard rendering at the same size (Standard font.bmp) I made using FreeType.

 

As you can see the result for the outline is quite deceiving, would you have any advice on this? I’d like to have the best result possible …

 

You could try using the FreeType stroker, which is capable of modifying the vectors to create outlines and borders.

See FT_STROKER_H, i.e. <freetype/ftstroke.h> for the API.

 

Unfortunately, this code was still slightly buggy in 2.1.9. It has been fixed in the current CVS though.

This should give you results that match or even exceed Photoshop :-) You should probably create an

"outside" border, fill it in black, then fill the regular outline in white, or something similar.

 

 

- David Turner

- The FreeType Project  (www.freetype.org)

 

PS: For all non-French speaking people, I suppose Arnaud wanted to say "décevant" (i.e. disappointing) !

 

 

(sorry David for the private mail I sent you before subscribing to the mailing list)

 

Kind regards

 


reply via email to

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