question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TextLayers don't combine unicode combining characters

See original GitHub issue

Checklist

  • 1. My animation doesn’t use any unsupported features.
  • 2. I know what part of my animation doesn’t work.
  • 3. I have created a simplified version of my animation
  • 4. I have attached the AEP file - You can use this one from a similar bug. I think the json file is invalid so you’ll need to re-export and set the FontAssetDelegate to something which returns Typeface.DEFAULT.

Describe the bug Text which uses unicode combining characters (notably Hindi) is rendered character-by-character, ignoring the need for combining characters to be rendered as one.

Combining characters (i.e. diacritics) are unicode characters representing a modification to a previous character. For example: ‘​း’ is a diacritic which can be added to ‘ဆီ’ to make ‘ဆီး’.

In Lottie android it’s rendered as ‘ဆီ​း’ (the circle denotes a missing previous character for the diacritic) which is invalid Hindi.

I believe this is caused by the text being split into individual characters, then canvas.drawText() is called on each individual character, ignoring the need for combining characters to remain with their preceding characters.

It seems Lottie for web had a similar issue: https://github.com/airbnb/lottie-web/issues/1603 but their fix just handled the hindi characters, it’s probably best to support all combining characters.

What version of Lottie did you test this on?

3.0.1 (but this is still an issue at head)

What version of Android did you test this on?

Q and P

Steps To Reproduce Steps to reproduce the behavior:

  1. Render the animation (set the FontAssetDelegate to something which always returns Typeface.DEFAULT)
  2. See the error

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:9

github_iconTop GitHub Comments

1reaction
gpealcommented, Feb 21, 2022

@mmdumi Today! I published 5.0 this morning. Blog post coming soon.

0reactions
mmdumicommented, Feb 21, 2022

Do you know when we should expect a release version for this issue ?

Read more comments on GitHub >

github_iconTop Results From Across the Web

FAQ - Characters and Combining Marks - Unicode
No, this is a common misperception. A text element just means any sequence of characters that are treated as a unit by some...
Read more >
Combining character - Wikipedia
In digital typography, combining characters are characters that are intended to modify other characters. The most common combining characters in the Latin ...
Read more >
Is there a way to get pdflatex to accept Unicode combining ...
yes but you can't go back, you can in simple case write a macro that parses the entire text stream re-ordering tokens when...
Read more >
Unicode characters aren't combined properly - Stack Overflow
I am working with some Devanagari text data I want to display in the browser. Unfortunately, there's one combination of nonspacing combining ......
Read more >
Hide dotted circle when using a combining character - English
LibreOffice displays the combined characters correctly with a font like DejaVu Sans Mono ... A Unicode combining mark combines with a preceding character....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found