lottie-web icon indicating copy to clipboard operation
lottie-web copied to clipboard

Regarding Text exports one character per <text> element #657

Open DTDK opened this issue 4 years ago • 4 comments

Hi hernan iIf I understand correctly in order to get a single string of text instead of per character I need to use a tspan pair of tags, where do I add the tspans? in the .json file?

DTDK avatar Dec 30 '20 00:12 DTDK

hi, that happens automatically when certain conditions are met. No animators and no box text.

bodymovin avatar Jan 10 '21 12:01 bodymovin

@bodymovin I think there is a regression on this on 5.9.0

I created a new text layer with no animations, and no box text, and the web player still renders it as one character per element. If I use 5.8.1, it will render as a single <tspan>

saadbruno avatar May 07 '22 14:05 saadbruno

I have the same problem, I've testes all versions and work ok but none of the versions 5.9.X. In all 5.9.X the word turns into separate characters.

Anyone found out how to fix this or what do we need to do in After Effects to be a word again?

Spo-oky avatar Sep 17 '22 19:09 Spo-oky

Still looking into this issue.

There has definitely been some changes to the code that dictates how the text should render.

Seems like this is the piece of code that will render text as a single <tspan>: https://github.com/airbnb/lottie-web/blob/14dc0cb12d17158900165fa5f7beae7d77887029/player/js/elements/svgElements/SVGTextElement.js#L113-L150

But it seems that singleShape will never evaluate to true, because the part that sets it to true is commented out:

https://github.com/airbnb/lottie-web/blob/14dc0cb12d17158900165fa5f7beae7d77887029/player/js/utils/DataManager.js#L486-L490

Seems like the commit that changed it was https://github.com/airbnb/lottie-web/commit/2af2f64c65488d1ac072fa72aeea64c79619b806

Now, I don't understand why this was changed. I'm assuming it is to add new features and bugfixes. But losing the ability to render a single tspan is really keeping me on v5.8.1

Hernan can you give us a pointer here?

saadbruno avatar Jul 27 '23 23:07 saadbruno