kopia lustrzana https://github.com/pimoroni/pimoroni-pico
commit
8a6bb65d73
|
@ -341,6 +341,7 @@ display.text(text, x, y, wordwrap, scale, angle, spacing)
|
||||||
* `scale` - size
|
* `scale` - size
|
||||||
* `angle` - rotation angle (Vector only!)
|
* `angle` - rotation angle (Vector only!)
|
||||||
* `spacing` - letter spacing
|
* `spacing` - letter spacing
|
||||||
|
* `fixed_width` - space all characters equal distance apart (monospace)
|
||||||
|
|
||||||
Text scale can be a whole number (integer) for Bitmap fonts, or a decimal (float) for Vector (Hershey) fonts.
|
Text scale can be a whole number (integer) for Bitmap fonts, or a decimal (float) for Vector (Hershey) fonts.
|
||||||
|
|
||||||
|
@ -355,7 +356,7 @@ Draws "Hello World" in a 16px tall, 2x scaled version of the `bitmap8` font.
|
||||||
Sometimes you might want to measure a text string for centering or alignment on screen, you can do this with:
|
Sometimes you might want to measure a text string for centering or alignment on screen, you can do this with:
|
||||||
|
|
||||||
```python
|
```python
|
||||||
width = display.measure_text(text, scale, spacing)
|
width = display.measure_text(text, scale, spacing, fixed_width)
|
||||||
```
|
```
|
||||||
|
|
||||||
The height of each Bitmap font is explicit in its name.
|
The height of each Bitmap font is explicit in its name.
|
||||||
|
|
Ładowanie…
Reference in New Issue