Letters jumping in Skia text animation

vl

#1

The letters are jumping around slightly if the words in Skia renderer are rotated (probably when scaled as well). I could be entirely wrong but is this a hinting issue? Is it possible to disable hinting?

skia_letters_jumping.vl (14.1 KB)

Thanks.


#2

@tonfilm since you recommended Skia in this thread, do you have an idea?

How can other SkiaPaint properties be set, like FHintingLevel or FIsAutoHinted? Is this functionality not available yet?

A lot of the properties are null:
image


#3

hi jerry, @gregsn or @robotanton might have a better idea about that. i think the paint only contains the changed properties and gets merged with a default paint before it gets drawn.

what i remember from earlier days is that it’s good to quantize the position of the text to whole pixel coordinates. that is 0.01 units in vl.skia. the Quantize node can do that for you. also the text size should match with the pixels, which means no scaling should be applied to the letters.


#4

Hi jerry,

yes, the HintingLevel property is not exposed at the moment.
I’ve just tried different settings for this property, as stated here (https://skia.org/user/api/SkPaint_Reference#SkPaint_setHinting). None of them helps against jumping letters. So there is something else.

Best,
Anton


#5

Hi jerry,

I’ve investigated a bit in rotating the text.
I guess the solution is to draw the text on path and rotate the path.
Nothing jumps. Please check the patch attached.

Best,
Anton

skia_letters_jumping-NotJumpingOnPath.vl (17.2 KB)


#6

Thanks a lot, @robotanton. It works and I highly appreciate it.

I would call it workaround rather than solution though.


#7

this seems to be the correct way to draw rotated text with skia, just something we have to learn. for other objects transformations don’t seem to cause drawing problems. text is always a bit special. but i am amazed by the text drawing quality… did you know that whenever you look at an android phone or chrome that you look at Skia drawings? ;)


#8

Yeah, the quality is great. But it doesn’t only happen for rotations but also for scaling or translating text.

Does the Skia API suggest that?


#9

Hello,

i’ve posted our troubles to skiasharp.
It turned out there was a problem on their side, but it is fixed in the upcoming release.

Best,
Anton