airbnb / lottie-web

Render After Effects animations natively on Web, Android and iOS, and React Native. http://airbnb.io/lottie/
MIT License
30.42k stars 2.86k forks source link

Question: How to replace font in text layer #2913

Open VitalySlidely opened 1 year ago

VitalySlidely commented 1 year ago

Hi guys! Does anybody know, how to replace the font for the text layer using updateDocumentData? Or maybe Lottie API should be used instead? I've tried to update the font like this:

anim.renderer.elements[5].updateDocumentData({ f: 'Roboto', t: '1234324' }, 0)

The text gets changed but the font doesn't.

VitalySlidely commented 1 year ago

I've found that the font can be changed only if it exists in the animationData.fonts.list. @bodymovin, is there any chance to add the font to that list dynamically? Maybe using the fontManager somehow?

anim.renderer.globalData.fontManager.addFonts

?

kundokun commented 1 year ago

did you fin it? thank you!

VitalySlidely commented 1 year ago

@kundokun nope, unfortunately