size property

Font.size property

Gets or sets the font size in points.

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

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

Examples

Shows how to insert formatted text using DocumentBuilder.

doc = aw.Document()
builder = aw.DocumentBuilder(doc)
# Specify font formatting, then add text.
font = builder.font
font.size = 16
font.bold = True
font.color = aspose.pydrawing.Color.blue
font.name = 'Courier New'
font.underline = aw.Underline.DASH
builder.write('Hello world!')

Shows how to format a run of text using its font property.

doc = aw.Document()
run = aw.Run(doc=doc, text='Hello world!')
font = run.font
font.name = 'Courier New'
font.size = 36
font.highlight_color = aspose.pydrawing.Color.yellow
doc.first_section.body.first_paragraph.append_child(run)
doc.save(file_name=ARTIFACTS_DIR + 'Font.CreateFormattedRun.docx')

See Also