* freetype2/src/sfnt/ttload.c (sfnt_dir_check): Modified to allow a

font to have no `head' table if tables `SING' and `META' are
present; this is to support `SING Glyphlet'.

`SING Glyphlet' is an extension to OpenType developed by Adobe
primarily to facilitate adding supplemental glyphs to an OpenType
font (with emphasis on, but not necessariy limited to, gaiji to a
CJK font).  A SING Glyphlet Font is an OpenType font that contains
the outline(s), either in a `glyf' or `CFF' table, for a glyph;
`cmap', `BASE', and `GSUB' tables are present with the same format
and functionaliy as a regular OpenType font; there are no `name',
`head', `OS/2', and `post' tables; there are two new tables, `SING'
which contains details about the glyphlet, and `META' which contains
metadata.

Further information on the SING Glyphlet format can be found at:

  http://www.adobe.com/products/indesign/sing_gaiji.html

* freetype2/include/freetype/ttags.h (TTAG_SING, TTAG_META): New
macros for the OpenType tables `SING' and `META'.  These two tables
are used in SING Glyphlet Format fonts.
This commit is contained in:
Werner Lemberg 2005-09-19 07:07:11 +00:00
parent 97d5972367
commit 02317d3b18
3 changed files with 40 additions and 1 deletions

View File

@ -1,3 +1,28 @@
2005-09-19 David Somers <dsomers@omz13.com>
* freetype2/src/sfnt/ttload.c (sfnt_dir_check): Modified to allow a
font to have no `head' table if tables `SING' and `META' are
present; this is to support `SING Glyphlet'.
`SING Glyphlet' is an extension to OpenType developed by Adobe
primarily to facilitate adding supplemental glyphs to an OpenType
font (with emphasis on, but not necessariy limited to, gaiji to a
CJK font). A SING Glyphlet Font is an OpenType font that contains
the outline(s), either in a `glyf' or `CFF' table, for a glyph;
`cmap', `BASE', and `GSUB' tables are present with the same format
and functionaliy as a regular OpenType font; there are no `name',
`head', `OS/2', and `post' tables; there are two new tables, `SING'
which contains details about the glyphlet, and `META' which contains
metadata.
Further information on the SING Glyphlet format can be found at:
http://www.adobe.com/products/indesign/sing_gaiji.html
* freetype2/include/freetype/ttags.h (TTAG_SING, TTAG_META): New
macros for the OpenType tables `SING' and `META'. These two tables
are used in SING Glyphlet Format fonts.
2005-09-09 Werner Lemberg <wl@gnu.org>
* src/sfnt/sfobjs.c (sfnt_load_face): Reactivate code to set

View File

@ -67,6 +67,7 @@ FT_BEGIN_HEADER
#define TTAG_loca FT_MAKE_TAG( 'l', 'o', 'c', 'a' )
#define TTAG_LTSH FT_MAKE_TAG( 'L', 'T', 'S', 'H' )
#define TTAG_maxp FT_MAKE_TAG( 'm', 'a', 'x', 'p' )
#define TTAG_META FT_MAKE_TAG( 'M', 'E', 'T', 'A' )
#define TTAG_MMFX FT_MAKE_TAG( 'M', 'M', 'F', 'X' )
#define TTAG_MMSD FT_MAKE_TAG( 'M', 'M', 'S', 'D' )
#define TTAG_mort FT_MAKE_TAG( 'm', 'o', 'r', 't' )
@ -79,6 +80,7 @@ FT_BEGIN_HEADER
#define TTAG_post FT_MAKE_TAG( 'p', 'o', 's', 't' )
#define TTAG_prep FT_MAKE_TAG( 'p', 'r', 'e', 'p' )
#define TTAG_prop FT_MAKE_TAG( 'p', 'r', 'o', 'p' )
#define TTAG_SING FT_MAKE_TAG( 'S', 'I', 'N', 'G' )
#define TTAG_trak FT_MAKE_TAG( 't', 'r', 'a', 'k' )
#define TTAG_true FT_MAKE_TAG( 't', 'r', 'u', 'e' )
#define TTAG_ttc FT_MAKE_TAG( 't', 't', 'c', ' ' )

View File

@ -156,7 +156,8 @@
FT_UInt num_tables )
{
FT_Error error;
FT_UInt nn, has_head = 0;
FT_UInt nn;
FT_UInt has_head = 0, has_sing = 0, has_meta = 0;
const FT_ULong glyx_tag = FT_MAKE_TAG( 'g', 'l', 'y', 'x' );
const FT_ULong locx_tag = FT_MAKE_TAG( 'l', 'o', 'c', 'x' );
@ -229,12 +230,23 @@
if ( FT_STREAM_SEEK( offset + 28 + 16*nn ) )
goto Bad_Format;
}
#ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS
else if ( table.Tag == TTAG_bhed )
goto head_retry;
#endif /* TT_CONFIG_OPTION_EMBEDDED_BITMAPS */
else if ( table.Tag == TTAG_SING )
has_sing = 1;
else if ( table.Tag == TTAG_META )
has_meta = 1;
}
/* when sing and meta are present, head is not present */
if ( has_sing && has_meta && has_head == 0 )
goto Exit;
/* otherwise, treat a missing head as a failure */
if ( has_head == 0 )
goto Bad_Format;