* src/cff/cfftypes.h (CFF_FontRecDictRec): Change type of

`cid_count' to `FT_ULong'.

* src/cff/cffgload.c (cff_slot_load): Take care of empty `cids'
array.

* src/cff/cffload.c (cff_charset_done): Free `cids' array.
(cff_font_load): Create cids array only for CID-keyed fonts which
are subsetted.

* src/cff/cffobjs.c (cff_face_init): Check the availability of
the PSNames modules for non-pure CFFs also.
Set FT_FACE_FLAG_GLYPH_NAMES for a non-pure CFF also if it isn't
CID-keyed.

* src/cff/rules.mk (CFF_DRV_H): Add cfftypes.h.
This commit is contained in:
Werner Lemberg 2003-12-18 08:18:37 +00:00
parent 04410d3cb4
commit b9e9fe97a8
7 changed files with 61 additions and 31 deletions

View File

@ -1,3 +1,22 @@
2003-12-18 Werner Lemberg <wl@gnu.org>
* src/cff/cfftypes.h (CFF_FontRecDictRec): Change type of
`cid_count' to `FT_ULong'.
* src/cff/cffgload.c (cff_slot_load): Take care of empty `cids'
array.
* src/cff/cffload.c (cff_charset_done): Free `cids' array.
(cff_font_load): Create cids array only for CID-keyed fonts which
are subsetted.
* src/cff/cffobjs.c (cff_face_init): Check the availability of
the PSNames modules for non-pure CFFs also.
Set FT_FACE_FLAG_GLYPH_NAMES for a non-pure CFF also if it isn't
CID-keyed.
* src/cff/rules.mk (CFF_DRV_H): Add cfftypes.h.
2003-12-17 Werner Lemberg <wl@gnu.org>
* src/sfnt/sfobjs.c (sfnt_init_face): Don't set

View File

@ -14,8 +14,8 @@ LATEST CHANGES BETWEEN 2.1.8 and 2.1.7
correctly treated as a CID, similar to FreeType's CID driver
module. Note that CID CMaps support is still missing.
- SFNT based fonts no longer set the FT_FACE_FLAGS_GLYPH_NAMES
flag if a version 3.0 `post' table is present.
- The FT_FACE_FLAGS_GLYPH_NAMES is now set correctly for all font
formats.
II. IMPORTANT CHANGES

View File

@ -2316,8 +2316,10 @@
/* in a CID-keyed font, consider `glyph_index' as a CID and map */
/* it immediately to the real glyph_index */
if ( cff->top_font.font_dict.cid_registry != 0xFFFFU )
/* it immediately to the real glyph_index -- if it isn't a */
/* subsetted font, glyph_indices and CIDs are identical, though */
if ( cff->top_font.font_dict.cid_registry != 0xFFFFU &&
cff->charset.cids )
glyph_index = cff->charset.cids[glyph_index];
cff_decoder_init( &decoder, face, size, glyph, hinting,

View File

@ -1501,6 +1501,7 @@
FT_FREE( charset->sids );
FT_FREE( charset->cids );
charset->format = 0;
charset->offset = 0;
}
@ -1672,7 +1673,7 @@
}
}
/* we have to invert the `sids' array for CID-keyed fonts */
/* we have to invert the `sids' array for subsetted CID-keyed fonts */
if ( invert )
{
FT_UInt i;
@ -2244,9 +2245,13 @@
/* read the Charset and Encoding tables if available */
if ( font->num_glyphs > 0 )
{
FT_Bool invert;
invert = dict->cid_registry != 0xFFFFU &&
font->charstrings_index.count != dict->cid_count;
error = cff_charset_load( &font->charset, font->num_glyphs, stream,
base_offset, dict->charset_offset,
dict->cid_registry != 0xFFFFU );
base_offset, dict->charset_offset, invert );
if ( error )
goto Exit;

View File

@ -337,10 +337,11 @@
/* now load and parse the CFF table in the file */
{
CFF_Font cff;
FT_Memory memory = face->root.memory;
FT_Face root;
FT_Int32 flags;
CFF_Font cff;
CFF_FontRecDict dict;
FT_Memory memory = face->root.memory;
FT_Face root;
FT_Int32 flags;
if ( FT_NEW( cff ) )
@ -360,23 +361,24 @@
root = &face->root;
root->num_glyphs = cff->num_glyphs;
dict = &cff->top_font.font_dict;
/* we need the `PSNames' module for CFF and CEF formats */
/* which aren't CID-keyed */
if ( dict->cid_registry == 0xFFFFU && !psnames )
{
FT_ERROR(( "cff_face_init:" ));
FT_ERROR(( " cannot open CFF & CEF fonts\n" ));
FT_ERROR(( " " ));
FT_ERROR(( " without the `PSNames' module\n" ));
goto Bad_Format;
}
if ( pure_cff )
{
CFF_FontRecDict dict = &cff->top_font.font_dict;
char* style_name;
char* style_name;
/* we need the `PSNames' module for pure-CFF and CEF formats */
/* which aren't CID-keyed */
if ( dict->cid_registry == 0xFFFFU && !psnames )
{
FT_ERROR(( "cff_face_init:" ));
FT_ERROR(( " cannot open CFF & CEF fonts\n" ));
FT_ERROR(( " " ));
FT_ERROR(( " without the `PSNames' module\n" ));
goto Bad_Format;
}
/* Set up num_faces. */
root->num_faces = cff->num_faces;
@ -483,12 +485,6 @@
flags |= FT_FACE_FLAG_KERNING;
#endif
#ifndef FT_CONFIG_OPTION_NO_GLYPH_NAMES
/* CID-keyed CFF fonts don't have glyph names */
if ( dict->cid_registry == 0xFFFFU )
flags |= FT_FACE_FLAG_GLYPH_NAMES;
#endif
root->face_flags = flags;
/*******************************************************************/
@ -515,6 +511,13 @@
root->style_flags = flags;
}
#ifndef FT_CONFIG_OPTION_NO_GLYPH_NAMES
/* CID-keyed CFF fonts don't have glyph names -- the SFNT loader */
/* has unset this flag because of the 3.0 `post' table */
if ( dict->cid_registry == 0xFFFFU )
root->face_flags |= FT_FACE_FLAG_GLYPH_NAMES;
#endif
/*******************************************************************/
/* */
/* Compute char maps. */

View File

@ -123,7 +123,7 @@ FT_BEGIN_HEADER
FT_Long cid_font_version;
FT_Long cid_font_revision;
FT_Long cid_font_type;
FT_Long cid_count;
FT_ULong cid_count;
FT_ULong cid_uid_base;
FT_ULong cid_fd_array_offset;
FT_ULong cid_fd_select_offset;

View File

@ -34,6 +34,7 @@ CFF_DRV_SRC := $(CFF_DIR)/cffobjs.c \
#
CFF_DRV_H := $(CFF_DRV_SRC:%.c=%.h) \
$(CFF_DIR)/cfftoken.h \
$(CFF_DIR)/cfftypes.h \
$(CFF_DIR)/cfferrs.h