From 71fe8c8881d495e8c1bd2ebbb8748761adc6bcd9 Mon Sep 17 00:00:00 2001 From: Adrian Johnson Date: Wed, 4 Jun 2008 22:57:43 +0930 Subject: [PATCH] PS: Make PDF emulation work with the new show_glyphs optimizations The implementation of the Tf, Td, and Tm operators has been extended to allow calling these operators in any order. --- src/cairo-ps-surface.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/cairo-ps-surface.c b/src/cairo-ps-surface.c index b4f0718e9..0a086672b 100644 --- a/src/cairo-ps-surface.c +++ b/src/cairo-ps-surface.c @@ -172,7 +172,6 @@ _cairo_ps_surface_emit_header (cairo_ps_surface_t *surface) "/n { newpath } bind def\n" "/W { clip } bind def\n" "/W* { eoclip } bind def\n" - "/Tf { pop /cairo_font exch def } bind def\n" "/BT { } bind def\n" "/ET { } bind def\n" "/Tj { show } bind def\n" @@ -183,11 +182,15 @@ _cairo_ps_surface_emit_header (cairo_ps_surface_t *surface) " { show } { -0.001 mul 0 cairo_font_matrix dtransform rmoveto } ifelse\n" " } forall\n" "} bind def\n" - "/Td { matrix translate cairo_font_matrix matrix concatmatrix aload\n" - " /cairo_font_matrix exch def 6 2 roll 0 0 6 array astore\n" - " cairo_font exch selectfont moveto } bind def\n" - "/Tm { 6 copy 6 array astore /cairo_font_matrix exch def 6 2 roll 0 0\n" - " 6 array astore cairo_font exch selectfont moveto } bind def\n" + "/cairo_selectfont { cairo_font_matrix aload pop 6 2 roll\n" + " 0 0 6 array astore cairo_font exch selectfont moveto } bind def\n" + "/Tf { pop /cairo_font exch def /cairo_font_matrix where\n" + " { cairo_selectfont } if } bind def\n" + "/Td { matrix translate cairo_font_matrix matrix concatmatrix\n" + " /cairo_font_matrix exch def /cairo_font where\n" + " { cairo_selectfont } if } bind def\n" + "/Tm { 6 array astore /cairo_font_matrix exch def /cairo_font where\n" + " { cairo_selectfont } if } bind def\n" "/g { setgray } bind def\n" "/rg { setrgbcolor } bind def\n");