本文整理匯總了C++中FT_GLYPH函數的典型用法代碼示例。如果您正苦於以下問題:C++ FT_GLYPH函數的具體用法?C++ FT_GLYPH怎麽用?C++ FT_GLYPH使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了FT_GLYPH函數的12個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: ft_outline_glyph_done
ft_outline_glyph_done( FT_Glyph outline_glyph )
{
FT_OutlineGlyph glyph = (FT_OutlineGlyph)outline_glyph;
FT_Outline_Done( FT_GLYPH( glyph )->library, &glyph->outline );
}
示例2: ft_bitmap_glyph_init
ft_bitmap_glyph_init( FT_Glyph bitmap_glyph,
FT_GlyphSlot slot )
{
FT_BitmapGlyph glyph = (FT_BitmapGlyph)bitmap_glyph;
FT_Error error = FT_Err_Ok;
FT_Library library = FT_GLYPH( glyph )->library;
if ( slot->format != FT_GLYPH_FORMAT_BITMAP )
{
error = FT_Err_Invalid_Glyph_Format;
goto Exit;
}
glyph->left = slot->bitmap_left;
glyph->top = slot->bitmap_top;
/* do lazy copying whenever possible */
if ( slot->internal->flags & FT_GLYPH_OWN_BITMAP )
{
glyph->bitmap = slot->bitmap;
slot->internal->flags &= ~FT_GLYPH_OWN_BITMAP;
}
else
{
FT_Bitmap_New( &glyph->bitmap );
error = FT_Bitmap_Copy( library, &slot->bitmap, &glyph->bitmap );
}
Exit:
return error;
}
示例3: ft_bitmap_glyph_init
static
FT_Error ft_bitmap_glyph_init(FT_BitmapGlyph glyph,
FT_GlyphSlot slot)
{
FT_Error error = FT_Err_Ok;
FT_Library library = FT_GLYPH(glyph)->library;
FT_Memory memory = library->memory;
if(slot->format != ft_glyph_format_bitmap)
{
error = FT_Err_Invalid_Glyph_Format;
goto Exit;
}
/* grab the bitmap in the slot - do lazy copying whenever possible */
glyph->bitmap = slot->bitmap;
glyph->left = slot->bitmap_left;
glyph->top = slot->bitmap_top;
if(slot->flags & ft_glyph_own_bitmap)
{
slot->flags &= ~ft_glyph_own_bitmap;
}
else
{
/* copy the bitmap into a new buffer */
error = ft_bitmap_copy(memory, &slot->bitmap, &glyph->bitmap);
}
Exit:
return error;
}
示例4: ft_outline_glyph_init
ft_outline_glyph_init( FT_Glyph outline_glyph,
FT_GlyphSlot slot )
{
FT_OutlineGlyph glyph = (FT_OutlineGlyph)outline_glyph;
FT_Error error = FT_Err_Ok;
FT_Library library = FT_GLYPH( glyph )->library;
FT_Outline* source = &slot->outline;
FT_Outline* target = &glyph->outline;
/* check format in glyph slot */
if ( slot->format != FT_GLYPH_FORMAT_OUTLINE )
{
error = FT_Err_Invalid_Glyph_Format;
goto Exit;
}
/* allocate new outline */
error = FT_Outline_New( library, source->n_points, source->n_contours,
&glyph->outline );
if ( error )
goto Exit;
FT_Outline_Copy( source, target );
Exit:
return error;
}
示例5: ft_bitmap_glyph_init
ft_bitmap_glyph_init( FT_Glyph bitmap_glyph,
FT_GlyphSlot slot )
{
FT_BitmapGlyph glyph = (FT_BitmapGlyph)bitmap_glyph;
FT_Error error = FT_Err_Ok;
FT_Library library = FT_GLYPH( glyph )->library;
FT_Memory memory = library->memory;
if ( slot->format != FT_GLYPH_FORMAT_BITMAP )
{
error = FT_Err_Invalid_Glyph_Format;
goto Exit;
}
/* grab the bitmap in the slot - do lazy copying whenever possible */
glyph->bitmap = slot->bitmap;
glyph->left = slot->bitmap_left;
glyph->top = slot->bitmap_top;
if ( slot->internal->flags & FT_GLYPH_OWN_BITMAP )
slot->internal->flags &= ~FT_GLYPH_OWN_BITMAP;
else
{
/* copy the bitmap into a new buffer */
error = ft_bitmap_copy( memory, &slot->bitmap, &glyph->bitmap );
}
Exit:
return error;
}
示例6: ft_bitmap_glyph_done
ft_bitmap_glyph_done( FT_Glyph bitmap_glyph )
{
FT_BitmapGlyph glyph = (FT_BitmapGlyph)bitmap_glyph;
FT_Library library = FT_GLYPH( glyph )->library;
FT_Bitmap_Done( library, &glyph->bitmap );
}
示例7: ft_bitmap_glyph_done
ft_bitmap_glyph_done( FT_Glyph bitmap_glyph )
{
FT_BitmapGlyph glyph = (FT_BitmapGlyph)bitmap_glyph;
FT_Memory memory = FT_GLYPH( glyph )->library->memory;
FT_FREE( glyph->bitmap.buffer );
}
示例8: ft_bitmap_glyph_done
static
void ft_bitmap_glyph_done(FT_BitmapGlyph glyph)
{
FT_Memory memory = FT_GLYPH(glyph)->library->memory;
FREE(glyph->bitmap.buffer);
}
示例9: ft_outline_glyph_copy
static
FT_Error ft_outline_glyph_copy( FT_OutlineGlyph source,
FT_OutlineGlyph target )
{
FT_Error error;
FT_Library library = FT_GLYPH( source )->library;
error = FT_Outline_New( library, source->outline.n_points,
source->outline.n_contours, &target->outline );
if ( !error )
FT_Outline_Copy( &source->outline, &target->outline );
return error;
}
示例10: ft_outline_glyph_init
static
FT_Error ft_outline_glyph_init(FT_OutlineGlyph glyph,
FT_GlyphSlot slot)
{
FT_Error error = FT_Err_Ok;
FT_Library library = FT_GLYPH(glyph)->library;
FT_Outline *source = &slot->outline;
FT_Outline *target = &glyph->outline;
/* check format in glyph slot */
if(slot->format != ft_glyph_format_outline)
{
error = FT_Err_Invalid_Glyph_Format;
goto Exit;
}
/* allocate new outline */
error = FT_Outline_New(library, source->n_points, source->n_contours,
&glyph->outline);
if(error)
{
goto Exit;
}
/* copy it */
MEM_Copy(target->points, source->points,
source->n_points * sizeof(FT_Vector));
MEM_Copy(target->tags, source->tags,
source->n_points * sizeof(FT_Byte));
MEM_Copy(target->contours, source->contours,
source->n_contours * sizeof(FT_Short));
/* copy all flags, except the `ft_outline_owner' one */
target->flags = source->flags | ft_outline_owner;
Exit:
return error;
}
示例11: ft_outline_glyph_init
ft_outline_glyph_init( FT_Glyph outline_glyph,
FT_GlyphSlot slot )
{
FT_OutlineGlyph glyph = (FT_OutlineGlyph)outline_glyph;
FT_Error error = FT_Err_Ok;
FT_Library library = FT_GLYPH( glyph )->library;
FT_Outline* source = &slot->outline;
FT_Outline* target = &glyph->outline;
/* check format in glyph slot */
if ( slot->format != FT_GLYPH_FORMAT_OUTLINE )
{
error = FT_Err_Invalid_Glyph_Format;
goto Exit;
}
/* allocate new outline */
error = FT_Outline_New( library, source->n_points, source->n_contours,
&glyph->outline );
if ( error )
goto Exit;
/* copy it */
FT_ARRAY_COPY( target->points, source->points, source->n_points );
FT_ARRAY_COPY( target->tags, source->tags, source->n_points );
FT_ARRAY_COPY( target->contours, source->contours, source->n_contours );
/* copy all flags, except the `FT_OUTLINE_OWNER' one */
target->flags = source->flags | FT_OUTLINE_OWNER;
Exit:
return error;
}
示例12: ft_outline_glyph_done
static
void ft_outline_glyph_done(FT_OutlineGlyph glyph)
{
FT_Outline_Done(FT_GLYPH(glyph)->library, &glyph->outline);
}