efck-chat-keyboard/efck

Noto Emoji (Monochrome) version

Symbian9 opened this issue · 3 comments

Is your feature request related to a problem? Please describe.

Noto Color Emoji is huge.

Describe the solution you'd like

Make a version with Noto Emoji (Monochrome) dependency, instead of Noto Color Emoji.

Additional context

Make use static NotoEmoji-Regular.ttf (not variable NotoEmoji-VariableFont_wght.ttf).

kernc commented

We don't bundle the font for Windows (not needed / doesn't work), macOS (not needed / doesn't work), or Debian (font is installed via a package dependency). We only bundle the font for the linux tgz archive.

The supported icon fonts are listed here:

efck/efck/tabs/emoji.py

Lines 100 to 141 in 096a7b6

ALL_FONT_FAMILIES = [
'Noto Color Emoji',
"Twitter Color Emoji",
'Apple Color Emoji',
'Segoe UI Emoji',
"Joypixels",
# Reconsider
# "OpenMoji Color",
"Symbola",
]
_TEXT_OFFSET = 0
_ICON_OFFSET = 0
if IS_MACOS:
ICON_FONT_FAMILY = 'Apple Color Emoji'
_ICON_OFFSET = -5
# Avoid: "qt.qpa.fonts: Populating font family aliases took 802ms.
# Replace uses of missing font "X" with one that exists to avoid this cost."
ALL_FONT_FAMILIES = ()
elif IS_WIDOWS:
ICON_FONT_FAMILY = 'Segoe UI Emoji'
TEXT_FONT.setFamily('Arial')
ICON_FONT_SIZE -= 3
_TEXT_OFFSET = 5
_ICON_OFFSET = -7
TEXT_FONT_SIZE_PX = 9
else:
ICON_FONT_FAMILY = 'Noto Color Emoji'
TEXT_OFFSET = _TEXT_OFFSET
ICON_OFFSET = QPoint(0, _ICON_OFFSET)
_font_file = Path(__file__).parent.parent / 'NotoColorEmoji.ttf'
if _font_file.is_file():
logger.info('Loading vendored font NotoColorEmoji.ttf')
_res = QFontDatabase.addApplicationFont(str(_font_file))
if _res == -1:
logger.error('Error loading vendored font.')
# Read user's font preference from the environment
ICON_FONT_FAMILY = os.environ.get('ICON_FONT', ICON_FONT_FAMILY)
ICON_FONT = QFont()
ICON_FONT.setFamilies([ICON_FONT_FAMILY, *ALL_FONT_FAMILIES])

I guess we could add "Noto Emoji" in there somewhere ...

Also note, you can force any emoji font with ICON_FONT environment variable.

or Debian (font is installed via a package dependency)

Yes, above I mean DEB strong dependency on fonts-noto-color-emoji — this package is outdated in all stable distros:

So, it might be good set it to Recommends (instead of Depends) in ../debian/control.

kernc commented

But if we only recommend it, then we have to vendor a fallback font, which can be "Noto Emoji", but that would increase the DEB package size by 700%! Any other ideas?

What's wrong with the outdated font besides a few missing glyphs? 😅