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

Adrian Johnson ajohnson at kemper.freedesktop.org
Sun Feb 4 23:59:58 PST 2007


 src/cairo-ps-surface.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

New commits:
diff-tree a8f8efb750fd3a8857c7f519b8645e578f75442b (from 28e3a20d79c3390547d3e53435c06442ca8ac8a2)
Author: Adrian Johnson <ajohnson at redneon.com>
Date:   Mon Feb 5 18:29:30 2007 +1030

    PS: Correct the TrueType Encoding and Charstrings
    
    The offsets and count was out by one as a result of the
    change to include .notdef on the TrueType font.

diff --git a/src/cairo-ps-surface.c b/src/cairo-ps-surface.c
index 45d9fe7..da10a5c 100644
--- a/src/cairo-ps-surface.c
+++ b/src/cairo-ps-surface.c
@@ -484,18 +484,18 @@ _cairo_ps_surface_emit_truetype_font_sub
 
     /* FIXME: Figure out how subset->x_max etc maps to the /FontBBox */
 
-    for (i = 1; i < font_subset->num_glyphs; i++)
+    for (i = 0; i < font_subset->num_glyphs; i++)
 	_cairo_output_stream_printf (surface->final_stream,
 				     "Encoding %d /g%d put\n", i, i);
 
     _cairo_output_stream_printf (surface->final_stream,
 				 "/CharStrings %d dict dup begin\n"
 				 "/.notdef 0 def\n",
-				 font_subset->num_glyphs);
+				 font_subset->num_glyphs + 1);
 
-    for (i = 1; i < font_subset->num_glyphs; i++)
+    for (i = 0; i < font_subset->num_glyphs; i++)
 	_cairo_output_stream_printf (surface->final_stream,
-				     "/g%d %d def\n", i, i);
+				     "/g%d %d def\n", i, i + 1);
 
     _cairo_output_stream_printf (surface->final_stream,
 				 "end readonly def\n");


More information about the cairo-commit mailing list