public sealed class FontManager
Maps ZPL font identifiers (0, A–Z, ^CW aliases, downloaded TTFs) to Skia typefaces. Zebra's resident fonts are proprietary, so embedded open fonts (DejaVu, free license) are used, which renders identically on every OS. Any font can be overridden with FontManager.RegisterFont.
Constructors
| Signature | Description |
# FontManager() | |
Properties
| Property | Type | Description |
static DefaultMono { get; } | SKTypeface | Built-in monospace font (barcode texts, EPL/ZPL bitmap font replacement). |
static DefaultSans { get; } | SKTypeface | Built-in condensed sans font (replacement of Zebra font 0). |
FontProvider { get; set; } | Func<string, byte[]> | Optional callback that supplies TrueType/OpenType data for fonts the label references but nobody registered (e.g. "E:ARIAL.TTF" in ^A@ or ^CW). Called at most once per name; return null when the font is unknown. |
Fonts { get; } | IReadOnlyCollection<string> | |
Mono { get; set; } | SKTypeface | Typeface for the bitmap fonts A–H without a registered TTF. |
Scalable { get; set; } | SKTypeface | Typeface for font 0 and other scalable fonts without a registered TTF. |
SystemFonts { get; set; } | bool | Resolve names that are neither registered, downloaded nor supplied by FontManager.FontProvider as the family name of an installed system font (e.g. "Arial", "Arial Bold", "E:ARIAL.TTF") via SKFontManager.Default. Off for plain ZPL (a printer only knows its stored fonts); on for the label model (ZplRenderSettings.UseSystemFonts). |
Methods
| Method Signature | Returns | Description |
static # Convert(byte[] ttf, string name, FontDownloadCommand command = FontDownloadCommand.DY) | string | Converts a TrueType/OpenType font file into the printer download command: ~DYd:NAME.TTF,A,T,size,,hex (FontDownloadCommand.DY) or ~DUd:NAME.TTF,size,hex (FontDownloadCommand.DU). name may include a drive ("E:ARIAL.TTF", default E:) and gets ".TTF" when it has no extension. |
# LinkFont(string baseFont, string extensionFont, bool link = true) | void | ^FL: links an extension font to a base font (used for characters missing in the base). |
# RegisterBitmapFont(string name, BitmapFont font) | void | Registers a downloaded bitmap font (~DB) under a name like "R:MYFONT.FNT". |
# RegisterFolder(string directory) | void | Registers every *.ttf/*.otf of a folder; the file name (e.g. "0.ttf", "ARIAL.TTF") is the font name. |
# RegisterFont(string name, byte[] ttf) | void | Registers a TrueType/OpenType font under a ZPL name, e.g. "0", "A", or "E:ARIAL.TTF". |
# RegisterFont(string name, SKTypeface typeface) | void | |
# RemoveFont(string name) | bool | |
# RenameFont(string name, string newName) | bool | Renames a registered TrueType font; false when name is unknown or newName exists. |