* src/sfnt/sfmtx.c: disabling memory optimization when FT_CONFIG_OPTION_OLD_INTERNALS is used. This is because libXfont is directly accessing the HMTX data. Grrrrr....
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 82 83 84 85 86
diff --git a/ChangeLog b/ChangeLog
index b7791bc..36d983e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,10 @@
* src/sfnt/sfobjs.c (sfnt_face_load): fixed silly bug that
prevented embedded bitmaps from being correctly listed and used
+ * src/sfnt/sfmtx.c: disabling memory optimization when
+ FT_CONFIG_OPTION_OLD_INTERNALS is used. This is because libXfont
+ is directly accessing the HMTX data. Grrrrr....
+
* src/pfr/pfrsbit.c: fixed handling of character advances
2006-02-20 David Turner <david@freetype.org>
diff --git a/src/sfnt/ttmtx.c b/src/sfnt/ttmtx.c
index bb89cd3..a6925ec 100644
--- a/src/sfnt/ttmtx.c
+++ b/src/sfnt/ttmtx.c
@@ -35,6 +35,12 @@
#define FT_COMPONENT trace_ttmtx
+/* Unfortunately, we can't enable our memory optimizations when
+ * FT_CONFIG_OPTION_OLD_INTERNALS is defined. This is because some
+ * rogue clients (libXfont in the X.Org XServer) is directly accessing
+ * the metrics
+ */
+
/*************************************************************************/
/* */
/* <Function> */
@@ -53,7 +59,7 @@
/* <Return> */
/* FreeType error code. 0 means success. */
/* */
-#ifdef FT_OPTIMIZE_MEMORY
+#if defined FT_OPTIMIZE_MEMORY && !defined FT_CONFIG_OPTION_OLD_INTERNALS
FT_LOCAL_DEF( FT_Error )
tt_face_load_hmtx( TT_Face face,
@@ -94,7 +100,7 @@
return error;
}
-#else /* !OPTIMIZE_MEMORY */
+#else /* !OPTIMIZE_MEMORY || OLD_INTERNALS */
FT_LOCAL_DEF( FT_Error )
tt_face_load_hmtx( TT_Face face,
@@ -215,7 +221,7 @@
return error;
}
-#endif /* !FT_OPTIMIZE_METRICS */
+#endif /* !OPTIMIZE_MEMORY || OLD_INTERNALS */
/*************************************************************************/
@@ -324,7 +330,7 @@
/* */
/* advance :: The advance width resp. advance height. */
/* */
-#ifdef FT_OPTIMIZE_MEMORY
+#if defined FT_OPTIMIZE_MEMORY && !defined FT_CONFIG_OPTION_OLD_INTERNALS
FT_LOCAL_DEF( FT_Error )
tt_face_get_metrics( TT_Face face,
@@ -389,7 +395,7 @@
return SFNT_Err_Ok;
}
-#else /* !FT_OPTIMIZE_MEMORY */
+#else /* !OPTIMIZE_MEMORY || OLD_INTERNALS */
FT_LOCAL_DEF( FT_Error )
tt_face_get_metrics( TT_Face face,
@@ -427,7 +433,7 @@
return SFNT_Err_Ok;
}
-#endif /* !FT_OPTIMIZE_MEMORY */
+#endif /* !OPTIMIZE_MEMORY || OLD_INTERNALS */
/* END */