small_caps property

Font.small_caps property

True if the font is formatted as small capital letters.

@property
def small_caps(self) -> bool:
    ...

@small_caps.setter
def small_caps(self, value: bool):
    ...

Examples

Shows how to format a run to display its contents in capitals.

doc = aw.Document()
para = doc.get_child(aw.NodeType.PARAGRAPH, 0, True).as_paragraph()

# There are two ways of getting a run to display its lowercase text in uppercase without changing the contents.
# 1 -  Set the "all_caps" flag to display all characters in regular capitals:
run = aw.Run(doc, "all capitals")
run.font.all_caps = True
para.append_child(run)

para = para.parent_node.append_child(aw.Paragraph(doc)).as_paragraph()

# 2 -  Set the "small_caps" flag to display all characters in small capitals:
# If a character is lower case, it will appear in its upper case form
# but will have the same height as the lower case (the font's x-height).
# Characters that were in upper case originally will look the same.
run = aw.Run(doc, "Small Capitals")
run.font.small_caps = True
para.append_child(run)

doc.save(ARTIFACTS_DIR + "Font.caps.docx")

See Also