text¶
Text and LaTeX, rendered as packed batches of bezier glyphs.
Tex compiles LaTeX through Algan’s bundled Manim, converts the resulting
glyph outlines to cubic bezier circuits, and packs every glyph of the string into
a single batched Mob. Text is the same machinery with Pango font
rendering instead of LaTeX, and MarkupText accepts Pango markup.
Because the glyphs are outlines rather than bitmaps, text scales without softening and morphs into other shapes like any 2-D Mob.
character_mobs gives lazy indexed views onto individual glyphs in the packed
batch, which is what per-character animation works on. A multi-part Tex
also exposes each of its source strings through
Tex.get_segment() – these are views, not children, which hold the
single packed batch. Tex.write() draws the string as though by hand.
The Triangulated variants build filled triangle meshes instead of bezier
circuits, for cases where a fragment-shaded interior is wanted.
make_manim_dir() prepares Manim’s Tex/text scratch directories inside
Algan’s cache so nothing is written beside the user’s script.
See Text and Mathematics.
Classes
Source-code display with Manim 0.20.1 constructor names. |
|
Plain text from a Pango-markup source, with the markup stripped out. |
|
A group of individually addressable text lines. |
|
LaTeX compiled to one packed batch of cubic bezier glyphs. |
|
LaTeX text rendered as one packed batch of triangulated glyphs. |
|
Plain (non-LaTeX) text, rendered as one packed batch of cubic bezier glyphs. |
|
Triangulated plain text; accepts the same arguments as |
Functions
- make_manim_dir()[source]¶
Create manim’s tex/text output directories if they don’t exist yet.
Touching
mn.configloads manim, and with italgan.utils.manim_svg_cache. The paths are resolved again here so a runtime change toSETTINGS.paths.cache_directoryis honored and Manim never creates its defaultmediatree beside the user’s script.Called lazily on first
Texconstruction (manim errors if they are missing) rather than atimport algantime, so importing the package doesn’t write to disk.