Blurry emojis when rotated/scaled

18 views
Skip to first unread message

Thierry Seegers

unread,
Sep 12, 2022, 5:39:06 AMSep 12
to skia-discuss
Hi all,

I'm investigating a bug in our application whereby emojis become blurry when a text box is rotated or scaled. Any text remains sharp but the mojis appear render at a very small scale and scaled up to fit the font size. This is not observed when the text boxes are horizontal/vertical or even close to horizontal or vertical. But when rotated (at a certain scale) the emojis will render incorrectly past a certain angle. Also, they'll appear blurry when the font size is increased even if they're rendered horizontally.

I'm attaching pictures but you can see a video demonstrating the bug here: https://youtu.be/XDtLC9QrP7E

For rendering text runs consisting of emojis, I'm using the NotoColorEmoji.ttf font file found here: https://github.com/googlefonts/noto-emoji

We're using SkCanvas::drawGlyphs after having shaped the text runs with HarfBuzz.
I tried fiddling with the few properties of SkFont but that didn't appear to help.

We're using Skia 0.31.0.

Any help will be appreciated.

Regards,
Thierry

Correct render when horizontal:
Screenshot 2022-09-12 at 11.18.32.png
Correct render after a rotation:
Screenshot 2022-09-12 at 11.18.51.png

Blurry emojis when scaled up a bit and rotated:
Screenshot 2022-09-12 at 11.19.19.png

Blurry emojis when horizontal but scaled more:
Screenshot 2022-09-12 at 11.19.40.png

craste...@gmail.com

unread,
Sep 12, 2022, 9:00:28 AMSep 12
to skia-discuss
I am not a Skia dev.  But for clarity, is the rotation required for the problem?  Including the case where you rotate 45 and then rotate back to 0.
Also, does the problem appear if the scale and rotation are initialized to the fail case?  Meaning, you didn't have to transform the view to get it; it started out like that.
And, finally, I was a little thrown by your mention of "Skia 0.31.0".  For years, I have been used to seeing Skia's version described in milestone integers.  m70, m85, m104, etc...
I am not saying you are wrong, but if the Skia devs have two separate version numbers, they should probably stop doing that.
That path leads to hell.

Brian Osman

unread,
Sep 12, 2022, 9:03:56 AMSep 12
to skia-d...@googlegroups.com
0.31.0 sounds like a CanvasKit version number, (from about a year ago). Are you able to try with a newer version (0.37.0)? There have actually been some fixes to emoji scaling in the last month or so.

--
You received this message because you are subscribed to the Google Groups "skia-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to skia-discuss...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/skia-discuss/944abb76-f972-4a44-8d2f-054660ac04f2n%40googlegroups.com.

Thierry Seegers

unread,
Sep 12, 2022, 10:37:06 AMSep 12
to skia-d...@googlegroups.com
Hi,

Rotation is not necessary. I can reproduce by just scaling up the font size. Scaling down doesn't exhibit the issue.

I can indeed reproduce the issue if I start the scene with the text box already rotated or scaled. I understand why you might have asked the question but it appears that the problem is exactly about rendering these glyphs under certain conditions, regardless of how you got there.

By 0.31.0 I'm referring to the tag here: https://github.com/google/skia/releases/tag/canvaskit%2F0.31.0 which appears to roughly correspond to m93 date-wise.

Regards,
Thierry

--
You received this message because you are subscribed to a topic in the Google Groups "skia-discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/skia-discuss/UC3Cf80c4nw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to skia-discuss...@googlegroups.com.

Thierry Seegers

unread,
Sep 12, 2022, 10:40:00 AMSep 12
to skia-d...@googlegroups.com
Hi Brian,

I'm actively walking that path. It's just not so straightforward as changing a number in a config file as we have our own patches and conan ~~hell~~ repo to deal with but I knew I couldn't avoid it so I'll report back on that front when I can.

Regards

You received this message because you are subscribed to a topic in the Google Groups "skia-discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/skia-discuss/UC3Cf80c4nw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to skia-discuss...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/skia-discuss/CAMcBjo6acrhLQoVeyPw19SKWXBMLXYBYo6iKuGMuipgGsk6BpQ%40mail.gmail.com.

Thierry Seegers

unread,
Sep 13, 2022, 11:54:34 AMSep 13
to skia-d...@googlegroups.com
Hi Brian,

To follow up with trying out 0.37, that actually fixed my issue! Thanks.

I surmise commit 315353 is what fixed but though it's tiny there's already too much difference in the surrounding code between 0.31 and 0.37 to consider a backport so we'll update our own repo to 0.37.

Thanks again (all) for your help!

Regards,
Thierry

On Mon, Sep 12, 2022 at 3:03 PM 'Brian Osman' via skia-discuss <skia-d...@googlegroups.com> wrote:
You received this message because you are subscribed to a topic in the Google Groups "skia-discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/skia-discuss/UC3Cf80c4nw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to skia-discuss...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/skia-discuss/CAMcBjo6acrhLQoVeyPw19SKWXBMLXYBYo6iKuGMuipgGsk6BpQ%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages