Font#
- class Font(impl)#
The font object can be accessed as an attribute of the range or shape object.
mysheet['A1'].font
mysheet.shapes[0].font
在 0.23.0 版本加入.
- property api#
返回正在使用的引擎的原生对象(
pywin32
或appscript
对象)。在 0.23.0 版本加入.
- property bold#
Returns or sets the bold property (boolean).
>>> sheet['A1'].font.bold = True >>> sheet['A1'].font.bold True
在 0.23.0 版本加入.
- property color#
Returns or sets the color property (tuple).
>>> sheet['A1'].font.color = (255, 0, 0) # or '#ff0000' >>> sheet['A1'].font.color (255, 0, 0)
在 0.23.0 版本加入.
- property italic#
Returns or sets the italic property (boolean).
>>> sheet['A1'].font.italic = True >>> sheet['A1'].font.italic True
在 0.23.0 版本加入.
- property name#
Returns or sets the name of the font (str).
>>> sheet['A1'].font.name = 'Calibri' >>> sheet['A1'].font.name Calibri
在 0.23.0 版本加入.
- property size#
Returns or sets the size (float).
>>> sheet['A1'].font.size = 13 >>> sheet['A1'].font.size 13
在 0.23.0 版本加入.