-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #42 from FoamyGuy/add_forkawesome_example
adding forkawesome example
- Loading branch information
Showing
4 changed files
with
846 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# SPDX-FileCopyrightText: 2021 Tim Cocks | ||
# SPDX-License-Identifier: MIT | ||
|
||
""" | ||
This example uses addfruit_display_text.label to display fork awesome | ||
icons. | ||
More info here: https://emergent.unpythonic.net/01606790241 | ||
""" | ||
|
||
import board | ||
from forkawesome_icons import microchip, python, terminal | ||
from adafruit_display_text import label | ||
from adafruit_bitmap_font import bitmap_font | ||
|
||
# use built in display (PyPortal, PyGamer, PyBadge, CLUE, etc.) | ||
# see guide for setting up external displays (TFT / OLED breakouts, RGB matrices, etc.) | ||
# https://learn.adafruit.com/circuitpython-display-support-using-displayio/display-and-display-bus | ||
display = board.DISPLAY | ||
|
||
font_file = "fonts/forkawesome-42.pcf" | ||
|
||
# Set text, font, and color | ||
text = "{} {} {}".format(terminal, python, microchip) | ||
font = bitmap_font.load_font(font_file) | ||
color = 0xFF00FF | ||
|
||
# Create the tet label | ||
text_area = label.Label(font, text=text, color=color) | ||
|
||
# Set the location | ||
text_area.anchor_point = (0.5, 0.5) | ||
text_area.anchored_position = (display.width // 2, display.height // 2) | ||
|
||
# Show it | ||
display.show(text_area) | ||
|
||
while True: | ||
pass |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# SPDX-FileCopyrightText: 2018, Fork Awesome (https://forkawesome.github.io), with Reserved Font Name Fork Awesome. | ||
|
||
# SPDX-License-Identifier: OFL-1.1-RFN |
Oops, something went wrong.