File indexing completed on 2025-01-19 04:00:01

0001 #!/usr/bin/env python3
0002 import sys
0003 import os
0004 sys.path.insert(0, os.path.join(
0005     os.path.dirname(os.path.dirname(os.path.abspath(__file__))),
0006     "lib"
0007 ))
0008 from lottie.utils import script
0009 from lottie import objects
0010 from lottie import Color, Point
0011 from lottie.utils.font import FontStyle
0012 
0013 
0014 an = objects.Animation(120)
0015 layer = objects.ShapeLayer()
0016 an.add_layer(layer)
0017 
0018 # The font name "Ubuntu" here, can be detected among the system fonts if fontconfig is available
0019 # Otherwise you can use the full path to the font file
0020 # `emoji_svg` needs to point to a directory with the supported emoji as svg
0021 style = FontStyle("Ubuntu", 128, emoji_svg="twemoji/assets/svg/")
0022 t = layer.add_shape(style.render("Hello\nWorld\nF\U0001F600O\nE🇪🇺U"))
0023 t.transform.position.value.y += t.line_height
0024 layer.add_shape(objects.Fill(Color(0, 0, 0)))
0025 layer.add_shape(objects.Stroke(Color(1, 1, 1), 2))
0026 
0027 script.script_main(an)
0028