MCPcopy Index your code
hub / github.com/clips/pattern / render_string_horizontal

Method render_string_horizontal

pattern/web/pdf/pdfdevice.py:78–94  ·  view source on GitHub ↗
(self, seq, matrix, (x,y), 
                                 font, fontsize, scaling, charspace, wordspace, rise, dxscale)

Source from the content-addressed store, hash-verified

76 return
77
78 def render_string_horizontal(self, seq, matrix, (x,y),
79 font, fontsize, scaling, charspace, wordspace, rise, dxscale):
80 needcharspace = False
81 for obj in seq:
82 if isinstance(obj, int) or isinstance(obj, float):
83 x -= obj*dxscale
84 needcharspace = True
85 else:
86 for cid in font.decode(obj):
87 if needcharspace:
88 x += charspace
89 x += self.render_char(translate_matrix(matrix, (x,y)),
90 font, fontsize, scaling, rise, cid)
91 if cid == 32 and wordspace:
92 x += wordspace
93 needcharspace = True
94 return (x, y)
95
96 def render_string_vertical(self, seq, matrix, (x,y),
97 font, fontsize, scaling, charspace, wordspace, rise, dxscale):

Callers 1

render_stringMethod · 0.95

Calls 3

render_charMethod · 0.95
translate_matrixFunction · 0.90
decodeMethod · 0.45

Tested by

no test coverage detected