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

SVG font loading fails, and can cause a crash in thorvg #67260

Closed
k8035 opened this issue Oct 11, 2022 · 5 comments
Closed

SVG font loading fails, and can cause a crash in thorvg #67260

k8035 opened this issue Oct 11, 2022 · 5 comments

Comments

@k8035
Copy link

k8035 commented Oct 11, 2022

Godot version

4.0.beta2.mono

System information

Windows 11

Issue description

A text label that is set to the font "NotoColorEmoji-Regular.ttf" does not show emojis or text.

Steps to reproduce

  • Create a new project with Godot 4.0.beta2.mono.
  • Create a text label node.
  • Download the font "NotoColorEmoji-Regular.ttf" (from here).
  • Import the font file into the project.
  • Set the text label to this font.
  • Enter some text into the label that contains emojis, for example "test 😀 😃".
  • Bug: The label does not show any text or emojis.

See screenshot.
image emojis

Minimal reproduction project

Emoji-Test.zip

@bruvzg
Copy link
Member

bruvzg commented Oct 11, 2022

Seems like new versions of NotoColorEmoji are using SVG format which is not supported, old bitmap (PNG) versions will work. In addition, it's also using multi glyph SVG documents, so it won't work with #64530 as well.

@k8035
Copy link
Author

k8035 commented Oct 12, 2022

Thanks! How do you to check whether a font is using the SVG format or the bitmap format?

I'm unable to find an old version of NotoColorEmoji since the file on Github seems to have no commit history except for the last commit. Is an old bitmap (PNG) version of that font still online somewhere?

When testing with this file, emojis do appear, but the wrong ones. See screenshot. The emojis should be these: 😀 😃 😄. Not sure what that "CompatTest" font is for, though.

Should I rename this issue to "No warning if SVG font loading fails" or something like that?

Godot 4 test with Noto Color Emoji Compat Test font

@Calinou Calinou changed the title Color emojis not showing in Godot 4.0 beta 2 Print a warning when SVG font loading fails Oct 12, 2022
@k8035
Copy link
Author

k8035 commented Oct 19, 2022

Seems like new versions of NotoColorEmoji are using SVG format which is not supported, old bitmap (PNG) versions will work. In addition, it's also using multi glyph SVG documents, so it won't work with #64530 as well.

@bruvzg : Maybe this info is useful for you. We tested several different versions of the Google Noto Color Emoji font, and these are the results. Some versions of the font fail to display, without a warning. Results with Godot 3.5 and 4.0 beta 2 are identical.

  • github.com/googlefonts/noto-emoji/tree/474505eeaf857fed40c048126593e2dfa146a5e8/fonts => NotoColorEmoji.ttf

    • This is an older version of the Noto Color Emoji font that should still use PNGs internally. (Not sure about the other versions.)
    • Result: correct text and emojis.
  • github.com/googlefonts/noto-emoji/tree/main/fonts => NotoColorEmoji.ttf

    • Result: correct text and emojis.
  • github.com/googlefonts/noto-emoji/tree/main/fonts => NotoColorEmoji_WindowsCompatible.ttf

    • Result: correct text and emojis.
  • github.com/google/fonts/tree/main/ofl/notocoloremoji => NotoColorEmoji-Regular.ttf

    • Result: no emojis displayed.
  • github.com/google/fonts/tree/main/ofl/notocoloremojicompattest => NotoColorEmojiCompatTest-Regular.ttf

    • Result: weirdly, completely different emojis are displayed.
  • fonts.google.com/noto/specimen/Noto+Color+Emoji => NotoColorEmoji-Regular.ttf

    • Result: no emojis are displayed.

2022-10-19 Godot 3 5 Emojis Screenshot

@mrcdk
Copy link
Contributor

mrcdk commented Feb 9, 2023

