Text, fonts and pictures
Applies to: BarcoderX Basic and Ultimate
Status: Planned. Nothing is released yet and there is nothing to download. This page describes what BarcoderX plans for text, fonts, shapes and pictures. Some capabilities arrive after the first release, and the page says so. Three parts are already built but not released: Font support, Drawing shapes and PNG output.
BarcoderX draws text, shapes and pictures itself, with its own drawing engine. It does not use the text or drawing functions of the operating system. A label therefore looks the same on Windows x64, Linux x64 and Linux arm64.
Fonts
Where fonts come from
Fonts come from two places only:
- The built-in font family. One family, drawn for BarcoderX, in regular and bold. It covers Basic Latin, the Latin-1 Supplement and Latin Extended-A, which is enough for English and Spanish, and it has the digits and symbols that barcode text needs. It is plain and easy to read at 203 dpi from 6 points. It is not a replacement for a professionally designed family. It is also the default font, the font of last resort, and the substitute shown in previews for fonts that live inside a printer. The OCR-A and OCR-B faces are planned for this family for later, subject to review.
- Fonts you upload. You upload the fonts that you hold a license for.
BarcoderX never uses the fonts installed on the computer, so a label made from the same template looks the same on every machine. For now it also bundles no third-party font, not even a font with an open license. This stays until it is decided whether to license or commission a default family.
Uploading fonts
- BarcoderX accepts TrueType and OpenType fonts that have TrueType outlines.
- When you upload a font, you confirm that you hold its license. BarcoderX records who confirmed it, when, and a fingerprint of the font file.
- A font is limited to 10 MB, and an image to 5 MB.
- On your server, an operator can name a folder of fonts. BarcoderX registers the fonts in it, with one license confirmation recorded for the folder and the fingerprint of every font. A font added to the folder later is not used until the confirmation covers it. Folders of system fonts are refused.
- Every font is checked before it is used, and again when it is first used. A font that fails the check cannot be used, and you are told why. The checks are built; Font support lists what is accepted and rejected.
- A font that arrives in a template archive needs a new license confirmation.
What is not supported
- Fonts with CFF outlines are not accepted yet. They are planned for after the first release.
- WOFF and WOFF2 files, and color, SVG and bitmap-only fonts, are not supported.
- A variable font is used at its default style, and you are told.
Text
- Scripts. BarcoderX shapes Latin, Greek and Cyrillic text. It also shapes Hebrew and Arabic, with joining forms, ligatures and mark positioning, and lays out text in both directions. Chinese, Japanese and Korean text shows without complex shaping, with a font that has the characters. Text in scripts that need more, such as Devanagari and other Indic scripts, shows with basic letter shapes and a warning that names the script. Full support for those scripts is planned for later.
- Standards. Bidirectional layout and line breaking follow the Unicode rules. BarcoderX uses one fixed version of Unicode, 18.0.0, and tests against the test data that Unicode publishes. The section "The Unicode version" below has the details.
- Fallback fonts. If a font lacks a letter, BarcoderX tries the next font in the chain: the element's font, the design's font, then the default font. This is decided for each run of text. If no font has the letter, the missing-glyph box is drawn and a warning appears.
- Layout. Several lines, alignment to the start, center or end or justified, vertical alignment, and line and character spacing.
- Sizing. Text can keep its size, shrink to fit its box, stretch to fill its box, or scale to fill its box in proportion. Shrink to fit reduces the font size until the text fits, and never goes below a minimum size that you set. If the text still does not fit at that size, BarcoderX warns you.
- Overflow. Text that does not fit is clipped by default. It can instead grow the box, but never beyond the page edge, or continue in the same box on the next label of the job.
- Styles. Bold and italic, with a synthetic style and a warning when the font has no such face, underline, strikeout, text and background colors (such as white on black), border, rounded corners, padding, rotation, text along an arc, an outline around letters, a slashed zero, and one letter per line, upright.
- Styled text. A subset of HTML, a subset of RTF and BBCode, all read by BarcoderX itself. Links to outside resources are ignored.
- Rules for entered text. A text element can have a maximum length, pattern rules that raise a diagnostic when they fail, and an edit mask that guides typing in the editor.
- Printer fonts. An element can ask for a font that lives in the printer. See Printer languages.
The Unicode version
BarcoderX follows Unicode 18.0.0, the newest final release of the standard when the choice was made. One fixed version means the same text is laid out the same way on every computer and in every release, until BarcoderX deliberately moves to a newer version. A move is a separate, tested change.
What is built today:
- The Unicode data files for version 18.0.0, and the test files that Unicode publishes for bidirectional text and line breaking, are part of the build. A tool checks every file against its recorded size and fingerprint, and the check runs on every change on Windows x64, Linux x64 and Linux arm64.
What is planned, and not built yet:
- Right-to-left and mixed-direction text (the bidirectional rules), and line breaking (where a line may end), written by BarcoderX itself. Both are to pass 100% of the test files that Unicode publishes for version 18.0.0.
- The character properties that these rules need, such as a character's direction and script, will come from BarcoderX's own tables built from these files. They will not come from .NET, whose built-in Unicode data can be older than version 18.0.0.
Lines, boxes, ellipses and grids
- A line has a width, a color and an optional dash pattern.
- A box has a border, a fill and rounded corners. Text, barcode and picture elements can have the same border on each side and a radius on each corner.
- An ellipse has a border and a fill.
- A grid has rows and columns of your sizes, borders and merged cells.
On a black-and-white printer, barcodes and shapes are drawn directly on the printer's dot grid. They are never smoothed or dithered, so their edges are crisp. The first part of the drawing engine is built, and Drawing shapes describes it.
Pictures
- Formats you can use: PNG, JPEG (including progressive JPEG), GIF (first frame only) and BMP. SVG pictures are refused.
- Fitting: none, fit, fill or stretch, with the aspect ratio locked if you want, and flipping and rotation.
- Black and white conversion. For printers that print in black and white, BarcoderX converts a picture itself and always gets the same result. The modes are a fixed threshold (128 unless you change it), an automatic threshold, Floyd-Steinberg dithering and reversed black and white.
- Natural size. A picture uses the resolution stored in its file to find its natural size. If the file has none, BarcoderX assumes 96 dpi, and you can change that.
- Missing pictures. You choose what happens: nothing, an error or a placeholder.
- Uploads are checked. BarcoderX checks that the content of the file matches its type, checks the size before it decodes the picture, removes the metadata, and stores the picture as a plain PNG. A file that is a decompression bomb or that pretends to be another type is refused.
- On a thermal printer, a picture is sent as a black and white graphic that is pixel for pixel the same as the preview.
What is not planned
- Fonts installed on the computer, and bundled third-party fonts.
- Gradients, blur, shadows and other effects. Paint is solid color, with transparency.
- Importing SVG or PDF as label content.
- Vertical text layout, WOFF fonts, and color management.
BarcoderX is a product of P4 Software.