How to setup smooth animation for Skia Text?

skiaTextAnimating.7z (6.0 KB)

I´m trying to animate Sika/Text via nonlinear Damper or Oscilator in vertical direction. In compared to basic Skia shapes (Line, Circle) animation is not smooth at the end and is jumping. Result is the same in Skia or Stride renderer. 2021.3.3

The text layer is rendered to the nearest pixel, hence the little jumps, whereas shapes are vectors and I think they apply anti-aliasing. You could try drawing the text as a path instead:
skiaTextAnimating-Application-Draw it as a path

1 Like

Interesting! Thanks, @Hadasi With this pipeline it is possible also to reach much better character rendering quality (top is path, bottom is text). Of course this is much more performance hungry and can be used only in some scenarios.

Indeed. Try wrapping the GetTextPath and DrawPath in a cache and then use a transform(layer) to animate it.

This behavior is also strange: for some specific text size and aspect ratio, characters are rendered with aliasing artifacts.
text
patch

I guess that’s because the position of the text is not “pixel-perfect”, try translating the text in whole pixel increments.
TextTranslate.vl (29.7 KB)

@bjoern I ment “aspect ratio” o text – in fact length of the text, try to write just “Q Everything you know” and “Q Every” in your patch. It’s independent on translation.

Tried different font sizes and can’t spot any major difference between the text lengths. Maybe post your patch.

Here is the patch, I hope it can be reproduced.
skiaTextAliasing.7z (5.8 KB)

1 Like

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.