Skip to content

The row height of the text is hard-coded #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
lesamouraipourpre opened this issue Jul 22, 2021 · 1 comment · Fixed by #5
Closed

The row height of the text is hard-coded #3

lesamouraipourpre opened this issue Jul 22, 2021 · 1 comment · Fixed by #5

Comments

@lesamouraipourpre
Copy link
Contributor

If using a font which is taller than terminalio.FONT the rows overlap because an assumed height is hard-coded.
A variant of the simpletext with a bigger font

"""Display the microcontroller CPU temperature in C and F on a display."""
import microcontroller
from adafruit_simple_text_display import SimpleTextDisplay

from adafruit_bitmap_font import bitmap_font
FONT = bitmap_font.load_font("/fonts/LibreBodoniv2002-Bold-27.bdf")  # A bigger font

temperature_data = SimpleTextDisplay(title="Temperature Data!", title_scale=2, font=FONT)

while True:
    temperature_data[0].text = "Temperature: {:.2f} degrees C".format(
        microcontroller.cpu.temperature
    )
    temperature_data[1].text = "Temperature: {:.2f} degrees F".format(
        (microcontroller.cpu.temperature * (9 / 5) + 32)
    )
    temperature_data.show()
@lesamouraipourpre
Copy link
Contributor Author

IMG_20210722_133750

lesamouraipourpre added a commit to lesamouraipourpre/Adafruit_CircuitPython_Simple_Text_Display that referenced this issue Jul 23, 2021
Deprecate 'title_length', ignore it for now. It is no longer needed with the update to Adafruit_CircuitPython_Display_Text removing 'max_glyphs'.

Refactor the scaling so that the 'text_scale' is not a multiple of the 'title_scale'.

Correctly add multiple rows with the color-cycling effect. Previously all new rows had the same color.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant