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 Latin-1 range and Unicode support #83

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 3 additions & 2 deletions sense_hat/sense_hat.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import pwd
import array
import fcntl
import codecs
from PIL import Image # pillow
from copy import deepcopy

Expand Down Expand Up @@ -97,7 +98,7 @@ def __init__(

# Text asset files are rotated right through 90 degrees to allow blocks of
# 40 contiguous pixels to represent one 5 x 8 character. These are stored
# in a 8 x 640 pixel png image with characters arranged adjacently
# in a 8 pixel-wide png image with characters arranged adjacently
# Consequently we must rotate the pixel map left through 90 degrees to
# compensate when drawing text

Expand All @@ -108,7 +109,7 @@ def _load_text_assets(self, text_image_file, text_file):
"""

text_pixels = self.load_image(text_image_file, False)
with open(text_file, 'r') as f:
with codecs.open(text_file, 'r', 'UTF-8') as f:
loaded_text = f.read()
self._text_dict = {}
for index, s in enumerate(loaded_text):
Expand Down
Binary file modified sense_hat/sense_hat_text.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion sense_hat/sense_hat_text.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
+-*/!"#$><0123456789.=)(ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz?,;:|@%[&_']\~
+-*/!"#$><0123456789.=)(ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz?,;:|@%[&_']\~{}`^¡¿£¥©ªº«»®°±²³µ·¹¼½¾×÷¢¤¦§¨¬¯´¶ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