freetype
[Top][All Lists]
Advanced

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

[Freetype] FreeType and Carbon PixMaps


From: James Turnbull
Subject: [Freetype] FreeType and Carbon PixMaps
Date: Thu, 13 Mar 2003 13:16:17 +0000

I am attempting to convert a Freetype FT_Bitmap into a Carbon (Mac OS) Pixmap. The structure of this PixMap is described at the following page: http://tinyurl.com/7e6r (Link to a google cached page from apple.com).

The following code just draws gunk, any pointers on where I'm going wrong would be much appreciated...

FT_Load_Glyph (face, glyph_index, FT_LOAD_DEFAULT);
if (face->glyph->format != ft_glyph_format_bitmap)
        FT_Render_Glyph (face->glyph, ft_render_mode_normal);

...

//Make a new Gworld to get a pixmap out of.
GWorldPtr newgw = NULL;
NewGWorld(&newgw, 8, &src_rect,  NULL, NULL, pixelsLocked);

//Get the Pixmap
PixMap* src_pm = *GetGWorldPixMap(newgw);

// Setup pixmap fields
src_pm->baseAddr = face->glyph->bitmap.buffer;
src_pm->rowBytes = face->glyph->bitmap.pitch;

...

// Copy onto the destination
CopyBits(src_pm, dst_bm, &src_rect, &dst_rect, srcCopy, NULL);

TIA,

James




reply via email to

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