diff options
Diffstat (limited to 'src/cairo-type1-fallback.c')
-rw-r--r-- | src/cairo-type1-fallback.c | 32 |
1 files changed, 23 insertions, 9 deletions
diff --git a/src/cairo-type1-fallback.c b/src/cairo-type1-fallback.c index ef25fb6..39bc53f 100644 --- a/src/cairo-type1-fallback.c +++ b/src/cairo-type1-fallback.c @@ -146,7 +146,7 @@ static void charstring_encode_command (cairo_array_t *data, int command) { cairo_status_t status; - int orig_size; + unsigned int orig_size; unsigned char buf[5]; unsigned char *p = buf; @@ -173,7 +173,7 @@ charstring_encode_integer (cairo_array_t *data, cairo_charstring_type_t type) { cairo_status_t status; - int orig_size; + unsigned int orig_size; unsigned char buf[10]; unsigned char *p = buf; @@ -407,7 +407,6 @@ cairo_type1_font_create_charstring (cairo_type1_font_t *font, path_info.type = type; if (emit_path) { status = _cairo_path_fixed_interpret (scaled_glyph->path, - CAIRO_DIRECTION_FORWARD, _charstring_move_to, _charstring_line_to, _charstring_curve_to, @@ -514,12 +513,27 @@ cairo_type1_font_write_header (cairo_type1_font_t *font, "} readonly def\n" "/Encoding 256 array\n" "0 1 255 {1 index exch /.notdef put} for\n"); - for (i = 1; i < font->scaled_font_subset->num_glyphs; i++) { - if (font->scaled_font_subset->glyph_names != NULL) { - _cairo_output_stream_printf (font->output, "dup %d /%s put\n", - i, font->scaled_font_subset->glyph_names[i]); - } else { - _cairo_output_stream_printf (font->output, "dup %d /g%d put\n", i, i); + if (font->scaled_font_subset->is_latin) { + for (i = 1; i < 256; i++) { + int subset_glyph = font->scaled_font_subset->latin_to_subset_glyph_index[i]; + + if (subset_glyph > 0) { + if (font->scaled_font_subset->glyph_names != NULL) { + _cairo_output_stream_printf (font->output, "dup %d /%s put\n", + i, font->scaled_font_subset->glyph_names[subset_glyph]); + } else { + _cairo_output_stream_printf (font->output, "dup %d /g%d put\n", i, subset_glyph); + } + } + } + } else { + for (i = 1; i < font->scaled_font_subset->num_glyphs; i++) { + if (font->scaled_font_subset->glyph_names != NULL) { + _cairo_output_stream_printf (font->output, "dup %d /%s put\n", + i, font->scaled_font_subset->glyph_names[i]); + } else { + _cairo_output_stream_printf (font->output, "dup %d /g%d put\n", i, i); + } } } _cairo_output_stream_printf (font->output, |