Skip to content

The Unicode text (such as emojis or special font text) cannot be center-aligned, even when the text justification property is set. #2592

@bubble2025

Description

@bubble2025

Describe the bug
I encountered an issue with Unicode text alignment in Lottie on Android. When I dynamically change the text to Unicode characters, such as emojis or special font text, the center alignment is lost, and the text shifts to the left. This issue does not occur on iOS or Web.

To test this issue, I used the following sample Lottie animation and modified the text by using addValueCallback to update the "Content_Text" layer.
text_center.json
Here is a screenshot of the template before the text was changed.
screenshot-1733733279482

After I change the text to a normal string, it returns to center alignment.
screenshot-1733733292362

Below are some screenshots showing the results after I dynamically changed the text to emojis and special font characters. As shown, the text shifts to the left, and when I change to a longer text, it even overflows beyond the animation bounds and gets cut off.
screenshot-1733733378578
screenshot-1733733495007

What version of Lottie did you test this on?
6.5.2

What version of Android did you test this on?
14

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions