[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [ft] Fill and stroke
From: |
erik |
Subject: |
RE: [ft] Fill and stroke |
Date: |
Thu, 27 Aug 2009 06:45:09 +0000 |
User-agent: |
Internet Messaging Program (IMP) H3 (4.3.4) |
I’m not aware of any caching being done on spans.
I’d suggest you take a look inside the FT_Outline you pass to the
renderer and make sure it is actually different data you’re sending.
There’s nothing magical or spectacular about the structure, this is
how I built one manually from some simple vector data:
static float k_shape[][2] = { {-3, -18}, {0, -12}, .....
// Build an outline manually from our acorn shape
FT_Outline_ outline;
outline.n_contours = 1;
outline.n_points = sizeof(k_shape)/(sizeof(float) * 2);
outline.points = new FT_Vector[outline.n_points];
outline.tags = new char[outline.n_points];
for (int i = 0; i < outline.n_points; ++i)
outline.tags[i] = 1;
outline.contours = new short[outline.n_contours];
outline.contours[0] = outline.n_points - 1;
outline.flags = 0;
At least then you know if it’s your fault or FreeTypes :)
Kind Regards,
Erik Möller
http://www.timetrap.se
From: address@hidden
[mailto:address@hidden On Behalf Of
Cristian Vicol
Sent: den 25 augusti 2009 23:49
To: address@hidden
Subject: Re: [ft] Fill and stroke
Thanks a lot!
The rastered glyphs look much better now. Unfortunatelly, I'm facing now a
problem which I had not previously, when working with bitmap glyphs. I need
to transform (slant) some glyphs. As long as only one glyph variant occurs
(either normal or slanted), all it's ok. But as soon I have both variants
for the same glyph and pointsize, I'm geting the SAME spans on the second
call as in the first one.
Basically I used similar code you've posted, with the difference that I'm
doing after FT_Load_Glyph
FT_Get_Glyph(face->glyph, &glyph);
if(fbSlanted)
FT_Glyph_Set_Transform(glyph, &slantMatrix, NULL);
else
FT_Glyph_Set_Transform(glyph, NULL, NULL);
This is called with fbSlanted TRUE or FALSE, according to input text: I'm
getting in the second call (for the same glyph/pointsize combination) the
same spans as in the first one. For all glyphs I'm using FT_Done_Glyph at
the end of the function. It seems as FreeType is doing some sort of spans
caching... What else should I reset?
Best regards,
Cristian Vicol
----- Original Message -----
From: "Erik Möller" <address@hidden>
To: "'Cristi'" <address@hidden>; <address@hidden>
Sent: Wednesday, August 19, 2009 9:05 PM
Subject: RE: [ft] Fill and stroke
Hi Cristian,
As far as I know the only way to do that properly is by using freetypes
direct rendering feature. I did a small sample program to illustrate how to
do this last time the topic was on the list. Check out this link
http://freetype.sourceforge.net/freetype2/docs/tutorial/step3.html
Kind regards,
Erik Möller
http://www.timetrap.se
-----Original Message-----
From: address@hidden
[mailto:address@hidden On Behalf Of Cristi
Sent: den 19 augusti 2009 12:05
To: address@hidden
Subject: [ft] Fill and stroke
Hello,
Is it possible with FreeType to fill and stroke a glyph in a singe raster
operation? The problem I have is that decomposed in two steps (fill and the
stroke) and then copy both images, the result does not see good. For some
fonts/glyphs the stroked glyph is smaller then the filled one (theoretically
should be bigger), for others the shape is completly different or the
difference between left offsets (bitmap.left) too big. That's why the
resulting images contain gaps between the stroked and filled glyph. Is there
a way to directly fill and stroke an outline?
Thanks!
Cristian Vicol
--
Jetzt kostenlos herunterladen: Internet Explorer 8 und Mozilla Firefox 3 -
sicherer, schneller und einfacher! http://portal.gmx.net/de/go/chbrowser
_______________________________________________
Freetype mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/freetype
__________ Information from ESET NOD32 Antivirus, version of virus signature
database 4347 (20090819) __________
The message was checked by ESET NOD32 Antivirus.
http://www.eset.com
__________ Information from ESET NOD32 Antivirus, version of virus signature
database 4349 (20090819) __________
The message was checked by ESET NOD32 Antivirus.
http://www.eset.com
__________ Information from ESET NOD32 Antivirus, version of virus
signature database 4367 (20090825) __________
The message was checked by ESET NOD32 Antivirus.
http://www.eset.com