diff --git a/sense_hat/sense_hat.py b/sense_hat/sense_hat.py index 30597b9..3beda77 100644 --- a/sense_hat/sense_hat.py +++ b/sense_hat/sense_hat.py @@ -11,6 +11,7 @@ import pwd import array import fcntl +import codecs from PIL import Image # pillow from copy import deepcopy @@ -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 @@ -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): diff --git a/sense_hat/sense_hat_text.png b/sense_hat/sense_hat_text.png index b4841db..0f102d2 100644 Binary files a/sense_hat/sense_hat_text.png and b/sense_hat/sense_hat_text.png differ diff --git a/sense_hat/sense_hat_text.txt b/sense_hat/sense_hat_text.txt index a6fc7b6..406fb5d 100644 --- a/sense_hat/sense_hat_text.txt +++ b/sense_hat/sense_hat_text.txt @@ -1 +1 @@ - +-*/!"#$><0123456789.=)(ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz?,;:|@%[&_']\~ + +-*/!"#$><0123456789.=)(ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz?,;:|@%[&_']\~{}`^¡¿£¥©ªº«»®°±²³µ·¹¼½¾×÷¢¤¦§¨¬¯´¶ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