python-lottie  0.6.10+dev2509936
A framework to work with lottie files and telegram animated stickers (tgs)
text_bezier.py
1 #!/usr/bin/env python3
2 import sys
3 import os
4 sys.path.insert(0, os.path.join(
5  os.path.dirname(os.path.dirname(os.path.abspath(__file__))),
6  "lib"
7 ))
8 from lottie.utils import script
9 from lottie import objects
10 from lottie import Color, Point
11 from lottie.utils.font import FontShape
12 
13 
14 an = objects.Animation(120)
15 layer = objects.ShapeLayer()
16 an.add_layer(layer)
17 
18 # The font name "Ubuntu" here, can be detected among the system fonts if fontconfig is available
19 # Otherwise you can use the full path to the font file
20 t = layer.add_shape(FontShape("Hello\nWorld\nF\U0001F600O", "Ubuntu", 128))
21 t.refresh()
22 t.wrapped.transform.position.value.y += t.line_height
23 layer.add_shape(objects.Fill(Color(0, 0, 0)))
24 layer.add_shape(objects.Stroke(Color(1, 1, 1), 2))
25 
26 script.script_main(an)
lottie.utils.font
Definition: font.py:1
lottie.utils
Definition: __init__.py:1