PdfFontManagerCreateRegisteredFont(String, Single, PdfFontStyle, PdfColor, Boolean, IListInt32) Method

Creates a font from a registered font name or alias

Definition

Namespace: HiQPdf.Next
Assembly: HiQPdf.Next (in HiQPdf.Next.dll) Version: 18.9.2
C#
public static PdfFont CreateRegisteredFont(
	string fontNameOrAlias,
	float fontSize,
	PdfFontStyle style,
	PdfColor color,
	bool subset = true,
	IList<int[]> unicodeRanges = null
)

Parameters

fontNameOrAlias  String
The name or alias under which the font was registered. Accepted values are: a family name (e.g. "Arial", "Calibri") combined with style to automatically select the correct variant (regular, bold, italic, bold italic), a full font name (e.g. "Arial Bold", "Calibri Light") or a custom alias registered via RegisterFont(String, String) - in these cases pass Normal for style to avoid artificial bold or italic being applied on top of the selected font. Use GetRegisteredFamilies to list available family names and GetRegisteredFonts to list available full names
fontSize  Single
Font size in points
style  PdfFontStyle
Font style flags
color  PdfColor
Font color
subset  Boolean  (Optional)
to write only the glyphs used in the document; to embed the full font (required for editable form fields)
unicodeRanges  IListInt32  (Optional)
Optional Unicode ranges to include in the ToUnicode CMap of the embedded font, specified as pairs of [start, end] codepoint values (e.g. new[] { new[] { 0x0020, 0x007F } } for Basic Latin). Only applicable when subset is . If null, all Unicode ranges supported by the font are included

Return Value

PdfFont
A font instance for text rendering

See Also