Drawing Text

drawBot.text(txt, (x, y))

Draw a text at a provided position.

text("hallo, I'm Times", (100, 100))
drawBot.textBox(txt, (x, y, w, h), align=None)

Draw a text in a provided rectangle. Optionally an alignment can be set. Possible align values are: “left”, “center” and “right”.

If the text overflows the rectangle, the overflowed text is returned.

The default alignment is left.

x, y, w, h = 100, 100, 256, 174

fill(1, 0, 0)
rect(x, y, w, h)
overflow = textBox("hallo, this text is a bit to long",
                (x, y, w, h), align="center")
print overflow


drawBot.textSize(txt, align=None)

Returns the size of a text with the current settings, like font, fontSize and lineHeight as a tuple (width, height).


Returns a list of all installed fonts.