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

Noto Emoji (Monochrome) version #12

Open
ghost opened this issue Dec 31, 2022 · 3 comments
Open

Noto Emoji (Monochrome) version #12

ghost opened this issue Dec 31, 2022 · 3 comments
Labels
enhancement New feature or request

Comments

@ghost
Copy link

ghost commented Dec 31, 2022

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
Copy link
Member

kernc commented Jan 1, 2023

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.

@kernc kernc added the enhancement New feature or request label Jan 1, 2023
@ghost
Copy link
Author

ghost commented Jan 2, 2023

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
Copy link
Member

kernc commented Jan 3, 2023

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? 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

No branches or pull requests

1 participant