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

Add emoji for example project in https://github.com/godotengine/godot-demo-projects/tree/master/gui/bidi_and_font_features #1119

Open
Lyumih opened this issue Oct 12, 2024 · 5 comments

Comments

@Lyumih
Copy link

Lyumih commented Oct 12, 2024

Add emoji for example project in https://github.com/godotengine/godot-demo-projects/tree/master/gui/bidi_and_font_features

Linked with godotengine/godot#98110

@Calinou
Copy link
Member

Calinou commented Oct 12, 2024

This will require committing an emoji font for it to display consistently on all platforms, and an emoji font is pretty large (24 MB for Noto Color Emoji). This would increase repository size a fair bit, while we try to keep it fairly small so it's easy for users to clone (shallow clones aren't suited for contributing).

Of course, we can rely on system fonts as an alternative, but they can't be used on the web platform. We could have a system in place to download then load the emoji font at runtime on the web platform only, but this would add some complexity to the demo's script.

@bruvzg
Copy link
Member

bruvzg commented Oct 12, 2024

For the demo we can subset emoji font and keep only a few characters used in the project.

@Calinou
Copy link
Member

Calinou commented Oct 29, 2024

For the demo we can subset emoji font and keep only a few characters used in the project.

I've started to look at subsetting Noto Color Emoji, but I can't get the font to show up in Godot correctly: papandreou/subset-font#26

@bruvzg
Copy link
Member

bruvzg commented Oct 29, 2024

I've started to look at subsetting Noto Color Emoji, but I can't get the font to show up in Godot correctly

HarfBuzz subsetter seems to work with the for downloaded from https://fonts.google.com/noto/specimen/Noto+Color+Emoji

% cat list.txt
U+1F302
U+1F346
% hb-subset --unicodes-file=list.txt --output-file=emoji_sub.ttf NotoColorEmoji.ttf

The result is a 4 kb ttf file, and it is working in Godot (labels using full font and subsetted font, fallback is disabled for both):
Screenshot 2024-10-29 at 18 40 57

Edit: I was using old version of the font, current one is not working with Godot at all (Failed to create SVG canvas), will check it later.

@bruvzg
Copy link
Member

bruvzg commented Oct 29, 2024

I was using old version of the font, current one is not working with Godot at all (Failed to create SVG canvas), will check it later.

Seems like ThorVG is broken again, tvg::IteratorAccessor that was used to determine glyph bounds (since TVG can't work with SVG without viewBox, and none of the fonts have it) now seems to do nothing, so SVG fonts are fully broken.

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

No branches or pull requests

3 participants