Skip to content

Commit

Permalink
Add capability for font subsets to put latin glyphs in a separate subset
Browse files Browse the repository at this point in the history
This is required to allow PDF/PS output to use "(this is ascii)" style
strings that can be post processed by applications like psfrag. It
will also reduce the file size when a large amount of latin text is
used due to the 8-bit encoding instead of the 16-bit used for CID
fonts.

The winansi encoding (CP1252) is used for the latin subset as this is
a standard PDF encoding. Some PDF readers have buggy support for non
standard PDF 8-bit encodings.
  • Loading branch information
Adrian Johnson committed Oct 1, 2010
1 parent 3f817dc commit f1ca978
Show file tree
Hide file tree
Showing 2 changed files with 228 additions and 91 deletions.
13 changes: 13 additions & 0 deletions src/cairo-scaled-font-subsets-private.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ typedef struct _cairo_scaled_font_subsets_glyph {
unsigned int subset_glyph_index;
cairo_bool_t is_scaled;
cairo_bool_t is_composite;
cairo_bool_t is_latin;
double x_advance;
double y_advance;
cairo_bool_t utf8_is_mapped;
Expand Down Expand Up @@ -124,6 +125,18 @@ _cairo_scaled_font_subsets_create_composite (void);
cairo_private void
_cairo_scaled_font_subsets_destroy (cairo_scaled_font_subsets_t *font_subsets);

/**
* _cairo_scaled_font_subsets_enable_latin_subset:
* @font_subsets: a #cairo_scaled_font_subsets_t object to be destroyed
* @use_latin: a #cairo_bool_t indicating if a latin subset is to be used
*
* If enabled, all CP1252 characters will be placed in a separate
* 8-bit latin subset.
**/
cairo_private void
_cairo_scaled_font_subsets_enable_latin_subset (cairo_scaled_font_subsets_t *font_subsets,
cairo_bool_t use_latin);

/**
* _cairo_scaled_font_subsets_map_glyph:
* @font_subsets: a #cairo_scaled_font_subsets_t
Expand Down
Loading

0 comments on commit f1ca978

Please sign in to comment.