Wiki

Clone wiki

Card Editor / Documents / Layouts / TextElements

Text Elements

A Text Element is a type of Element in a Layout that displays formatted Text. To create a Text Element, click the Add Element button in the Layout View and select "Text".

In addition to the standard Element properties, Text Elements have several properties specific for text.

Text Element Properties

Text

If the Element is not bound to a Field, then you can type in its text contents through the Text property. You may also double-click the Element in the Layout Editor and type the text there. Text Elements allow you to apply formatting for special effects through XML tags. If the text is too large to fit in the available space of the Element, any extra text will get cut off.

Embedding Glyphs

You can embed Glyphs into text using a self-closed "glyph" XML element. It has one required attribute called "name", which is the name of the Glyph as defined in its Glyph Set:

<glyph name="glyphId" />

The resulting text will replace the element with the appropriate Glyph image, if defined. The image's height will match the font size and its width will match its aspect ratio.

Changing Fonts

You can change the font for a portion or all of the text by wrapping it in a "font" XML element. It has 3 attributes:

  • name - The name of the font family to use.
  • size - The size of the resulting text, measured in inches.
  • bold - Whether the text should use bold weight. Value must be either "true" or "false".
  • italics - Whether the text should use italics style. Value must be either "true" or "false".
  • color - The color of the resulting text. The value can either be:
  • One of the following named colors
    • red
    • green
    • blue
    • cyan
    • magenta
    • yellow
    • black
    • white
  • An RGB or ARGB hex code value, prefixed by # (e.g. #FF0000 for red or #8000FF00 for transparent green)

<font name="courier new" size="1.25" color="red">This text has a new font</font>

All attributes are optional. Excluding them means that it will use whatever value was set previously for the text. You may nest font XML elements within other font elements:

<font color="red">This is red. <font color="blue" bold="true">This is blue and bold.</font> This is red again.</font>

Font

This defines the base font family used to render the text. You can select any installed system font. The default value is the default sans serif system font.

Font Size

This sets the base size of the text, measured in inches. This should be roughly equivalent to the distance between the baseline and the cap height, though this may change depending on the font used. See here for more information on typography sizes. The default value is .125".

Bold

This determines if the base font uses bold weight. The default value is false.

Italics

This determines if the base font uses italics style. However, because some fonts don't have an italics style, this actually renders in oblique style, applying a slant to the text. The default value is false.

Horizontal Alignment

This determines how the text aligns horizontally within the Element. One of:

  • Left
  • Center
  • Right

The default value is Left.

Vertical Alignment

This determines how the text aligns vertically within the Element. One of:

  • Top
  • Center
  • Right

The default value is Top.

Color

This sets the basic color of the text. The default value is opaque black.

Updated