Add FT_FACE_FLAG_HINTER to indicate that a specific font driver has

a hinting engine of its own.

* include/freetype/freetype.h (FT_FACE_FLAG_HINTER): New macro.

* src/cff/cffobjs.c (cff_face_init), src/cid/cidobjs.c
(cid_face_init), src/truetype/ttobjs.c (tt_face_init)
[TT_CONFIG_OPTION_BYTECODE_INTERPRETER], src/type1/t1objs.c
(T1_Face_Init), src/type42/t42objs.c (T42_Face_Init)
[TT_CONFIG_OPTION_BYTECODE_INTERPRETER]: Update face flags.

* docs/CHANGES: Document it.
This commit is contained in:
Werner Lemberg 2005-10-05 15:18:29 +00:00
parent 613ea86674
commit 7734a1f720
9 changed files with 57 additions and 15 deletions

View File

@ -1,3 +1,18 @@
2005-09-05 Werner Lemberg <wl@gnu.org>
Add FT_FACE_FLAG_HINTER to indicate that a specific font driver has
a hinting engine of its own.
* include/freetype/freetype.h (FT_FACE_FLAG_HINTER): New macro.
* src/cff/cffobjs.c (cff_face_init), src/cid/cidobjs.c
(cid_face_init), src/truetype/ttobjs.c (tt_face_init)
[TT_CONFIG_OPTION_BYTECODE_INTERPRETER], src/type1/t1objs.c
(T1_Face_Init), src/type42/t42objs.c (T42_Face_Init)
[TT_CONFIG_OPTION_BYTECODE_INTERPRETER]: Update face flags.
* docs/CHANGES: Document it.
2005-09-27 Werner Lemberg <wl@gnu.org>
* builds/unix/freetype2.m4: Add license exception so that the file

View File

@ -33,6 +33,13 @@ LATEST CHANGES BETWEEN 2.2.0 and 2.1.10
III. MISCELLANEOUS
- A new face flag `FT_FACE_FLAG_HINTER' has been added which is
set if the font's driver has a hinting engine of its own. This
makes it possible to check at run-time whether the TrueType
bytecode interpreter has been activated. An example use is to
enable the interpretation of the `gasp' table only if native
TrueType hinting is available.
- The demo programs `ftview' and `ftstring' have been rewritten
for better readability.

View File

@ -120,6 +120,7 @@ FT_BEGIN_HEADER
/* FT_FACE_FLAG_GLYPH_NAMES */
/* FT_FACE_FLAG_EXTERNAL_STREAM */
/* FT_FACE_FLAG_FAST_GLYPHS */
/* FT_FACE_FLAG_HINTER */
/* */
/* FT_STYLE_FLAG_BOLD */
/* FT_STYLE_FLAG_ITALIC */
@ -1061,6 +1062,12 @@ FT_BEGIN_HEADER
/* provided by the client application and should not be destroyed */
/* when @FT_Done_Face is called. Don't read or test this flag. */
/* */
/* FT_FACE_FLAG_HINTER :: */
/* Set if the font driver has a hinting machine of its own. For */
/* example, with TrueType fonts, it makes sense to use data from */
/* the SFNT `gasp' table only if the native TrueType hinting engine */
/* (with the bytecode interpreter) is available and active. */
/* */
#define FT_FACE_FLAG_SCALABLE ( 1L << 0 )
#define FT_FACE_FLAG_FIXED_SIZES ( 1L << 1 )
#define FT_FACE_FLAG_FIXED_WIDTH ( 1L << 2 )
@ -1072,6 +1079,7 @@ FT_BEGIN_HEADER
#define FT_FACE_FLAG_MULTIPLE_MASTERS ( 1L << 8 )
#define FT_FACE_FLAG_GLYPH_NAMES ( 1L << 9 )
#define FT_FACE_FLAG_EXTERNAL_STREAM ( 1L << 10 )
#define FT_FACE_FLAG_HINTER ( 1L << 11 )
/* */

View File

