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.
This commit is contained in:
Adrian Johnson 2008-06-04 22:57:43 +09:30
parent 83e4825fae
commit 71fe8c8881

View file

@ -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");