@@ -385,7 +385,7 @@ def create_hatch(self, hatch):
385
385
386
386
/PaintProc {{
387
387
pop
388
- { linewidth :f } setlinewidth
388
+ { linewidth :g } setlinewidth
389
389
{ self ._convert_path (
390
390
Path .hatch (hatch ), Affine2D ().scale (sidelen ), simplify = False )}
391
391
gsave
@@ -395,7 +395,7 @@ def create_hatch(self, hatch):
395
395
}} bind
396
396
>>
397
397
matrix
398
- 0.0 { pageheight :f } translate
398
+ 0 { pageheight :g } translate
399
399
makepattern
400
400
/{ name } exch def
401
401
""" )
@@ -472,9 +472,9 @@ def draw_image(self, gc, x, y, im, transform=None):
472
472
self ._pswriter .write (f"""\
473
473
gsave
474
474
{ self ._get_clip_cmd (gc )}
475
- { x :f } { y :f } translate
475
+ { x :g } { y :g } translate
476
476
[{ matrix } ] concat
477
- { xscale :f } { yscale :f } scale
477
+ { xscale :g } { yscale :g } scale
478
478
/DataString { w :d} string def
479
479
{ w :d} { h :d} 8 [ { w :d} 0 0 -{ h :d} 0 { h :d} ]
480
480
{{
@@ -674,13 +674,13 @@ def draw_text(self, gc, x, y, s, prop, angle, ismath=False, mtext=None):
674
674
ps_name = (font .postscript_name
675
675
.encode ("ascii" , "replace" ).decode ("ascii" ))
676
676
self .set_font (ps_name , prop .get_size_in_points ())
677
- thetext = "\n " .join (f"{ x :f } 0 m /{ name :s} glyphshow"
677
+ thetext = "\n " .join (f"{ x :g } 0 m /{ name :s} glyphshow"
678
678
for x , name in xs_names )
679
679
self ._pswriter .write (f"""\
680
680
gsave
681
681
{ self ._get_clip_cmd (gc )}
682
- { x :f } { y :f } translate
683
- { angle :f } rotate
682
+ { x :g } { y :g } translate
683
+ { angle :g } rotate
684
684
{ thetext }
685
685
grestore
686
686
""" )
@@ -695,8 +695,8 @@ def draw_mathtext(self, gc, x, y, s, prop, angle):
695
695
self .set_color (* gc .get_rgb ())
696
696
self ._pswriter .write (
697
697
f"gsave\n "
698
- f"{ x :f } { y :f } translate\n "
699
- f"{ angle :f } rotate\n " )
698
+ f"{ x :g } { y :g } translate\n "
699
+ f"{ angle :g } rotate\n " )
700
700
lastfont = None
701
701
for font , fontsize , num , ox , oy in glyphs :
702
702
self ._character_tracker .track_glyph (font , num )
@@ -708,7 +708,7 @@ def draw_mathtext(self, gc, x, y, s, prop, angle):
708
708
font .get_name_char (chr (num )) if isinstance (font , AFM ) else
709
709
font .get_glyph_name (font .get_char_index (num )))
710
710
self ._pswriter .write (
711
- f"{ ox :f } { oy :f } moveto\n "
711
+ f"{ ox :g } { oy :g } moveto\n "
712
712
f"/{ glyph_name } glyphshow\n " )
713
713
for ox , oy , w , h in rects :
714
714
self ._pswriter .write (f"{ ox } { oy } { w } { h } rectfill\n " )
@@ -756,7 +756,7 @@ def draw_gouraud_triangles(self, gc, points, colors, trans):
756
756
/BitsPerComponent 8
757
757
/BitsPerFlag 8
758
758
/AntiAlias true
759
- /Decode [ { xmin :f } { xmax :f } { ymin :f } { ymax :f } 0 1 0 1 0 1 ]
759
+ /Decode [ { xmin :g } { xmax :g } { ymin :g } { ymax :g } 0 1 0 1 0 1 ]
760
760
/DataSource ({ stream } )
761
761
>>
762
762
shfill
0 commit comments