Skip to main content

Interface: TextOptions

Defined in: mobjects/text/Text.ts:15

Options for creating a Text mobject

Extended by

Properties

color?

optional color: string

Defined in: mobjects/text/Text.ts:27

Text color as CSS color string. Default: '#ffffff'


fillOpacity?

optional fillOpacity: number

Defined in: mobjects/text/Text.ts:29

Fill opacity from 0 to 1. Default: 1


fontFamily?

optional fontFamily: string

Defined in: mobjects/text/Text.ts:21

Font family. Default: 'CMU Serif, Georgia, Times New Roman, serif' (Manim-like)


fontSize?

optional fontSize: number

Defined in: mobjects/text/Text.ts:19

Font size in points. Default: 48


fontStyle?

optional fontStyle: string

Defined in: mobjects/text/Text.ts:25

Font style ('normal' | 'italic'). Default: 'normal'


fontUrl?

optional fontUrl: string

Defined in: mobjects/text/Text.ts:39

URL to a font file (OTF/TTF) for glyph vector extraction. When provided, loadGlyphs() can extract glyph outlines for stroke-draw animation.


fontWeight?

optional fontWeight: string | number

Defined in: mobjects/text/Text.ts:23

Font weight. Default: 'normal'


letterSpacing?

optional letterSpacing: number

Defined in: mobjects/text/Text.ts:35

Letter spacing in pixels. Default: 0


lineHeight?

optional lineHeight: number

Defined in: mobjects/text/Text.ts:33

Line height multiplier. Default: 1.2


strokeWidth?

optional strokeWidth: number

Defined in: mobjects/text/Text.ts:31

Stroke width for outlined text. Default: 0


text

text: string

Defined in: mobjects/text/Text.ts:17

The text content to display


textAlign?

optional textAlign: "center" | "left" | "right"

Defined in: mobjects/text/Text.ts:37

Text alignment. Default: 'center'