32 #include FT_INTERNAL_DEBUG_H 37 #include FT_INTERNAL_OBJECTS_H 48 #define FT_COMPONENT trace_glyph 68 if ( slot->format != FT_GLYPH_FORMAT_BITMAP )
70 error =
FT_THROW( Invalid_Glyph_Format );
74 glyph->
left = slot->bitmap_left;
75 glyph->
top = slot->bitmap_top;
80 glyph->
bitmap = slot->bitmap;
104 target->
top = source->
top;
128 cbox->xMin = glyph->
left << 6;
129 cbox->xMax = cbox->xMin + ( glyph->
bitmap.
width << 6 );
130 cbox->yMax = glyph->
top << 6;
131 cbox->yMin = cbox->yMax - ( glyph->
bitmap.
rows << 6 );
137 FT_GLYPH_FORMAT_BITMAP,
158 ft_outline_glyph_init(
FT_Glyph outline_glyph,
171 error =
FT_THROW( Invalid_Glyph_Format );
252 slot->outline = glyph->
outline;
263 ft_outline_glyph_init,
292 if ( !
FT_ALLOC( glyph, clazz->glyph_size ) )
295 glyph->
clazz = clazz;
296 glyph->
format = clazz->glyph_format;
319 error =
FT_THROW( Invalid_Argument );
325 if ( !source || !source->clazz )
327 error =
FT_THROW( Invalid_Argument );
331 clazz = source->clazz;
332 error = ft_new_glyph( source->library, clazz, © );
336 copy->
advance = source->advance;
337 copy->
format = source->format;
339 if ( clazz->glyph_copy )
340 error = clazz->glyph_copy( source, copy );
366 return FT_THROW( Invalid_Slot_Handle );
368 library = slot->library;
371 return FT_THROW( Invalid_Argument );
374 if ( slot->format == FT_GLYPH_FORMAT_BITMAP )
398 error = ft_new_glyph( library, clazz, &glyph );
403 glyph->
advance.
x = slot->advance.x << 10;
404 glyph->
advance.
y = slot->advance.y << 10;
407 error = clazz->glyph_init( glyph, slot );
431 if ( !glyph || !glyph->
clazz )
435 clazz = glyph->
clazz;
436 if ( clazz->glyph_transform )
439 clazz->glyph_transform( glyph,
matrix, delta );
465 acbox->xMin = acbox->yMin = acbox->xMax = acbox->yMax = 0;
467 if ( !glyph || !glyph->
clazz )
471 clazz = glyph->
clazz;
472 if ( !clazz->glyph_bbox )
477 clazz->glyph_bbox( glyph, acbox );
530 clazz = glyph->
clazz;
532 if ( !library || !clazz )
539 if ( !clazz->glyph_prepare )
546 FT_MEM_ZERO( &dummy_internal,
sizeof ( dummy_internal ) );
549 dummy.
format = clazz->glyph_format;
566 error = clazz->glyph_prepare( glyph, &dummy );
599 if (
error && bitmap )
621 if ( clazz->glyph_done )
622 clazz->glyph_done( glyph );
#define FT_ALLOC(ptr, size)
ft_outline_glyph_copy(FT_Glyph outline_source, FT_Glyph outline_target)
FT_BEGIN_HEADER FT_Bitmap_New(FT_Bitmap *abitmap)
const FT_Glyph_Class * clazz
struct FT_OutlineGlyphRec_ * FT_OutlineGlyph
typedefFT_BEGIN_HEADER struct FT_Glyph_Class_ FT_Glyph_Class
#define FT_MEM_ZERO(dest, count)
const FT_Glyph_Class ft_outline_glyph_class
enum FT_Render_Mode_ FT_Render_Mode
return FT_THROW(Missing_Property)
GLsizei GLsizei GLchar * source
FT_Bitmap_Done(FT_Library library, FT_Bitmap *bitmap)
ft_outline_glyph_bbox(FT_Glyph outline_glyph, FT_BBox *bbox)
FT_Render_Glyph_Internal(FT_Library library, FT_GlyphSlot slot, FT_Render_Mode render_mode)
GLboolean GLboolean GLboolean b
#define FT_GLYPH_OWN_BITMAP
ft_bitmap_glyph_init(FT_Glyph bitmap_glyph, FT_GlyphSlot slot)
struct FT_BitmapGlyphRec_ * FT_BitmapGlyph
FT_Lookup_Renderer(FT_Library library, FT_Glyph_Format format, FT_ListNode *node)
FT_BEGIN_HEADER typedef unsigned char FT_Bool
FT_Done_Glyph(FT_Glyph glyph)
FT_Glyph_Copy(FT_Glyph source, FT_Glyph *target)
FT_Outline_Copy(const FT_Outline *source, FT_Outline *target)
ft_outline_glyph_done(FT_Glyph outline_glyph)
FT_Outline_Get_CBox(const FT_Outline *outline, FT_BBox *acbox)
FT_Bitmap_Copy(FT_Library library, const FT_Bitmap *source, FT_Bitmap *target)
ft_bitmap_glyph_copy(FT_Glyph bitmap_source, FT_Glyph bitmap_target)
FT_Outline_Transform(const FT_Outline *outline, const FT_Matrix *matrix)
ft_outline_glyph_prepare(FT_Glyph outline_glyph, FT_GlyphSlot slot)
FT_DEFINE_GLYPH(ft_bitmap_glyph_class, sizeof(FT_BitmapGlyphRec), FT_GLYPH_FORMAT_BITMAP, ft_bitmap_glyph_init, ft_bitmap_glyph_done, ft_bitmap_glyph_copy, 0, ft_bitmap_glyph_bbox, 0)
FT_Outline_New(FT_Library library, FT_UInt numPoints, FT_Int numContours, FT_Outline *anoutline)
FT_Outline_Done(FT_Library library, FT_Outline *outline)
FT_Glyph_Class glyph_class
ft_bitmap_glyph_done(FT_Glyph bitmap_glyph)
ft_outline_glyph_transform(FT_Glyph outline_glyph, const FT_Matrix *matrix, const FT_Vector *delta)
ft_bitmap_glyph_bbox(FT_Glyph bitmap_glyph, FT_BBox *cbox)
#define FT_BITMAP_GLYPH_CLASS_GET
#define FT_CALLBACK_DEF(x)
typedefFT_BEGIN_HEADER struct FT_MemoryRec_ * FT_Memory
#define FT_OUTLINE_GLYPH_CLASS_GET
FT_Glyph_To_Bitmap(FT_Glyph *the_glyph, FT_Render_Mode render_mode, FT_Vector *origin, FT_Bool destroy)
FT_Vector_Transform(FT_Vector *vec, const FT_Matrix *matrix)
FT_Slot_Internal internal
FT_Get_Glyph(FT_GlyphSlot slot, FT_Glyph *aglyph)
FT_Outline_Translate(const FT_Outline *outline, FT_Pos xOffset, FT_Pos yOffset)
FT_Glyph_Transform(FT_Glyph glyph, FT_Matrix *matrix, FT_Vector *delta)
FT_Module_Constructor FT_GLYPH_FORMAT_OUTLINE
FT_Glyph_Get_CBox(FT_Glyph glyph, FT_UInt bbox_mode, FT_BBox *acbox)