spacing property

Font.spacing property

Returns or sets the spacing (in points) between characters .

@property
def spacing(self) -> float:
    ...

@spacing.setter
def spacing(self, value: float):
    ...

Examples

Shows how to set horizontal scaling and spacing for characters.

doc = aw.Document()
builder = aw.DocumentBuilder(doc)
# Add run of text and increase character width to 150%.
builder.font.scaling = 150
builder.writeln('Wide characters')
# Add run of text and add 1pt of extra horizontal spacing between each character.
builder.font.spacing = 1
builder.writeln('Expanded by 1pt')
# Add run of text and bring characters closer together by 1pt.
builder.font.spacing = -1
builder.writeln('Condensed by 1pt')
doc.save(file_name=ARTIFACTS_DIR + 'Font.ScalingSpacing.docx')

See Also