Click or drag to resize
NanoXLSX

BasicStylesFont Method

Gets a style with a user defined font

Namespace: NanoXLSX.Styles
Assembly: NanoXLSX (in NanoXLSX.dll) Version: 2.6.4+e304ab0274fa680d1e83f83c8f76c3bd5a54caf2
Syntax
C#
public static Style Font(
	string fontName,
	float fontSize = 11f,
	bool isBold = false,
	bool isItalic = false
)

Parameters

fontName  String
Name of the font
fontSize  Single  (Optional)
Size of the font in points (optional; default 11)
isBold  Boolean  (Optional)
If true, the font will be bold (optional; default false)
isItalic  Boolean  (Optional)
If true, the font will be italic (optional; default false)

Return Value

Style
Style with font definition
Remarks
The font name as well as the availability of bold and italic on the font cannot be validated by NanoXLSX. The generated file may be corrupt or rendered with a fall-back font in case of an error
See Also