@ -636,8 +636,9 @@
/* */
/* Compute face flags. */
/* */
flags = FT_FACE_FLAG_SCALABLE | /* scalable outlines */
FT_FACE_FLAG_HORIZONTAL; /* horizontal data */
flags = FT_FACE_FLAG_SCALABLE | /* scalable outlines */
FT_FACE_FLAG_HORIZONTAL | /* horizontal data */
FT_FACE_FLAG_HINTER; /* has native hinter */
if ( sfnt_format )
flags |= FT_FACE_FLAG_SFNT;

View File

@ -362,9 +362,9 @@
cidface->num_charmaps = 0;
cidface->face_index = face_index;
cidface->face_flags = FT_FACE_FLAG_SCALABLE;
cidface->face_flags |= FT_FACE_FLAG_HORIZONTAL;
cidface->face_flags = FT_FACE_FLAG_SCALABLE | /* scalable outlines */
FT_FACE_FLAG_HORIZONTAL | /* horizontal data */
FT_FACE_FLAG_HINTER; /* has native hinter */
if ( info->is_fixed_pitch )
cidface->face_flags |= FT_FACE_FLAG_FIXED_WIDTH;

View File

@ -536,9 +536,11 @@
/* Compute face flags. */
/* */
if ( has_outline == TRUE )
flags |= FT_FACE_FLAG_SCALABLE; /* scalable outlines */
flags |= FT_FACE_FLAG_SCALABLE; /* scalable outlines */
flags |= FT_FACE_FLAG_SFNT | /* SFNT file format */
/* The sfnt driver only supports bitmap fonts natively, thus we */
/* don't set FT_FACE_FLAG_HINTER. */
flags |= FT_FACE_FLAG_SFNT | /* SFNT file format */
FT_FACE_FLAG_HORIZONTAL; /* horizontal data */
#ifdef TT_CONFIG_OPTION_POSTSCRIPT_NAMES

View File

@ -203,7 +203,11 @@
goto Bad_Format;
}
/* If we are performing a simple font format check, exit immediately */
#ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER
face->root.face_flags |= FT_FACE_FLAG_HINTER;
#endif
/* If we are performing a simple font format check, exit immediately. */
if ( face_index < 0 )
return TT_Err_Ok;

View File

@ -4,7 +4,7 @@
/* */
/* Type 1 objects manager (body). */
/* */
/* Copyright 1996-2001, 2002, 2003, 2004 by */
/* Copyright 1996-2001, 2002, 2003, 2004, 2005 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -329,9 +329,10 @@
root->num_glyphs = type1->num_glyphs;
root->face_index = face_index;
root->face_flags = FT_FACE_FLAG_SCALABLE;
root->face_flags |= FT_FACE_FLAG_HORIZONTAL;
root->face_flags |= FT_FACE_FLAG_GLYPH_NAMES;
root->face_flags = FT_FACE_FLAG_SCALABLE |
FT_FACE_FLAG_HORIZONTAL |
FT_FACE_FLAG_GLYPH_NAMES |
FT_FACE_FLAG_HINTER;
if ( info->is_fixed_pitch )
root->face_flags |= FT_FACE_FLAG_FIXED_WIDTH;

View File

@ -202,13 +202,17 @@
root->num_charmaps = 0;
root->face_index = face_index;
root->face_flags = FT_FACE_FLAG_SCALABLE;
root->face_flags |= FT_FACE_FLAG_HORIZONTAL;
root->face_flags |= FT_FACE_FLAG_GLYPH_NAMES;
root->face_flags = FT_FACE_FLAG_SCALABLE |
FT_FACE_FLAG_HORIZONTAL |
FT_FACE_FLAG_GLYPH_NAMES;
if ( info->is_fixed_pitch )
root->face_flags |= FT_FACE_FLAG_FIXED_WIDTH;
#ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER
root->face_flags |= FT_FACE_FLAG_HINTER;
#endif
/* XXX: TODO -- add kerning with .afm support */
/* get style name -- be careful, some broken fonts only */