summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorWerner Lemberg <wl@gnu.org>2008-12-11 08:55:48 +0000
committerWerner Lemberg <wl@gnu.org>2008-12-11 08:55:48 +0000
commitb972a2a294a6d1f53ad403ae2bf0a098a38f0c2b (patch)
tree50874b317c12a1f457b2f109f822488d16576f20 /include
parent1474f439b54ef1553d0aac57ebde6261f1b2ed81 (diff)
downloadfreetype2-b972a2a294a6d1f53ad403ae2bf0a098a38f0c2b.tar.gz
Generalize the concept of `tricky' fonts by introducing
FT_FACE_FLAG_TRICKY to indicate that the font format's hinting engine is necessary for correct rendering. At the same time, slightly modify the behaviour of tricky fonts: FT_LOAD_NO_HINTING is now ignored. To really force raw loading of tricky fonts (without hinting), both FT_LOAD_NO_HINTING and FT_LOAD_NO_AUTOHINT must be used. Finally, tricky TrueType fonts always use the bytecode interpreter even if the patented code is used. * include/freetype/freetype.h (FT_FACE_FLAG_TRICKY, FT_IS_TRICKY): New macros. * src/truetype/ttdriver.c (Load_Glyph): Handle new load flags semantics as described above. * src/truetype/ttobjs.c (tt_check_trickyness): New function, using code of ... (tt_face_init): This function, now simplified and updated to new semantics. * src/base/ftobjs.c (FT_Load_Glyph): Don't use autohinter for tricky fonts. * docs/CHANGES: Document it.
Diffstat (limited to 'include')
-rw-r--r--include/freetype/freetype.h36
1 files changed, 35 insertions, 1 deletions
diff --git a/include/freetype/freetype.h b/include/freetype/freetype.h
index f91cc5473..23ff88b5d 100644
--- a/include/freetype/freetype.h
+++ b/include/freetype/freetype.h
@@ -1042,6 +1042,22 @@ FT_BEGIN_HEADER
/* way (using contiguous indices); the `CID-ness' isn't visible to */
/* the application. */
/* */
+ /* FT_FACE_FLAG_TRICKY :: */
+ /* Set if the font is `tricky', this is, it always needs the */
+ /* font format's native hinting engine to get a reasonable result. */
+ /* A typical example is the Chinese font `mingli.ttf' which uses */
+ /* TrueType bytecode instructions to move and scale all of its */
+ /* subglyphs. */
+ /* */
+ /* It is not possible to autohint such fonts using */
+ /* @FT_LOAD_FORCE_AUTOHINT; it will also ignore */
+ /* @FT_LOAD_NO_HINTING. You have to set both FT_LOAD_NO_HINTING */
+ /* and @FT_LOAD_NO_AUTOHINT to really disable hinting; however, you */
+ /* probably never want this except for demonstration purposes. */
+ /* */
+ /* Currently, there are six TrueType fonts in the list of tricky */
+ /* fonts; they are hard-coded in file `ttobjs.c'. */
+ /* */
#define FT_FACE_FLAG_SCALABLE ( 1L << 0 )
#define FT_FACE_FLAG_FIXED_SIZES ( 1L << 1 )
#define FT_FACE_FLAG_FIXED_WIDTH ( 1L << 2 )
@@ -1055,6 +1071,7 @@ FT_BEGIN_HEADER
#define FT_FACE_FLAG_EXTERNAL_STREAM ( 1L << 10 )
#define FT_FACE_FLAG_HINTER ( 1L << 11 )
#define FT_FACE_FLAG_CID_KEYED ( 1L << 12 )
+#define FT_FACE_FLAG_TRICKY ( 1L << 13 )
/*************************************************************************
@@ -1225,6 +1242,20 @@ FT_BEGIN_HEADER
( face->face_flags & FT_FACE_FLAG_CID_KEYED )
+ /*************************************************************************
+ *
+ * @macro:
+ * FT_IS_TRICKY( face )
+ *
+ * @description:
+ * A macro that returns true whenever a face represents a `tricky' font.
+ * See the discussion of @FT_FACE_FLAG_TRICKY for more details.
+ *
+ */
+#define FT_IS_TRICKY( face ) \
+ ( face->face_flags & FT_FACE_FLAG_TRICKY )
+
+
/*************************************************************************/
/* */
/* <Const> */
@@ -2411,6 +2442,9 @@ FT_BEGIN_HEADER
* @FT_LOAD_NO_AUTOHINT in case you don't want the auto-hinter to be
* used at all.
*
+ * See the description of @FT_FACE_FLAG_TRICKY for a special exception
+ * (affecting only a handful of Asian fonts).
+ *
* Besides deciding which hinter to use, you can also decide which
* hinting algorithm to use. See @FT_LOAD_TARGET_XXX for details.
*/
@@ -3717,7 +3751,7 @@ FT_BEGIN_HEADER
/* */
/* <Return> */
/* The old setting value. This will always be false if this is not */
- /* a SFNT font, or if the unpatented hinter is not compiled in this */
+ /* an SFNT font, or if the unpatented hinter is not compiled in this */
/* instance of the library. */
/* */
/* <Since> */