* src/truetype/ttgload.c (TT_Load_Glyph), src/base/ftobjs.c (FT_Load_Glyph): "fixed" the bug that prevented embedded bitmaps from begin loaded when the auto-hinter is used.. This actually is a hack but will be enough until the internal re-design scheduled for FreeType 2.1
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81
diff --git a/ChangeLog b/ChangeLog
index 840ace8..ff9a287 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
2001-12-19 David Turner <david@freetype.org>
+ * src/truetype/ttgload.c (TT_Load_Glyph), src/base/ftobjs.c
+ (FT_Load_Glyph): "fixed" the bug that prevented embedded bitmaps from
+ begin loaded when the auto-hinter is used.. This actually is a hack
+ but will be enough until the internal re-design scheduled for
+ FreeType 2.1
+
+
* include/freetype/cache/ftcache.h: added comments to indicate that
some of the exported functions should only be used by applications
that need to implement custom cache types
diff --git a/include/freetype/freetype.h b/include/freetype/freetype.h
index 81b29e2..2f47ba2 100644
--- a/include/freetype/freetype.h
+++ b/include/freetype/freetype.h
@@ -2068,6 +2068,9 @@ FT_BEGIN_HEADER
/* */
#define FT_LOAD_LINEAR_DESIGN 8192
+ /* temporary hack !! */
+#define FT_LOAD_SBITS_ONLY 16384
+
/*************************************************************************/
/* */
diff --git a/src/base/ftobjs.c b/src/base/ftobjs.c
index 1a10f2a..6189db9 100644
--- a/src/base/ftobjs.c
+++ b/src/base/ftobjs.c
@@ -883,6 +883,22 @@
FT_AutoHinter_Interface* hinting;
+ /* try to load embedded bitmaps first when available */
+
+ /* XXX: this is really a temporary hack that should disappear */
+ /* promptly with FreeType 2.1 !! */
+ /* */
+ if ( FT_HAS_FIXED_SIZES( face ) )
+ {
+ error = driver->clazz->load_glyph( slot, face->size,
+ glyph_index,
+ load_flags | FT_LOAD_SBITS_ONLY );
+
+ if ( !error && slot->format == ft_glyph_format_bitmap )
+ goto Load_Ok;
+ }
+
+ /* load auto-hinted outline */
hinting = (FT_AutoHinter_Interface*)hinter->clazz->module_interface;
error = hinting->load_glyph( (FT_AutoHinter)hinter,
@@ -897,6 +913,7 @@
if ( error )
goto Exit;
+ Load_Ok:
/* compute the advance */
if ( load_flags & FT_LOAD_VERTICAL_LAYOUT )
{
diff --git a/src/truetype/ttgload.c b/src/truetype/ttgload.c
index 33caaed..6495dcf 100644
--- a/src/truetype/ttgload.c
+++ b/src/truetype/ttgload.c
@@ -1411,6 +1411,10 @@
#endif /* TT_CONFIG_OPTION_EMBEDDED_BITMAPS */
+ /* return immediately if we only wanted the embedded bitmaps */
+ if ( load_flags & FT_LOAD_SBITS_ONLY )
+ return FT_Err_Invalid_Argument;
+
/* seek to the beginning of the glyph table. For Type 42 fonts */
/* the table might be accessed from a Postscript stream or something */
/* else... */