Canvas.drawText() doesn't render large emojis

2020-06-03 07:50发布

Canvas.drawText() doesn't render emojis above a certain font size on Android.

Correct render at somewhere below 256 px: emoji correctly rendered

Incorrect render at above 256 px: enter image description here

(There is a similar question about Google Chrome, and just like Android, Chrome also uses the Skia graphics library, so this seems like a bug in Skia.)

Apparently emojis fail to render above 256 px font size on my devices. But I'm not sure if this is the limit everywhere.

Is there a way to learn the font size at which emojis disappear? Or is there a workaround for this?

1条回答
欢心
2楼-- · 2020-06-03 08:49

I've come up with a test (an empirical estimation) for the maximum font size at which emojis can still be rendered.

The way this function works is it creates a 1x1 bitmap, and tries to draw the Earth Globe emoji (

查看更多
登录 后发表回答