In Godot 4.0-rc1 it looks like the font downloaded from https://fonts.google.com/noto/specimen/Noto+Color+Emoji renders incorrectly in the editor and causes a crash when running the project:
image

================================================================
handle_crash: Program crashed with signal 11
Engine version: Godot Engine v4.0.rc.custom_build (c4fb119f03477ad9a494ba6cdad211b35a8efcce)
Dumping the backtrace. Please include this when reporting the bug to the project developer.
[1] /usr/lib/libc.so.6(+0x389e0) [0x7fde2d6519e0] (??:0)
[2] /home/mrcdk/development/godot/godot/bin/godot.linuxbsd.editor.x86_64.llvm(+0x3297b20) [0x55653ae2bb20] (/home/mrcdk/development/godot/godot/thirdparty/thorvg/src/loaders/svg/tvgXmlParser.cpp:87)
[3] /home/mrcdk/development/godot/godot/bin/godot.linuxbsd.editor.x86_64.llvm(+0x32948cf) [0x55653ae288cf] (/home/mrcdk/development/godot/godot/thirdparty/thorvg/src/loaders/svg/tvgSvgLoader.cpp:1411)
[4] /home/mrcdk/development/godot/godot/bin/godot.linuxbsd.editor.x86_64.llvm(+0x3291262) [0x55653ae25262] (/home/mrcdk/development/godot/godot/thirdparty/thorvg/src/loaders/svg/tvgSvgLoader.cpp:?)
[5] /home/mrcdk/development/godot/godot/bin/godot.linuxbsd.editor.x86_64.llvm(+0x32904f9) [0x55653ae244f9] (/home/mrcdk/development/godot/godot/thirdparty/thorvg/src/loaders/svg/tvgSvgLoader.cpp:?)
[6] /home/mrcdk/development/godot/godot/bin/godot.linuxbsd.editor.x86_64.llvm(+0x32987b4) [0x55653ae2c7b4] (/home/mrcdk/development/godot/godot/thirdparty/thorvg/src/loaders/svg/tvgXmlParser.cpp:?)
[7] /home/mrcdk/development/godot/godot/bin/godot.linuxbsd.editor.x86_64.llvm(+0x3290047) [0x55653ae24047] (/home/mrcdk/development/godot/godot/thirdparty/thorvg/src/loaders/svg/tvgSvgLoader.cpp:3183)
[8] /home/mrcdk/development/godot/godot/bin/godot.linuxbsd.editor.x86_64.llvm(+0x32844bc) [0x55653ae184bc] (/home/mrcdk/development/godot/godot/thirdparty/thorvg/src/lib/tvgTaskScheduler.h:70)
[9] /usr/lib/libstdc++.so.6(+0xd7283) [0x7fde2d8d7283] (??:0)
[10] /usr/lib/libc.so.6(+0x868fd) [0x7fde2d69f8fd] (??:0)
[11] /usr/lib/libc.so.6(+0x108d20) [0x7fde2d721d20] (??:0)
-- END OF BACKTRACE --
================================================================

Using the fonts NotoColorEmoji*.ttf from https://github.com/googlefonts/noto-emoji/tree/main/fonts seem to render correctly and the project doesn't crash. The other ones in that repo don't work but I not sure what's the difference between them.

@akien-mga akien-mga added this to the 4.0 milestone Feb 9, 2023
@akien-mga akien-mga changed the title Print a warning when SVG font loading fails SVG font loading fails, and can cause a crash in thorvg Feb 9, 2023
@YuriSizov YuriSizov modified the milestones: 4.0, 4.1 Feb 27, 2023
@bruvzg
Copy link
Member

bruvzg commented Jun 14, 2023

it looks like the font downloaded from https://fonts.google.com/noto/specimen/Noto+Color+Emoji renders incorrectly in the editor and causes a crash when running the project

Seems to be rendering correctly, and does not crash with the current master. Probably fixed by #75675 and ThorVG updates.

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

No branches or pull requests

6 participants