zplCore.comzplCore.com

TextItem

public sealed class TextItem : LabelItem

Constructors

SignatureDescription
# TextItem()

Properties

PropertyTypeDescription
Alignment { get; set; }TextAlignment
AutoFit { get; set; }boolLegacy (schema 1): same as TextItem.Sizing = TextSizing.ShrinkToFit.
Background { get; set; }ItemColorBox fill behind the text (needs TextItem.Width).
Bold { get; set; }boolBold. Printed natively by striking the field twice, the second time offset by height / 18 (at least 1 dot) – also white text on a TextItem.Background box. Combined with TextItem.Italic, TextItem.Underline, TextItem.Strikeout, an outline, LabelItem.Reverse or white text without a black box it is rendered as graphic (^GFA) like before.
BorderCornerRounding { get; set; }intBox corner rounding 0–8 (^GB r).
BorderThickness { get; set; }doubleBox border thickness in label units (0 = none; needs TextItem.Width).
CharSpacing { get; set; }doubleExtra space between characters in label units (^FP gap).
CounterStep { get; set; }intCounter: add Index × step to the trailing number of the text (e.g. "A0001").
CounterUseLeadingZeros { get; set; }boolCounter keeps the field width with leading zeros ("A0001" → "A0002"); false drops them ("A2").
CultureName { get; set; }stringCulture for formatting bound values, e.g. "de-DE" (null = invariant culture for LabelItem.DataFieldFormat, current culture for unformatted values).
Font { get; set; }stringZPL font: "0" (scalable), "A".."H" (bitmap) or a downloaded font like "E:ARIAL.TTF".
FontSize { get; set; }doubleCharacter height in TextItem.FontUnit (points by default).
FontUnit { get; set; }FontUnit
FontWidthScale { get; set; }doubleWidth scale relative to height (1 = normal).
ForeColor { get; set; }ItemColorText colour; ItemColor.White prints white (reverse) over a black background.
FrameThickness { get; set; }FrameThicknessFrame with an individual line thickness per side (drawn instead of / in addition to TextItem.BorderThickness).
Height { get; set; }double?Box height (vertical alignment, background, border, fitting).
HideIfEmpty { get; set; }boolEmit nothing when the (bound) text is empty.
InputMask { get; set; }stringInput mask for label editors, e.g. "AA-0000" (A letter, 0 digit, * any); checked by Label.Validate.
InputMaskPromptChar { get; set; }char?Prompt character label editors show for unfilled TextItem.InputMask positions (e.g. '_'); Label.Validate reports text still containing it at an input position as incomplete.
IsCounter { get; }boolTrue when the text changes per printed label (counter).
Italic { get; set; }bool
LineSpacing { get; set; }double
Markup { get; set; }TextMarkupTextMarkup.Html: the text (or bound value) is HTML rich text (<b> <i> <u> <s> <mark> <span style="font-family/font-size/color"> <p> <br> …). zplCore breaks the lines over the styled pieces itself and prints one native field per piece (font and size per piece); TextItem.Alignment (also Justify), TextItem.Sizing (ShrinkToFit and FitToBox scale every size of the text by one factor, OverflowSplit), padding, box and TextItem.LineSpacing apply; lines are limited by TextItem.Height (else TextItem.MaxLines for sizing and overflow). Only italic and grey pieces are small graphics; a turned item is one graphic.
Mask { get; set; }stringCounter mask, e.g. "AA-0000" or "####-??" (#/0 digit, A A–Z, a a–z, ? 0–9A–Z, others literal). The (bound) text is the start value; see TextItem.MaskIncrement.
MaskIncrement { get; set; }stringIncrement per printed label for TextItem.Mask: "+1", "-2" or per position like "0010" (carry, wrap-around).
MaxLength { get; set; }intCut the text after this many characters (0 = unlimited).
MaxLines { get; set; }int
MinFontSize { get; set; }double
OutlineThickness { get; set; }doubleDraw only the outline of the glyphs, this thick in label units (graphic).
OverflowItemName { get; set; }stringTarget item of TextSizing.OverflowSplit (must come later in the item list).
Padding { get; set; }ItemPadding
RightToLeft { get; set; }boolRight-to-left print direction (^FPR).
Rotation { get; set; }ItemRotation
ScaleY { get; set; }doubleHeight scale (1 = normal).
ShortHyphen { get; set; }boolFont 0 prints "-" as a long dash; with this option a hyphen between two letters/digits ("T-Shirt", "SO-2026") is printed as a short ^GB bar between font 0 sub-fields. Only for one unrotated line of resident font 0 whose text is fixed per format (not a ^FN field of a stored format); otherwise the long dash stays.
Sizing { get; set; }TextSizing
SlashedZero { get; set; }boolPrint zeros as slashed zeros (Ø).
Strikeout { get; set; }bool
Text { get; set; }string
Underline { get; set; }bool
ValidationErrorMessage { get; set; }stringMessage reported by Label.Validate instead of the built-in ones when TextItem.ValidationRegex or TextItem.InputMask fails; {name} and {value} are replaced.
ValidationRegex { get; set; }stringRegular expression the text must match (checked by Label.Validate).
VerticalAlignment { get; set; }TextVerticalAlignment
Width { get; set; }double?Block width; when set the text wraps (^FB).

Methods

Method SignatureReturnsDescription
# InputMaskPrompt()stringThe TextItem.InputMask as an editor shows it while empty (input positions replaced by the prompt char).
# ToZpl(ZplContext ctx)string