Skip to content
P4 Software P4 Software / BarcoderX English

Add these docs to Claude

Ask Claude questions about these docs. Claude reads the published pages and links you back to them. Copy this address:

https://p4-software.opendocs.page/mcp

In claude.ai or Claude Desktop: open Settings, then Connectors, choose Add custom connector and paste the address.

In Claude Code, run:

claude mcp add --transport http docs https://p4-software.opendocs.page/mcp

Text on a label

Text on a label

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.

What a text element looks like

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" }

The built-in typeface

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.

  • Covered now: the letters, digits and punctuation of Basic Latin, the no-break space, the inverted exclamation mark and question mark, and the Spanish accented letters Á É Í Ó Ú Ü Ñ á é í ó ú ü ñ. That is 112 characters in each style, plus the mark for a missing character.
  • Not covered yet: the other Western European letters, such as à, ç and ö, the euro sign and the degree sign. They are planned. Kerning (adjusting the space between certain pairs of letters) and a zero with a slash are planned too.
  • All digits have the same width, so numbers line up in a column.
  • Bold is a real bold face, not a thickened regular one.
  • A character that the font does not have is drawn as an empty box, and BarcoderX reports it once for the text (BX3400). It names the font and gives an example character.
  • If the font that you ask for is not available, BarcoderX uses another one and says which (BX3405). If the font has no bold or italic face, it uses a face without that style and says so (BX3406).

BarcoderX never uses the fonts installed on the computer. Using fonts that you upload, next to BX Core, is planned.

Lines

  • Line breaks. A line breaks after a space, and wherever the text has a line break. A line break can be a line feed, a carriage return plus a line feed, or a lone carriage return.
  • Spaces at the end of a line do not count toward its width.
  • A long word is never cut. A word that is wider than the box stays whole and sticks out of the box, and BarcoderX warns you (BX3409). Widen the box, use a smaller size, or use shrink to fit.
  • Breaking inside a word, and the full Unicode rules for where a line may break, are planned. Today only spaces and line breaks end a line.

Alignment

MemberValuesMeaning
alignstart, center, endWhere 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.
valigntop, middle, bottomWhere 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).

Size, spacing and shrink to fit

  • 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.
    • With none, the text keeps the size that you set. It can be larger than the box.
    • With 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.
    • The values 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.

Limits

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.

LimitValueWhen it is passed
Characters in one text50,000The rest is dropped (BX3401).
Lines in one block2,000The lines after that are left out (BX3402).
Segments in the outline of one text1,000,000The characters at the end are not drawn (BX3404).
Outline points of the letters, added up for one text1,000,000The characters at the end are not drawn (BX3413).
Work for laying out one text25,000,000 stepsNo text is drawn (BX3411).
Side of the box262,144 dotsThe setting is refused and no text is drawn (BX3408).
Distance of the text from the boxThe area that can be drawnText 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.

Not supported yet

  • Text that reads from right to left, such as Arabic and Hebrew, and text that mixes directions. They are planned.
  • Justified text, and kerning.
  • Italic. A plain upright face is used, with a warning (BX3406).
  • Underline, strikeout, a background color and a border around the text.
  • Styled text, such as HTML or RTF.
  • Shaping for scripts that need it, such as joining forms, ligatures and accents that are put together from parts. Today each character has one shape from the font's character map.
  • A chain of fallback fonts for a character that the font lacks.
  • Text along an arc.

Notes for developers who host BarcoderX

  • The values in a text diagnostic can include a font family that came from a template. BarcoderX cuts them to 128 characters and replaces control characters and direction characters, but a page must still insert them as text, never as markup, and a log must neutralize carriage returns and line feeds.
  • The words 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?