freetype-devel
[Top][All Lists]
Advanced

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

[ft-devel] (no subject)


From: Vladimiros Papaditsas
Subject: [ft-devel] (no subject)
Date: Tue, 8 May 2012 17:29:10 +0100

Hello,

I have found some port attempts of freetype2 for .NET and I try to set up a working project of mine. My intention is to read the bytes of a generated glyph's buffer. The problem is that when I try to create a .NET Bitmap objects from these bytes I always get exceptions or garbage no matter what alternatives I have used. With freetype I have tried two approaches :

Init_Freetype();
New_Face();
Set_Pixel_Sizes();
Get_Char_Index();
Load_Glyph();
Render_Glyph();

And then from the GlyphSlotRec structure that Render_Glyph() saves, I try to read bitmap.buffer. My second approach is the following :

Init_Freetype();
New_Face();
Set_Pixel_Sizes();
Get_Char_Index();
Load_Glyph()
Get_Glyph();
Glyph_To_Bitmap();

And then with a typecast I get a Bitmap_Glyph structure object. 

All the methods I mentioned above return 0 so there are no errors. And the typecast seems ok. Obviously there is something wrong when i try to access the bytes of the generated glyph like this :

glyph.bitmap.buffer. 

The way I try to read the buffer is by copying the bytes starting at the memory location of the buffer ranging until glyph.bitmap.width * glyph.bitmap.rows.

Any suggestions or hints?

Thanks,

Vlad

reply via email to

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