P4 Software
/
BarcoderX English
Applies to: BarcoderX Basic and Ultimate
Status: Built, not yet released, for text that reads from left to right. The text layout and the built-in typeface exist inside the engine that is still being built, and they are tested. There is no released package, there is no public interface that you can call to lay out text directly, and the licensed engine will be the only public way to produce output. This page describes what the layout does. Everything marked "planned" is not usable yet.
This page is about how BarcoderX puts text in the box of a text element. For the font files themselves, see Font support. For the wider plan for text, see Text, fonts and pictures.
BarcoderX lays text out and draws it itself. It does not use the fonts or the text functions of the operating system, so the same template gives the same letters on Windows x64, Linux x64 and Linux arm64.
This is one element of a template, not a whole template. See The label template format.
{ "type": "text", "id": "title", "x": 4, "y": 4, "width": 60, "height": 10,
"content": { "text": "Envío" },
"font": { "family": "BX Core", "size": 14, "bold": true },
"align": "center", "valign": "middle", "sizing": "shrinkToFit" }
Today BarcoderX has one typeface, BX Core, in Regular and Bold. It was drawn for BarcoderX. It is plain and light, and it is made to stay readable on a 203 dpi thermal printer from 6 points. At the smallest sizes the thin strokes can look uneven on a screen, so prefer 8 points and up for a preview.
BarcoderX never uses the fonts installed on the computer. Using fonts that you upload, next to BX Core, is planned.
| Member | Values | Meaning |
|---|---|---|
align | start, center, end | Where each line sits across the box. For text that reads from left to right, start is the left edge and end is the right edge. |
valign | top, middle, bottom | Where the block of lines sits between the top and the bottom of the box. |
The value justify exists in the format, but it is planned. A text that asks for it is laid out as start, with a warning (BX3403).
font.size is in points, whatever the page unit is, and can be up to 1,000.lineSpacing is a multiplier of the normal line height. The default is 1. It must be more than 0 and at most 100.charSpacing adds space between letters, in points, from -100 to 1,000. The default is 0.sizing is none or shrinkToFit.
none, the text keeps the size that you set. It can be larger than the box.shrinkToFit, BarcoderX makes the text smaller, never larger, until every line is no wider than the box and the block is no taller than the box. It works in steps of 1/64 of a point and never goes below 1/4 of a point. When the size changes, an information message (BX3412) gives the size you asked for and the size used. If the text still does not fit at the smallest size, BarcoderX warns you (BX3410). Setting your own smallest size is planned.stretch and scale exist in the format, but they are planned and not built yet.Letters are placed on whole printer dots. At small sizes on a 203 dpi printer, the space between letters can therefore look a little uneven.
The first five numbers below are first choices that the builders made. They have not been confirmed yet and can change before the first release. The side of the box and the area that can be drawn are fixed by the design of the drawing engine. A text that goes past a limit is cut and reported, or refused, and BarcoderX never runs without a bound.
| Limit | Value | When it is passed |
|---|---|---|
| Characters in one text | 50,000 | The rest is dropped (BX3401). |
| Lines in one block | 2,000 | The lines after that are left out (BX3402). |
| Segments in the outline of one text | 1,000,000 | The characters at the end are not drawn (BX3404). |
| Outline points of the letters, added up for one text | 1,000,000 | The characters at the end are not drawn (BX3413). |
| Work for laying out one text | 25,000,000 steps | No text is drawn (BX3411). |
| Side of the box | 262,144 dots | The setting is refused and no text is drawn (BX3408). |
| Distance of the text from the box | The area that can be drawn | Text that reaches far beyond it, for example through a huge size or spacing, is refused and no text is drawn (BX3414). |
With some fonts, the limit on outline points is reached before the limit on segments, so BX3413 can appear where you expect BX3404.
bold and italic in the message about a missing style (BX3406), and the setting names in BX3408, are English words that are not translated yet.See Diagnostic codes for the text of each code in English and Spanish.
BarcoderX is a product of P4 Software.
Was this page helpful?