veandco / go-sdl2

SDL2 binding for Go
https://godoc.org/github.com/veandco/go-sdl2
BSD 3-Clause "New" or "Revised" License
2.17k stars 219 forks source link

`RenderUTF8Blended` doesn't work well #463

Closed danielgatis closed 4 years ago

danielgatis commented 4 years ago

Hi!

I'm trying to write some strings:

    var surface *sdl.Surface
    if surface, err = ft.RenderUTF8Blended("🐹", color); err != nil {
        return nil, nil, errors.Wrap(err, "Failed to draw")
    }

With this font:

❯ fc-match --format=%{file} "FiraCode Nerd Font"
/Users/daniel/Library/Fonts/Fira Code Regular Nerd Font Complete.otf% 

But I'm getting this output:

Screen Shot 2020-05-23 at 19 46 31

What's wrong?

veeableful commented 4 years ago

Hi @danielgatis, does the font contain the emoji? I tested with other fonts such as NotoColorEmoji and it seems to draw it.

danielgatis commented 4 years ago

@veeableful you are right, I also did the same test but the glyph color is grayscale. There is no color support?