[cairo-commit] src/cairo-pdf-surface.c

Adrian Johnson ajohnson at kemper.freedesktop.org
Fri Sep 9 06:16:19 PDT 2011


 src/cairo-pdf-surface.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit 166be70cb8f7232b71916261d5e2b14f709c08bf
Author: Adrian Johnson <ajohnson at redneon.com>
Date:   Fri Sep 9 22:30:49 2011 +0930

    pdf: latin text must use character codes in the toUnicode CMap, not glyph indices

diff --git a/src/cairo-pdf-surface.c b/src/cairo-pdf-surface.c
index 3aa4f04..b115fd1 100644
--- a/src/cairo-pdf-surface.c
+++ b/src/cairo-pdf-surface.c
@@ -4159,7 +4159,9 @@ _cairo_pdf_surface_emit_to_unicode_stream (cairo_pdf_surface_t		*surface,
 					     "%d beginbfchar\n",
 					     num_bfchar - i > 100 ? 100 : num_bfchar - i);
 	    }
-	    if (font_subset->is_composite && !font_subset->is_latin)
+	    if (font_subset->is_latin)
+		_cairo_output_stream_printf (surface->output, "<%02x> ", font_subset->to_latin_char[i + 1]);
+	    else if (font_subset->is_composite)
 		_cairo_output_stream_printf (surface->output, "<%04x> ", i + 1);
 	    else
 		_cairo_output_stream_printf (surface->output, "<%02x> ", i + 1);


More information about the cairo-commit mailing list