diff --git a/Font/Font00.ttf b/Font/Font00.ttf deleted file mode 100755 index e85ffd1..0000000 Binary files a/Font/Font00.ttf and /dev/null differ diff --git a/Font/GothamBoldItalic.ttf b/Font/GothamBoldItalic.ttf deleted file mode 100644 index a9f2b11..0000000 Binary files a/Font/GothamBoldItalic.ttf and /dev/null differ diff --git a/Font/GothamBook.ttf b/Font/GothamBook.ttf deleted file mode 100644 index 6cdde85..0000000 Binary files a/Font/GothamBook.ttf and /dev/null differ diff --git a/Font/GothamBookItalic.ttf b/Font/GothamBookItalic.ttf deleted file mode 100644 index c711011..0000000 Binary files a/Font/GothamBookItalic.ttf and /dev/null differ diff --git a/Font/GothamLight.ttf b/Font/GothamLight.ttf deleted file mode 100644 index 6f6bfc5..0000000 Binary files a/Font/GothamLight.ttf and /dev/null differ diff --git a/Font/GothamLightItalic.ttf b/Font/GothamLightItalic.ttf deleted file mode 100644 index 4a133fc..0000000 Binary files a/Font/GothamLightItalic.ttf and /dev/null differ diff --git a/Font/GothamMediumItalic.ttf b/Font/GothamMediumItalic.ttf deleted file mode 100644 index 879e4fb..0000000 Binary files a/Font/GothamMediumItalic.ttf and /dev/null differ diff --git a/Font/GothamMedium_1.ttf b/Font/GothamMedium_1.ttf deleted file mode 100644 index 793dce5..0000000 Binary files a/Font/GothamMedium_1.ttf and /dev/null differ diff --git a/spotiplayer_pi/main.py b/spotiplayer_pi/main.py index ef7b395..3c0d998 100644 --- a/spotiplayer_pi/main.py +++ b/spotiplayer_pi/main.py @@ -28,32 +28,31 @@ def display_loop(api: Api, cfg: Dict): bg = Image.new("RGB", (d.height, d.width), (0, 0, 0)) d.ShowImage(bg) - #Font0 = ImageFont.truetype("Font/Font00.ttf", 14) - #Font1 = ImageFont.truetype("Font/Font00.ttf", 18) - #Font2 = ImageFont.truetype("Font/Font00.ttf", 36) - - Font0 = ImageFont.truetype("Font/GothamLight.ttf", 14) - Font1 = ImageFont.truetype("Font/GothamLight.ttf", 18) - Font2 = ImageFont.truetype("Font/GothamLight.ttf", 36) + Font0 = ImageFont.truetype("Font/GothamMedium.ttf", 13) + Font1 = ImageFont.truetype("Font/GothamMedium.ttf", 18) + Font1b = ImageFont.truetype("Font/GothamBold.ttf", 19) + Font2 = ImageFont.truetype("Font/GothamMedium.ttf", 20) + Font3 = ImageFont.truetype("Font/GothamMedium.ttf", 36) unavailable_img = Image.open("imgs/unavailable.jpg") error_img = Image.new("RGB", (240, 320), color=(255, 0, 0)) draw = ImageDraw.Draw(error_img) - draw.text((150, 150), "Error", font=Font1, fill=cfg["color_theme"]["text"]) + draw.text((150, 150), "Error :(", font=Font1, fill=cfg["color_theme"]["text"]) del draw - spoti_logo = Image.open("imgs/logo128.jpg") + spoti_logo = Image.open("imgs/logo64.jpg") qr = Image.open("imgs/qr.jpg") - spoti_logo = spoti_logo.resize((128, 128)) + spoti_logo = spoti_logo.resize((64, 64)) not_playing_img = Image.new("RGB", (320, 240), (0, 0, 0)) - not_playing_img.paste(spoti_logo, (0, 10)) + not_playing_img.paste(spoti_logo, (25, 40)) not_playing_img.paste(qr, (120, 40)) draw = ImageDraw.Draw(not_playing_img) draw.text( - (124, 10), + (112, 15), "Connect to speakers", - font=Font1, - fill=cfg["color_theme"]["text"], + font=Font2, + fill=(255, 255, 255), + # fill=cfg["color_theme"]["text"], ) del spoti_logo, qr, draw @@ -82,11 +81,13 @@ def display_loop(api: Api, cfg: Dict): draw = ImageDraw.Draw(not_playing_img) current_time = datetime.now().time() draw.rectangle([(00, 120), (119, 170)], fill=(0, 0, 0)) + offset = 10 if current_time.hour < 9 else 0 draw.text( - (20, 120), + (10 + offset, 120), f"{current_time.hour}:{current_time.minute:02d}", - font=Font2, - angle=0, + font=Font3, + fill=(255, 255, 255), + # fill=cfg["color_theme"]["text"], ) if current_mode != 0: current_mode = 0 @@ -117,20 +118,20 @@ def display_loop(api: Api, cfg: Dict): bg.paste(img, (10, 30)) draw = ImageDraw.Draw(bg) draw.text( - (150, 28), + (145, 33), "\n".join(textwrap.wrap(", ".join(data["artists"]), width=16)), font=Font1, fill=cfg["color_theme"]["text"], ) draw.text( - (10, 160), - "\n".join(textwrap.wrap(data["track"], width=32)), - font=Font1, + (11, 164), + "\n".join(textwrap.wrap(data["track"], width=28)), + font=Font1b, fill=cfg["color_theme"]["text"], ) w, h = bg.size - w -= 92 + w -= 95 progress_time = data["progress_ms"] + int( (time.time() - last_api_call) * 1000 ) @@ -154,10 +155,10 @@ def display_loop(api: Api, cfg: Dict): *divmod(data["duration_ms"] // 1000, 60) ) draw.rectangle( - [(234, 215), (310, 235)], fill=cfg["color_theme"]["background"] + [(231, 215), (320, 235)], fill=cfg["color_theme"]["background"] ) draw.text( - (235, 215), + (232, 220), f"{f_current_time}/{f_total_time}", font=Font0, fill=cfg["color_theme"]["text"],