text¶
Draw text with the bitmap fonts generated by make_font.
Works on any framebuf-like object that has hline(x, y, w, color), so the same code draws into framebuf.FrameBuffer on the board and into a fake on the host. Only set pixels are drawn; the background stays as it is.
Attributes¶
Functions¶
|
Width of |
|
Draw one glyph (a character, or an icon name) at (x, y). |
|
Draw |
|
Break |
Module Contents¶
- text.FALLBACK = '?'¶
- text.text_width(font, s)¶
Width of
sin pixels.
- text.draw_glyph(fb, font, key, x, y, color)¶
Draw one glyph (a character, or an icon name) at (x, y).
Unknown keys fall back to “?” if the font has one.
- Returns:
The glyph’s width in pixels.
- text.draw_text(fb, font, s, x, y, color)¶
Draw
swith its top-left corner at (x, y); returns the end x.
- text.ELLIPSIS = '…'¶