[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [ft] FT_Outline_Render not calling my span function.
From: |
Erik Möller |
Subject: |
RE: [ft] FT_Outline_Render not calling my span function. |
Date: |
Thu, 26 Feb 2009 13:14:08 +0100 |
I'm in a bit of a rush so couldn't spot what's wrong in your snippet, but I
just made a post earlier today in reply to another thread called "Questions
with freetype". Check that out and compare with your source, it does exactly
what you're trying to accomplish.
Erik Möller,
Timetrap
http://www.timetrap.se
http://www.emberwind.se
-----Original Message-----
From: address@hidden [mailto:address@hidden On Behalf Of Adrian May
Sent: den 26 februari 2009 10:59
To: address@hidden
Subject: [ft] FT_Outline_Render not calling my span function.
Hi folks,
The samples say something like "... load vectorial glyph in ‘outline’
..." before calling FT_Outline_Render. But how? I'm doing the
following and it ain't working. All the FT_ calls return success but
my span function never gets called. Any clues greatly appreciated...
void MySpanFunc(int y, int count, const FT_Span* spans, void* user )
{
cout << "MySpanFunc\n";//this never happens
}
void freetypeplay()
{
DrawRect(0, 0, 240, 320, RGB(0,0,64));
FT_Error err=0;
FT_Library library;
FT_Face face;
FT_GlyphSlot slot = face->glyph;
FT_Raster_Params rps;
rps.flags = FT_RASTER_FLAG_AA | FT_RASTER_FLAG_DIRECT;
rps.gray_spans = &MySpanFunc;
rps.user = 0;
//Program says "FT all OK 0" so no errors returned by these calls...
cout << (
(err= FT_Init_FreeType( &library )
) ? "FT_Init_FreeType error " :
(err= FT_New_Face( library, "/mnt/stick/jabil/unifont.ttf",
0, &face
) ) ? "FT_New_Face error " :
(err= FT_Set_Char_Size(face, 0, 30*64, 100, 100)
) ?
"FT_Set_Char_Size error " :
(err= FT_Load_Glyph( face, 65, FT_LOAD_DEFAULT )
) ?
"FT_Load_Char error " :
(err= FT_Outline_Render( library, &slot->outline, &rps )
) ?
"FT_Outline_Render error " :
"FT all OK " ) << err << endl;
}
Thanks in advance,
Adrian.
_______________________________________________
Freetype mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/freetype
__________ Information from ESET NOD32 Antivirus, version of virus signature
database 3890 (20090226) __________
The message was checked by ESET NOD32 Antivirus.
http://www.eset.com
__________ Information from ESET NOD32 Antivirus, version of virus signature
database 3891 (20090226) __________
The message was checked by ESET NOD32 Antivirus.
http://www.eset.com