Using Fonts
Native Printer Fonts (NPF)
The NPF is an abstraction on the complexity of dealing with different built-in printer fonts when printing simple text on labels while targeting many kinds of printers e.g. ZPL, EPL and Fingerprint printers. The NPF provides you three fonts called NativePrinterFontA, NativePrinterFontB and NativePrinterFontS.
Basically, each of these fonts are provided by our SDK as TrueType (*.ttf) font files which need to be installed on the client machine where the SDK is being used. The TrueType fonts are used by our SDK when exporting labels to PDF documents or image files and by the ThermalLabelEditor component for displaying such font on items using the NPF. For printing process, the NPF TrueType files are not used but the built-in ZPL/EPL/Fingerprint resident fonts that are internally associated to each NPF.
Note
NPF has some limitations when comparing it to non-built in fonts, but you should use NPF whenever possible to boost the printing performance. If your text does not require any special formatting, then use a NPF for printing it.
The following table provides some info about the features that each of the NPF does support.
FEATURE | NativePrinterFontA | NativePrinterFontB | NativePrinterFontS |
---|---|---|---|
Font Type | Monospaced | Scalable for ZPL & Fingerprint, Monospaced for EPL | Monospaced |
Fixed Sizes (in pts) | 5pt, 10pt, 15pt, 20pt, and 25pt | 7pt, 14pt, 21pt, 28pt, and 35pt | 3pt (Only this size is allowed. Intended to be used with very small text) |
Font Style | Normal | Bold | Normal |
Characters Set | All ASCII chars from 32 to 124 excluding the following chars: 92, 94 & 123 | All ASCII chars from 32 to 124 excluding the following chars: 92, 94 & 123 | ASCII chars from 65 to 90 (upper-case letters) and from 48 to 57 (digits) |
Unicode Support | NO | NO | NO |
Text Stretching | NO | NO | NO |
Rotation | 0, 90, 180 & 270 degrees only | 0, 90, 180 & 270 degrees only | 0, 90, 180 & 270 degrees only |
Rounded Borders | NO | NO | NO |
Multi-line Text | NO | NO | NO |
TrueType file matching | NativePrinterFontA.ttf glyphs are almost a perfect match to ZPL/EPL/Fingerprint font glyphs. | NativePrinterFontB.ttf glyphs are almost a perfect match to the ZPL and Fingerprint font glyphs. For EPL printers, the font is very different and you should try it before going forward. | NativePrinterFontS.ttf glyphs are almost a perfect match to ZPL/EPL/Fingerprint font glyphs. |
Char Glyph Appearance | ![]() |
![]() |
![]() |
Screen/File Rendering vs. Printing Output
When using any of the NPF, you should be aware of the following regarding what you will get on screen or file and what you will get when printing:
- NativePrinterFontA
- The NativePrinterFontA.ttf file features almost identical characters' glyph that matches the same built-in fonts of ZPL, EPL and Fingerprint. This TrueType font will be used when you export/save a label to PDF documents or Image files.
- When printing, the built-in fonts of ZPL, EPL and Fingerprint will produce almost identical outputs if using 203 dpi printers. For EPL, the outputs at 300 or 600 dpi will be identical to the output at 203 dpi. But for ZPL and Fingerprint, the outputs at 300 or 600 dpi will differ a bit from the output you get at 203 dpi. For ZPL printers at 300 or 600 dpi, you will notice that the font used in those printers features characters glyph which look a bit thinner (in their strokes) than the one used at 203 dpi. However, in ALL cases, the height and width of the characters will be very close.
- NativePrinterFontB
- The NativePrinterFontB.ttf file features almost identical characters' glyph that matches the same built-in font of ZPL and Fingerprint printers only. The built-in font used in EPL printers, features characters glyph that are very different from the one we did choose for ZPL. This TrueType font will be used when you export/save a label to PDF documents or Image files.
- This NPF can be considered the "Bold" version. Problem is that in ZPL and Fingerprint, the font we did choose is "Scalable" while the one used for EPL is "Bitmapped". When printing, the outputs produced by both built-in fonts of ZPL and EPL are VERY different because their nature i.e. Scalable vs. Bitmapped. What we've tried here was to match both fonts in their characters height. So, if you want or need to use a "bold" native printer font, then this is the correct one. If you are targeting just ZPL printers, then you will not have any problems at all. However, if you need to target EPL or both (EPL & ZPL), then we encourage you to make some test before going forward with this NPF. Remember that on screen or file rendering, the NativePrinterFontB.ttf TrueType file matches the ZPL built-in font NOT the EPL one.
- NativePrinterFontS
- The NativePrinterFontS.ttf file features almost identical characters' glyph that matches the same built-in fonts of ZPL, EPL and Fingerprint. This TrueType font will be used when you export/save a label to PDF documents or Image files.
- When printing, the built-in fonts of ZPL, EPL and Fingerprint will produce almost identical outputs.
ZPL Font 0
"ZPL Font 0" is a font that is shipped with any ZPL printer and with a different name for Fingerprint printers. It's a scalable type font that will improve printing performance. It also support multiline text as well as alignments. This font is provided by our SDK as a TrueType (*.ttf) font file which need to be installed on the client machine where the SDK is being used. The TrueType font is used by our SDK when exporting labels to PDF documents or image files and by the ThermalLabelEditor component for displaying such font on items using the ZPL Font 0. However, for printing process, the TrueType file is not used as our SDK uses the built-in ZPL or Fingerprint resident fonts.
Note
In EPL printers, if "ZPL Font 0" is used, then the text will be rendered as graphics commands.
Installed Windows TTF Fonts
Any TrueType font installed in the client can be used with the Font
class on Neodynamic.SDK.Printing.TextItem and Neodynamic.SDK.Printing.BarcodeItem objects. With these kinds of fonts you can use all the rich text features available like full Unicode support, RTL languages, text stretching, text alignments, etc.
Custom TTF Font files i.e. Non-installed fonts
The custom TTF approach has the same text features as the Installed Windows TTF fonts but do not require you install the TTF on the client system. Instead, you can deploy the TTF file with your application and use the font's path file or set the Base64 binary content to the Font.CustomFontFile
subproperty. It is useful if you want to use dingbats fonts which you do not want to install on the client machine before using them.
TTF Optimization on ZPL and Fingerprint Printers
When using a TTF font, at rendering time, the text items using them will be converted to ZPL, EPL or Fingerprint graphics commands. If you're targeting ZPL or Fingerprint printers, then you can upload those TTF files right to the printer's internal storage by assigning to them a name or identificator. ZPL printers allow you to set up font names up to 8 alphanumeric chars. By using our Neodynamic.SDK.Printing.PrintUtils class to upload any TTF file to the printer right from your own application. Look at the Visual Label Editor sample app which uses this feature.
The basic steps for using this feature are the following:
- Upload the TTF file to the printer and set a short name for it
- Set it to the
Font
property of TextItem objects. Then set theFont.Name
subproperty to the TTF font and set theFont.NameAtPrinterStorage
subproperty to the short name
Built-in Printer fonts
Each printer type (ZPL, EPL and Fingerprint) is configured by default with a set of built-in fonts. Depending on the printer type you-re targeting, you could take advantages of the following built-in font support shipped with our SDK:
- For ZPL, our SDK supports ZPL Font 0 (based on CG Triumvirate Condensed Bold font) as well as Swiss 721 BT
- For Fingerprint, our SDK supports ZPL Font 0 (based on CG Triumvirate Condensed Bold font) as well as Swiss 721 BT, Andale Mono, CG Times, Century Schoolbook BT, Dutch 801 Roman BT, Futura Light BT, and Monospace 821 BT
- For EPL there's no additional built-in font support other than the one provided by our Native Printer Fonts abstraction.