summaryrefslogtreecommitdiffstats
path: root/src/base/ftbitmap.c
diff options
context:
space:
mode:
authorDavid 'Digit' Turner <digit@google.com>2009-06-08 15:18:21 +0200
committerDavid 'Digit' Turner <digit@google.com>2009-06-08 15:18:21 +0200
commit77f63d23f7d380b0ff02c18fd6a154ab9063128a (patch)
tree14b8437e23a816c57512fe472fdef4c7875c2eba /src/base/ftbitmap.c
parentd04869994887b14ee43c9f8a9a8597193b5a7107 (diff)
downloadandroid_external_freetype-77f63d23f7d380b0ff02c18fd6a154ab9063128a.tar.gz
android_external_freetype-77f63d23f7d380b0ff02c18fd6a154ab9063128a.tar.bz2
android_external_freetype-77f63d23f7d380b0ff02c18fd6a154ab9063128a.zip
Integrate FreeType 2.3.9 into the donut tree.
This is done to get fixes for a few security-related issues. NOTE: the auto-hinter hasn't been changed to avoid modifying the rendering of characters. The 2.3.9 code contains minor fixes (not security-related) that could in theory do that (though extensive testing is needed to evaluate its real impact on Android).
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 )
{