diff options
Diffstat (limited to 'source/pdf/pdf-appearance.c')
-rw-r--r-- | source/pdf/pdf-appearance.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/source/pdf/pdf-appearance.c b/source/pdf/pdf-appearance.c index b231b6b5..faea5b33 100644 --- a/source/pdf/pdf-appearance.c +++ b/source/pdf/pdf-appearance.c @@ -674,8 +674,8 @@ measure_simple_string(fz_context *ctx, fz_font *font, const char *text) { int c, g; text += fz_chartorune(&c, text); - /* WinAnsi is close enough to Latin-1 to not matter. Use middle dot for unencodable characters. */ - if (c >= 256) c = REPLACEMENT; + c = pdf_winansi_from_unicode(c); + if (c < 0) c = REPLACEMENT; g = fz_encode_character(ctx, font, c); w += fz_advance_glyph(ctx, font, g, 0); } @@ -690,8 +690,8 @@ write_simple_string(fz_context *ctx, fz_buffer *buf, const char *a, const char * { int c; a += fz_chartorune(&c, a); - /* WinAnsi is close enough to Latin-1 to not matter. Use middle dot for unencodable characters. */ - if (c >= 256) c = REPLACEMENT; + c = pdf_winansi_from_unicode(c); + if (c < 0) c = REPLACEMENT; if (c == '(' || c == ')' || c == '\\') fz_append_byte(ctx, buf, '\\'); fz_append_byte(ctx, buf, c); @@ -872,8 +872,8 @@ write_comb_string(fz_context *ctx, fz_buffer *buf, const char *a, const char *b, int c, g; a += fz_chartorune(&c, a); - /* WinAnsi is close enough to Latin-1 to not matter. Use middle dot for unencodable characters. */ - if (c >= 256) c = REPLACEMENT; + c = pdf_winansi_from_unicode(c); + if (c < 0) c = REPLACEMENT; g = fz_encode_character(ctx, font, c); gw = fz_advance_glyph(ctx, font, g, 0) * 1000; |