Skip to content
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

Add New Font #72

Merged
merged 5 commits into from
Oct 19, 2021
Merged

Add New Font #72

merged 5 commits into from
Oct 19, 2021

Conversation

betterengineering
Copy link
Contributor

Overview

We needed a much smaller font here at Tidbyt to get more information onto the display. In searching for a font, I realized it was rather difficult to add a new font to the repo. With these changes, all you have to do is add an appropriately licensed BDF font into the fonts/ directory and make build to get access to your new font.

Changes

  • Use upstream go-bdf library instead of our fork.
    • The zachomedia/go-bdf has our changes merged and it has fixes to the bounds of the glyphs, which renders fonts much more nicely using pixlet. For example, a colon now has the appropriate spacing.
  • Added font embedding to the Makefile.
    • This commit adds the font embedding utility to the make file so that we can embed new fonts on build.
  • Added a font preview example.
    • This commit adds a preview to examples to preview new fonts in the repo.
  • Added tom-thumb font.
    • This commit adds the Tom Thumb font. This font is super tiny and allows for packing some serious information onto a display.

Test

make build && ./build/out/pixlet render examples/font-preview.star font=tom-thumb --gif --magnify 10

font-preview

The zachomedia/go-bdf has our changes merged and it has fixes to the
bounds of the glyphs, which renders fonts much more nicely using pixlet.
For example, a colon now has the appropriate spacing.
This commit adds the font embedding utility to the make file so that we
can embed new fonts on build.
This commit adds a preview to examples to preview new fonts in the repo.
This commit adds the Tom Thumb font found here: https://robey.lag.net/2010/01/23/tiny-monospace-font.html

This font is supy tiny and allows for packing some serious information
onto a display.
doc/fonts.md Outdated
A very tiny, monospace, bitmap font. It's a 4x6 font (3x5 usable pixels) that's
great for packing in information on your display. If you're using all uppercase
characters, you can set the height of the text widget equal to 5 to only occupy
five pixels on your device!
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment may not be true on further testing.

The all uppercase comment can be true, but we'd need to modify this
font. I honestly think we should add a tom-thumb-upper that has all
lowercase characters removed and the height set to 5.
@betterengineering betterengineering enabled auto-merge (squash) October 19, 2021 14:29
@betterengineering betterengineering merged commit 1ddc377 into main Oct 19, 2021
@betterengineering betterengineering deleted the mark/add-new-fonts branch October 19, 2021 14:30
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 this pull request may close these issues.

1 participant