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

FreeType: Issues with Colored Fonts #3275

Open
ghost opened this issue Sep 23, 2024 · 5 comments
Open

FreeType: Issues with Colored Fonts #3275

ghost opened this issue Sep 23, 2024 · 5 comments
Labels

Comments

@ghost
Copy link

ghost commented Sep 23, 2024

Player platform:

Windows, Android

Describe the issue in detail and how to reproduce it:

Windows:
Using colored fonts results in the following error:

Debug: Couldn't load FreeType character 0x1f4d0
Error: Broken color font for glyph 0x1f4d0

Android:
The font is completely ignored (although during startup, you can see that the console no longer prompts that the font was not found).

On Windows, I have tried other fonts (such as Google Noto), but the same issue occurred. Below are the main test fonts I used.

Attach files

Font.ttf.zip

I wrote a script to convert Minecraft's emojipack into TTF. See ttf_cbdt_mc_create.py.

Although the font works properly on the player versions for macOS, web, and Linux, I do not rule out the possibility of a data format error.

@jetrotal
Copy link
Contributor

jetrotal commented Sep 23, 2024

image
Windows can't open font.ttf, it tells that it's not a valid font file.

@ghost
Copy link
Author

ghost commented Sep 23, 2024

I have been troubled by the font's data definition for a long time, and I still don't understand it. The current Font.ttf likely has many errors because I completely ignored the relationships between each field and only know that it can render in some Player builds.

@Ghabry
Copy link
Member

Ghabry commented Sep 23, 2024

I had exactly the same problem when trying to understand colour fonts. There is no documentation and no tools :/

@jetrotal
Copy link
Contributor

Have you guys tested a tool called nanoemoji? https://github.com/googlefonts/nanoemoji

I read about it when researching about Serenity OS emojis: https://github.com/linusg/serenityos-emoji-font
Idk if the input must be SVG files or if it can work with png as well.

@Mimigris Mimigris added the Fonts label Oct 19, 2024
@apodtele
Copy link

apodtele commented Oct 23, 2024

FreeType can only handle color fonts if appropriate backend is available and linked at compile time. That could be libPNG, rsvg, or what not. Something else has to decode or render color. Fonts with PNG are fairly trivial, other formats are major ordeal. For example FreeType can serve an embedded SVG document. Then you are on your own.

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

No branches or pull requests

4 participants