freetype
[Top][All Lists]
Advanced

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

Re: [ft] Generating borders (strokes)


From: Soren Dreijer
Subject: Re: [ft] Generating borders (strokes)
Date: Mon, 11 Feb 2013 10:23:14 -0600

Hi Werner,

Yes, I've already taken a look at the example, but it doesn't resemble any of the other tutorials on the website since it renders with spans rather than to a bitmap. Ignoring that part, though, the only difference between that code and mine is that it uses FT_Glyph_StrokeBorder() rather than FT_Glyph_Stroke() and that the stroke radius is much thicker than mine (outlineWidth * 64).

If I change my example to use a radius of 64, then it looks much better (there's actually a black border), but the problem is that I'm rendering with a huge font size (a height of 400 pixels) for testing purposes and as soon as I make the characters a regular size, e.g. 32 pixels tall, then I can't use a border with a radius of 64 since that eats up the full glyph, and making the border any smaller results in my original problem (i.e. no opaque pixels in the border).

The example you linked to also render the border in a different way: it uses FT_Glyph_StrokeBorder() to create the border (which looks like this https://dl.dropbox.com/u/2406449/FreeType/outside_border.jpg), which is fully opaque, and then the example draws that before the actual glyph (I think there was a question here on the mailing list from somebody else regarding that order).

I just want the same border that FT_Glyph_StrokeBorder() (correctly) generates, but with the proper opaque colors as generated by FT_Glyph_StrokeBorder().


On Mon, Feb 11, 2013 at 12:42 AM, Werner LEMBERG <address@hidden> wrote:

> I'm trying to create a border outline around my FreeType glyphs with
> the stroke functions [...]
>
> Am I doing something horribly wrong here or what's going on?

No time to look closer into your example, but have you seen this
tutorial?

  http://www.freetype.org/freetype2/docs/tutorial/example2.cpp


    Werner


reply via email to

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