Example #1
0
  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;
  }
Example #2
0
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;
}
Example #3
0
static
FT_Error  ft_bitmap_glyph_copy(FT_BitmapGlyph source,
                               FT_BitmapGlyph target)
{
	FT_Memory memory = source->root.library->memory;


	target->left = source->left;
	target->top  = source->top;

	return ft_bitmap_copy(memory, &source->bitmap, &target->bitmap);
}
Example #4
0
  ft_bitmap_glyph_copy( FT_Glyph  bitmap_source,
                        FT_Glyph  bitmap_target )
  {
    FT_BitmapGlyph  source = (FT_BitmapGlyph)bitmap_source;
    FT_BitmapGlyph  target = (FT_BitmapGlyph)bitmap_target;
    FT_Memory       memory = bitmap_source->library->memory;


    target->left = source->left;
    target->top  = source->top;

    return ft_bitmap_copy( memory, &source->bitmap, &target->bitmap );
  }