MCPcopy Create free account
hub / github.com/PageBot/PageBot / textBox

Method textBox

Lib/pagebot/contexts/svgcontext/svgcontext.py:407–416  ·  view source on GitHub ↗

Draw the sOrBs text string, can be a str or BabelString, including a DrawBot FormattedString in rectangle r.

(self, sOrBs, r)

Source from the content-addressed store, hash-verified

405 self._drawing.add(t)
406
407 def textBox(self, sOrBs, r):
408 """Draw the sOrBs text string, can be a str or BabelString, including a
409 DrawBot FormattedString in rectangle r."""
410 if not isinstance(sOrBs, str):
411 sOrBs = sOrBs.s # Assume here is's a BabelString with a FormattedString inside.
412 x, y, w, h = r
413 t = self._drawing.text(sOrBs, insert=point2D(upt(x, y)),
414 stroke=self._svgStroke, stroke_width=upt(self._strokeWidth),
415 fill=self._svgFill, font_size=upt(self._fontSize), font_family=self._font)
416 self._drawing.add(t)
417
418 def textOverflow(self, sOrBs, box, align=None):
419 pass

Callers 4

build_indsMethod · 0.45
drawBaselinesMethod · 0.45
buildElementMethod · 0.45
buildTextMethod · 0.45

Calls 4

point2DFunction · 0.90
uptFunction · 0.90
addMethod · 0.80
textMethod · 0.45

Tested by

no test coverage detected