Skip to content

bitmap label cuts off part of text #201

Closed
@jepler

Description

@jepler

Compare the rendering of some text in the "font_league_script_number_one_webfont_72_latin1" (from the circuitpython font bundle) using bitmap and traditional label:
PXL_20231220_021126591 mp4_exported_1700
PXL_20231220_021126591 mp4_exported_5067

Code for test (qualia + 320x820 bar display)
import gc
import sys
import time

import terminalio
from adafruit_display_text.bitmap_label import Label as BitmapLabel
from adafruit_display_text.label import Label
from adafruit_qualia import Qualia
from adafruit_qualia.graphics import Displays
from font_league_script_number_one_webfont_72_latin1 import FONT

# Create the PyPortal object
qualia = Qualia(Displays.BAR320X820, rotation=270)

tx1 = qualia.add_text(
    text_position=(20, 20),  # location
    text_scale=3,  # text size
    text_color=0xFFFFFF,
    text="",
)

while True:
    for constructor_name, constructor in [
        ("label", Label),
        ("bitmap_label", BitmapLabel),
    ]:
        qualia.set_text(constructor_name, tx1)
        specimen = None
        specimen = constructor(
            font=FONT,
            text="AaBbCcGgYyQq",
            anchor_point=(0.0, 1.0),
            anchored_position=(0, qualia.display.height * 3 // 4),
            base_alignment=True,
            color=0xFFFFFF,
        )
        qualia.splash.append(specimen)
        qualia.display.auto_refresh=True
        time.sleep(4)
        qualia.display.auto_refresh=False
        qualia.splash.remove(specimen)
        del specimen
        gc.collect()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions