Open huyangv opened 1 year ago
This is an issue in golang.org/x/image/font
, rather than Ebitengine. I am not sure this is solvable.
I changed this issue a request rather than a bug.
To be more specific, see https://pkg.go.dev/golang.org/x/image/font/sfnt#pkg-variables ErrColoredGlyph
(sfnt doesn't support colored glyphs like most emojis).
My take is that even if we used a library that supported colored glyphs, this would complicate the text package models quite a bit, and text is already pretty complex as it is. With Ebitengine being a game engine, not a general application development framework, focusing on creating a way to combine regular *ebiten.Image
s with text may be a more productive approach.
In practice, it's really hard to draw a reasonable line somewhere between minimal text support and universal browser-like text layout. There are too many features and possibilities, and most of them make a lot of sense in isolation and certain use-cases, but very few are actually relevant in a range of cases wide enough to justify going out the way to cover for them.
If you want to expand explaining what's your use case, I'm sure we can give more context on the topic, because if it's something like a text editor, emojis will be the least of your problems.
I think using https://pkg.go.dev/github.com/go-text/typesetting@v0.0.0-20230618175549-b5753034b590/opentype/api#GlyphSVG would solve this issue, but this is not easy.
Ebitengine Version
2.5.2
Operating System
Go Version (
go version
)1.19.4
What steps will reproduce the problem?
I tried to draw some emojis using a font pack that could parse emoji, but the result was blank, and if I used a font that didn't contain emojis, the result was a box。 The fonts I've tried to include emoticon characters are as follows: 1 AppleColorEmoji_2x.ttf 2 NotoColorEmoji-Regular.ttf
I saw in another issue that truetype was recommended for loading Noto characters, and in fact that's exactly what I did。
What is the expected result?
strings: ♈♏😁0123456789
And result : (use AppleColorEmoji_2x.ttf)
(use NotoColorEmoji-Regular.ttf)
(use other ttf-no emoji)
What happens instead?
see result.
Anything else you feel useful to add?
No response