NodeBox

Create visual output with Python programming code
Home Download Reference Tutorial Library Gallery About

tx.spacing()

Syntax

spacing(x=0.0, y=0.2)

Description

Sets text spacing for a paragraph(), with x defining the percentual letter spacing, and y defining the perceptual line spacing. These percentages are based on the current font size.

When using spacing() in combination with nudge(), letter spacing and line spacing grows larger according to if characters are farther away from the center().

Example

font("Dolly-Bold", 11)
import tx
string = "A very normal looking paragraph... on the surface..."
tx.spacing(-0.1, -0.2)
tx.paragraph(string, 10, 20, 80)