Skip to content

Commit 2002a06

Browse files
FontManager: switch from 20x20 to 32x32 emojis
Improves quality and same filesize because PNG set is optimized by Google.
1 parent 5826da5 commit 2002a06

114 files changed

Lines changed: 178 additions & 68 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎AGENTS.md‎

Lines changed: 1 addition & 1 deletion

‎CHANGELOG.md‎

Lines changed: 4 additions & 1 deletion

‎internal_filesystem/apps/com.micropythonos.showfonts/assets/showfonts.py‎

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,14 +82,24 @@ def onResume(self, screen):
8282
title.set_text("ShowFonts")
8383

8484
resume_start = self._now_ms()
85+
8586
emojilabel = lv.label(screen)
8687
emojifont = FontManager.getFont(size=16, emoji=True)
87-
print("emoji font height: ", emojifont.get_line_height())
88+
print("emoji font height: ", emojifont.get_line_height()) # 16 gives height 20
8889
emojilabel.set_style_text_font(emojifont, lv.PART.MAIN)
89-
text = "👍 👍🏻" # neutral thumbs up, light thumbs up
90+
text = "😊 "
91+
text += "👍 👍🏻" # neutral thumbs up, light thumbs up
9092
text += "🤦 🤦🏻 🤦‍♀️ 🤦🏻‍♀️" # neutral facepalm, light facepalm, neutral woman facepalm, light woman facepalm
9193
emojilabel.set_text(text)
9294

95+
emojilabel2 = lv.label(screen)
96+
emojifont2 = FontManager.getFont(size=30, emoji=True) # 32 givs height 33 is the maximum because Montserrat 28 is the maximum (TTF can go bigger)
97+
print("emoji2 font height: ", emojifont2.get_line_height())
98+
emojilabel2.set_style_text_font(emojifont2, lv.PART.MAIN)
99+
text = "test 👍 👍🏻" # neutral thumbs up, light thumbs up
100+
text += "🤦 🤦🏻 🤦‍♀️ 🤦🏻‍♀️" # neutral facepalm, light facepalm, neutral woman facepalm, light woman facepalm
101+
emojilabel2.set_text(text)
102+
93103
self.addAllFontsTitles(screen)
94104
self._log_timing("addAllFontsTitles", resume_start)
95105

@@ -108,7 +118,7 @@ def addAllFontsTitles(self, screen):
108118
import os
109119
ttf_start = self._now_ms()
110120
mydir = os.path.dirname(os.path.abspath(__file__))
111-
self._ttf_font = FontManager.getFont(size=42, ttf=f"M:{mydir}/Rancourt-SmallCaps.ttf")
121+
self._ttf_font = FontManager.getFont(size=42, ttf=f"M:{mydir}/Rancourt-SmallCaps.ttf", emoji=True)
112122
self._log_timing("addAllFontsTitles/getFont TTF", ttf_start)
113123
#self._ttf_font56 = FontManager.getFont(size=56, ttf=f"M:{mydir}/Rancourt-SmallCaps.ttf")
114124
#self._ttf_font72 = FontManager.getFont(size=72, ttf=f"M:{mydir}/Rancourt-SmallCaps.ttf")
@@ -118,7 +128,7 @@ def addAllFontsTitles(self, screen):
118128
self.labelSelectable(title)
119129
title.set_width(lv.pct(99))
120130
title.set_style_text_font(self._ttf_font, lv.PART.MAIN)
121-
title.set_text("Rancourt 42 TTF test with minimal glyphs")
131+
title.set_text("Rancourt 42 TTF test with minimal glyphs 👍")
122132

123133
listfonts_start = self._now_ms()
124134
fonts = FontManager.listFonts()
-1000 Bytes
Binary file not shown.
-717 Bytes
Binary file not shown.
-1.06 KB
Binary file not shown.
-1.27 KB
Binary file not shown.
-489 Bytes
Binary file not shown.
-921 Bytes
Binary file not shown.
-816 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)