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

Using Emojis on Linux is broken #796

Open
CReimer opened this issue Jan 5, 2024 · 11 comments
Open

Using Emojis on Linux is broken #796

CReimer opened this issue Jan 5, 2024 · 11 comments
Labels

Comments

@CReimer
Copy link

CReimer commented Jan 5, 2024

I'm unable to use Emojis in GCS on Linux. The same file opened on Windows shows all Emojis without problem

You can easily check this by changing e.g. "HP" to "💗 HP"

@richardwilkes
Copy link
Owner

The emoji support relies on your platform having the emojis available for me to use. If it isn't displaying, then GCS is unable to find/access the relevant font data. This isn't something I'm likely to be able to fix.

@CReimer
Copy link
Author

CReimer commented Jan 5, 2024

Screenshot

Here's a screenshot of GCS side by side with gedit.
gedit shows the Emoji without problem. GCS does not.

@CReimer
Copy link
Author

CReimer commented Jan 5, 2024

The Arch Wiki mentions something about Emoji fallback
https://wiki.archlinux.org/title/Fonts#Emoji_and_symbols

Maybe that's what's not working here.

GCS defaults to 'Roboto' for almost all fonts. That's not even installed on my system. And I believe it's not a default font for Windows either.

Either way. Roboto does not provide any Emojis. GCS has to fall back on another font for that. On Linux in my case it is the Noto Color Emoji font

@richardwilkes
Copy link
Owner

Have you checked to see if GCS shows that fallback font in its font list? If not, that would likely be the problem. The underlying Skia graphics package is used to find and load fonts, including the fallback font. If it does see it, then for whatever reason, Skia isn't selecting it when GCS asks it to find a fallback font that contains the given missing character.

@CReimer
Copy link
Author

CReimer commented Jan 5, 2024

"Noto Color Emoji" is available in the font list. I tried setting it as font for "Page Primary Labels" and I expected to only see the Emojis now. Instead there's nothing at all.

It could be possible that the right fallback font is selected but GCS (or Skia) is unable to render the font.

Is there any way I can help debug this problem?

@richardwilkes
Copy link
Owner

Odd. When I do the same thing on my Linux box, it still renders normal text just fine -- probably because it is falling back and finding a font with the needed character.

I did see that on my (intentionally) old linux installation that I get no color emoji at all, and only a small subset of emoji available. i.e. I have a standard smiling face and the one with glasses, but not many of the other variants. This despite also having Noto Color Emoji showing up in the font list that GCS can see.

So... it must have something to do with the way Skia has decided to do the font lookup for the fallback mechanism. I'll poke around and see if I can find an alternate way of invoking it. It's already quite painful to make this work, so I'm not holding my breath, though.

@richardwilkes
Copy link
Owner

Can't hurt to post something to the GCS Discord asking for suggestions -- someone there may have more experience with Linux and/or Skia than I do and have may a solution.

@CReimer
Copy link
Author

CReimer commented Jan 20, 2024

Tried the Windows version on Linux. It looks different but still broken

grafik

@richardwilkes
Copy link
Owner

I recently discovered that the font support I have in skia (the underlying graphics library GCS uses) doesn't support certain types of fonts. Specifically, the Noto Color Emoji font is a newer type of color font that isn't supported. That would explain why attempts to use it don't show any actual emojis.

@CReimer
Copy link
Author

CReimer commented May 29, 2024

Any way I can help with that?
I've never programmed for Go before. I'm more of a PHP/Typescript dev because of my job.

Is this a skia problem or is it a problem of how you interact with skia?

@richardwilkes
Copy link
Owner

The info I've read so far seems to indicate it is a limitation in the current skia font support code. Skia is a C++ source base. I'm sure support can be added, but the effort involved looks like it is substantially more than I'm interested in tackling at the moment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants