Skip to content

Updated documentation for label.py to clarify usage for background #75

@kmatch98

Description

@kmatch98

@FoamyGuy Here are my collection of thoughts on updates for the learn guide for adafruit_display_text\label.py. I just realized that maybe this belongs in a separate repository with the learn guides, but I couldn't identify the location. If you know an alternate location, let me know. If you have time to review this list, please add your suggestions and then we can discuss how you want to coordinate or divvy-up any work on the learn guide.

Documentation updates:

  • Briefly describe differences in font typefaces: Fixed width vs variable width (proportional). We can handle both! Explain that BuiltinFont's terminalio.FONT can be used with a TileGrid resource-efficiently since it is a fixed-size font. (There is an open issue over in circuitpython about using TileGrid with BuiltinFont (issue Add TileGrid example that uses the built in font to display text circuitpython#2566.)

  • Define the baseline position (halfway up the M glyph). There is already an image in the current learn guide. Indicate that is is mostly important if you are formatting multiple lines of text and they need to align. Define ascenders/descenders, since this useful for understanding the background options.

  • anchor_point and anchor_position: reference the candy hearts example

Explain background size options:

  • background_tight = False (default): Background dimensions include room for ascenders and descenders for the font, even if the text does not have any ascenders/descenders. [Note: Ascenders and descender dimensions are sampled from these letters: M, j, ' (apostrophe)]

  • background_tight = True: Background dimensions are set with the minimum bounding box for the text.

  • padding_*: adds (positive numbers) or subtracts (negative numbers) this many pixels from the bounding box on the specified side (_top, _bottom, _left, _right)

Special tips on BDF loaded fonts:

  • Explain how to reduce BDF font file size: Remove any extraneous glyphs manually with a text editor
  • Reference the Adobe BDF format definition for loaded fonts in BDF format: Document here

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions