@@ -112,12 +112,23 @@ The following methods draw shapes onto the FrameBuffer.
112
112
Drawing text
113
113
------------
114
114
115
- .. method :: FrameBuffer.text(s, x, y[, c])
115
+ .. method :: FrameBuffer.text(s, x, y[, c [, font_id] ])
116
116
117
- Write text to the FrameBuffer using the the coordinates as the upper-left
117
+ Write text to the FrameBuffer using the coordinates as the upper-left
118
118
corner of the text. The color of the text can be defined by the optional
119
- argument but is otherwise a default value of 1. All characters have
120
- dimensions of 8x8 pixels and there is currently no way to change the font.
119
+ argument *c *, which defaults to 1 if not provided. Additionally, you can
120
+ specify an optional *font_id * argument to select the font style, where
121
+ *font_id * can be 0, 1, 2, or 3. The method returns the width of the drawn
122
+ text in pixels.
123
+
124
+ The *font_id * argument is used to select the font style. The default *font_id *
125
+ is 1, which is the default monospace font Z1Mono8b_8x8. The other fonts are:
126
+
127
+ - 0: Z1Mono8_6x8 (A 6x8 monospace font)
128
+ - 2: Z1Prop8_6x8 (A 6x8 proportional font with a max width of 6 pixels)
129
+ - 3: Z1Prop8b_8x8 (An 8x8 proportional font with a max width of 8 pixels.
130
+ This font is more readable than Z1Mono8_6x8 on high DPI displays and usually
131
+ takes less screen width.)
121
132
122
133
123
134
Other methods
0 commit comments