summaryrefslogtreecommitdiffstats
path: root/src/base/ftbitmap.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/base/ftbitmap.c')
-rw-r--r--src/base/ftbitmap.c35
1 files changed, 32 insertions, 3 deletions
diff --git a/src/base/ftbitmap.c b/src/base/ftbitmap.c
index 4c1cdf2..8810cfa 100644
--- a/src/base/ftbitmap.c
+++ b/src/base/ftbitmap.c
@@ -2,10 +2,9 @@
/* */
/* ftbitmap.c */
/* */
-/* FreeType utility functions for converting 1bpp, 2bpp, 4bpp, and 8bpp */
-/* bitmaps into 8bpp format (body). */
+/* FreeType utility functions for bitmaps (body). */
/* */
-/* Copyright 2004, 2005, 2006, 2007 by */
+/* Copyright 2004, 2005, 2006, 2007, 2008, 2009 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -19,6 +18,7 @@
#include <ft2build.h>
#include FT_BITMAP_H
+#include FT_IMAGE_H
#include FT_INTERNAL_OBJECTS_H
@@ -388,6 +388,8 @@
case FT_PIXEL_MODE_GRAY:
case FT_PIXEL_MODE_GRAY2:
case FT_PIXEL_MODE_GRAY4:
+ case FT_PIXEL_MODE_LCD:
+ case FT_PIXEL_MODE_LCD_V:
{
FT_Int pad;
FT_Long old_size;
@@ -482,6 +484,8 @@
case FT_PIXEL_MODE_GRAY:
+ case FT_PIXEL_MODE_LCD:
+ case FT_PIXEL_MODE_LCD_V:
{
FT_Int width = source->width;
FT_Byte* s = source->buffer;
@@ -606,6 +610,31 @@
/* documentation is in ftbitmap.h */
FT_EXPORT_DEF( FT_Error )
+ FT_GlyphSlot_Own_Bitmap( FT_GlyphSlot slot )
+ {
+ if ( slot && slot->format == FT_GLYPH_FORMAT_BITMAP &&
+ !( slot->internal->flags & FT_GLYPH_OWN_BITMAP ) )
+ {
+ FT_Bitmap bitmap;
+ FT_Error error;
+
+
+ FT_Bitmap_New( &bitmap );
+ error = FT_Bitmap_Copy( slot->library, &slot->bitmap, &bitmap );
+ if ( error )
+ return error;
+
+ slot->bitmap = bitmap;
+ slot->internal->flags |= FT_GLYPH_OWN_BITMAP;
+ }
+
+ return FT_Err_Ok;
+ }
+
+
+ /* documentation is in ftbitmap.h */
+
+ FT_EXPORT_DEF( FT_Error )
FT_Bitmap_Done( FT_Library library,
FT_Bitmap *bitmap )
{