Fonts and accents
Fonts and accents: how text gets onto a thermal label
A thermal printer prints dots, so every letter on a label is either drawn by the printer from a font it holds or sent to it as dots. Which of the two happens, and which character set the printer reads, decides whether ñ, á and ü come out right. This page explains the path, says what BarcoderX does about fonts and links to the ZPL commands involved.
The font family BarcoderX ships
BarcoderX ships one in-house font family covering Basic Latin, Latin-1 and Latin Extended-A, which includes Spanish accents and punctuation. You can upload your own fonts, with a license attestation recorded for each.
Why this matters for Spanish
Spanish uses letters that plain ASCII does not have: á é í ó ú ü ñ, their capitals, and the opening marks ¿ and ¡. They sit in the Latin-1 block of Unicode, so the shipped family has them. What can still go wrong is the bytes between your code and the printer.
| Character | Unicode | UTF-8 | 1 byte, Latin-1 |
|---|---|---|---|
| ñ | U+00F1 | C3 B1 | F1 |
| Ñ | U+00D1 | C3 91 | D1 |
| á | U+00E1 | C3 A1 | E1 |
| é | U+00E9 | C3 A9 | E9 |
| í | U+00ED | C3 AD | ED |
| ó | U+00F3 | C3 B3 | F3 |
| ú | U+00FA | C3 BA | FA |
| ü | U+00FC | C3 BC | FC |
| ¿ | U+00BF | C2 BF | BF |
| ¡ | U+00A1 | C2 A1 | A1 |
A program that writes UTF-8 sends two bytes for ñ. A printer that reads one byte per character reads them as two characters, and the label shows the wrong text.
- ñU+00F1The character in your data.
- C3 B1UTF-8The two bytes your program sends.
- ñread as code page 1252What a reader shows if it expects one byte per character.
The fix is to make the bytes and the printer's character set agree. In ZPL that is the ^CI command, set at the top of the label. The note on sending ZPL from C# says the same: the bytes you send and the printer's character set must agree, and an accidental byte order mark can garble a label. Send ZPL to a printer from C#
That is why the sample labels on this site read Ejemplo Logística S.A. and not Ejemplo Logistica: a Spanish label that drops its accents looks wrong to the person who reads it. Names carry accents on event wristbands, badges and tickets too, and the same font and character-set rules apply.
How text gets onto a thermal label
A thermal print head makes dots, each one ink or paper (1bpp). Text reaches those dots in one of two ways: the printer draws it from a font it holds, which is native printing, or the engine draws the dots itself and sends them as a graphic, which is raster. For every element the engine asks the printer's profile which is possible, and lands on one of four outcomes.
| Outcome | What happens |
|---|---|
| Native | The printer draws it with its own command. Only when the profile marks the command equal to the preview and, for barcodes, a lab scan agrees. |
| Native, approximate | Text in a printer-resident font. The preview shows a substitute, and the editor flags the element with a badge. |
| Raster | The engine draws the dots at the printer's resolution and sends them as a graphic. This is what keeps the print identical to the preview. |
| Unsupported | Neither is possible. The job is rejected with a diagnostic, instead of printing something different. |
The printer language changes how much of the text goes out natively.
| Printer language | Text |
|---|---|
| ZPL | A scalable font, with UTF-8 selectable. |
| EPL | Five fixed bitmap fonts with multipliers, code pages only. Text outside the selected code page is always raster. |
A printer profile records the printer's resolution, print width and memory, features such as UTF-8, and its resident fonts. How native and raster printing work How it works: printer commands
What BarcoderX does about fonts
- Shipped family
- One in-house family covering Basic Latin, Latin-1 and Latin Extended-A, which includes Spanish accents and punctuation.
- Your own fonts
- You can upload your own fonts, with a license attestation recorded for each. The editor's assets list them next to images.
- Not the host's fonts
- BarcoderX does not use fonts installed on the machine it runs on. The same input gives the same output on every supported platform.
- Font and text layers
- The font layer reads, validates and subsets TrueType and OpenType fonts. The text layer does shaping, bidirectional text, line breaking and paragraph layout. The packages
- PDF exports are vector, with searchable text and subset fonts embedded. Exports
- Printer fonts
- An element that will print with a printer-resident font carries a visible badge in the editor, and its preview shows a substitute.
- ECI
- In some 2D symbols, an ECI prefix declares the character set of the data, such as UTF-8, so the reader decodes accented text correctly. BarcoderX lets you set an ECI character set where the symbology allows one.
A font can only draw the characters it contains, so text outside the three blocks above needs a font that has them. If you print in another script, tell us which one.
In ZPL
These are the ZPL commands that choose a font, a size and a character set. Each page explains one command in our own words from the programming guide, and the text and fonts guide puts them together.
^A- Chooses the font, orientation, character height and width for the text field that follows. The choice applies to that one field only.
^CF- Sets the default font, character height and character width, so that ^A need not be repeated in every field.
^A@- Selects a font by its complete file name and storage drive instead of the single-character identifier that ^A uses.
^CW- Assigns a one-character identifier to a font stored in the printer, either replacing a built-in font of that identifier or adding the stored font as an extra one.
^CI- Selects the international character set or text encoding used for printing, and can remap individual character codes.
^FH- Lets the field data that follows contain hexadecimal values for characters, each introduced by a marker character, an underscore by default.
In ^CI, 0 is the power-up value, 0 to 12 are national variants of Code Page 850, 13 is Code Page 850 itself, 27 is Code Page 1252, and 28 to 30 select UTF-8 and the two UTF-16 byte orders. The Unicode values need firmware V60.14.x, V50.14.x or later. The guide recommends starting each script with ^CI. Save the file in the same encoding you select.
This is the shape of the result, abbreviated and illustrative, as on the how it works page: ^CI28 selects UTF-8, the accented text is a native command, and the barcode travels as a graphic field.
; abbreviated ^XA ^CI28 ^PW812^LL1218 ^FO32,40^A0N,36,36 ^FDEjemplo Logística S.A.^FS ^FO32,240 ^GFA,5984,5984,44, :Z64:eJz…: ^FS ^XZ
Illustrative and abbreviated. What is ZPL? explains each command.
Keep reading
Text and fonts in ZPL: size, blocks, accents How it works: from template to printed label Printing and export FAQ Glossary of label-printing terms Use cases Templates and dataNew to the printer language? Read the ZPL guides and command reference.
Sources What this page says about BarcoderX comes from its published FAQ, platform, editor, printing, glossary and how it works pages. The ZPL facts restate the text and fonts guide, which was checked against the programming guide. The code points, UTF-8 bytes and single bytes in the table are standard values, checked by encoding each character, and the code page 1252 reading of the two UTF-8 bytes was decoded the same way.
Written by BarcoderX in its own words.
ZPL and ZPL II are trademarks of Zebra Technologies Corporation. EPL is also a Zebra printer language. BarcoderX is an independent product and is not affiliated with, endorsed by or sponsored by Zebra Technologies.