Word Wrapping
In order to adapt easily between output devices with different paper sizes, printable areas, resolutions and font sizes, Star markup will automatically perform word wrapping when outputting a document. THis is different to typical printer behavior, which is to perform character based wrapping only, frequently truncating words.
Using word wrapping allows developers to manage the content of a document, without needing to manage the layout per device.
Results
The following text is used as test data. For demonstration purposes, use the tabs below to view the output when this is sent to a printer as plain text, or as markup to printers with various paper widths installed.
This is a test of word wrapping when targeting point of sale printers of varying size, and print widths. Star Markup language makes this easy to manage automatically.
This is the result when sent as plain text directly to an mC-Print2 58mm(2inch) printer, without using the Star markup system.
Mixing Fonts and Magnification
When Star markup documents are rendered into the printers native commands, font sizes and magnification are tracked by the engine. This makes it completely safe to mix different fonts, and character magnifications on a single line, while preserving word wrapping.
Word Wrapping and Spacing
Word wrapping of markup documents is performed in a similar way to HTML, each word is identified as a sequence of printable characters, separated by white space (such as a series of spaces). The spaces are treated only as word separators, and not as content. Therefore, it is not possible to put multiple spaces between words, or use space characters to perform formatting (such as column layout) as is commonly done by traditional POS software.
This design is intentional, as documents that rely on spacing to generate layout, can not be reformatted automatically to devices with different print widths, character sizes etc. Instead, the Star markup system provides alternative methods to achieve commonly needed layout designs in ways that can more easily adapt to different form factors.
If it is necessary to output a specific number of space characters, then this can still be done either by escaping the space character, or using the [space]
markup command.