diff options
author | Adrian Johnson <ajohnson@redneon.com> | 2007-04-20 22:29:41 +0930 |
---|---|---|
committer | Adrian Johnson <ajohnson@redneon.com> | 2007-04-20 22:29:41 +0930 |
commit | 073fce5a85ab90b1bc6915e41d6a420a47e540e6 (patch) | |
tree | 77588d9b0f8a59f3a9b7d9de33a82009060b257d /src/cairo-cff-subset.c | |
parent | bf957ee0f29ff49970b4791718eccdb92f3d6886 (diff) |
Add support for creating CID/composite font subsets
cairo-scaled-font-subsets.c now provides three functions for creating subsets:
_cairo_scaled_font_subsets_create_scaled()
Create a subset for each scaled font with maximum size INT_MAX.
_cairo_scaled_font_subsets_create_simple()
Create subsets suitable for embedding as simple fonts in PS/PDF.
_cairo_scaled_font_subsets_create_composite()
Create subsets suitable for embedding as composite fonts in PS/PDF.
The _create_simple() and _create_composite() functions both merge
scaled fonts with the same face and an outline path available into
the same subset. _create_composite() has a maximum subset size of
65536 for outline fonts. Bitmap fonts have a separate subset for
each scale with a maximum subset size of 256.
The _create_simple() and _create_composite() functions both reserve
the first glyph in the subset for the .notdef glyph. CID fonts require
CID 0 to be .notdef.
Update Type1, TrueType and CFF subsetting to expect glyph 0 of each
subset to be the .notdef.
Diffstat (limited to 'src/cairo-cff-subset.c')
-rw-r--r-- | src/cairo-cff-subset.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/src/cairo-cff-subset.c b/src/cairo-cff-subset.c index ab61ae26..b0158fe4 100644 --- a/src/cairo-cff-subset.c +++ b/src/cairo-cff-subset.c @@ -985,11 +985,6 @@ cairo_cff_font_subset_charstrings (cairo_cff_font_t *font) unsigned int i; cairo_status_t status; - /* add .notdef */ - element = _cairo_array_index (&font->charstrings_index, 0); - status = cff_index_append (&font->charstrings_subset_index, - element->data, - element->length); if (status) return status; @@ -1056,7 +1051,7 @@ cairo_cff_font_subset_charset (cairo_cff_font_t *font) { unsigned int i; - for (i = 0; i < font->scaled_font_subset->num_glyphs; i++) { + for (i = 1; i < font->scaled_font_subset->num_glyphs; i++) { int gid = font->scaled_font_subset->glyphs[i]; uint16_t original_sid = cff_sid_from_gid(&font->charset, gid); uint16_t new_sid; @@ -1371,7 +1366,7 @@ cairo_cff_font_create_set_widths (cairo_cff_font_t *font) return status; num_hmetrics = be16_to_cpu (hhea.num_hmetrics); - for (i = 0; i < font->scaled_font_subset->num_glyphs; i++) { + for (i = 1; i < font->scaled_font_subset->num_glyphs; i++) { glyph_index = font->scaled_font_subset->glyphs[i]; long_entry_size = 2 * sizeof (int16_t); short_entry_size = sizeof (int16_t); |