Skip to main content

Text Style Palette

By using the Text Style Palette section from the Solution Options ("File" > "Solution Options"), it is possible to create different text style templates which can be saved and later reused.

If there are no fonts already imported, the user can import any available fonts by using the "Import Fonts" button which is placed on the upper-right corner of the Text Style Palette section. The button will open the "Import Fonts" panel which can also be opened by using the "Import" > "Import Fonts" menu.

drawing-4-1676339050.png

For every node which has associated a font (for example, the TextNode in a 2D scene), a specific Style property is available in the Properties panel. By using that property the Text Style palette can be set.

The first step toward the creation of a new text style is to add a new text style.

drawing-4-1676339154.png

Please refer to Font Palette for detailed information about the "Default font" field.


For any newly created text style there are four different sections that can be seen on the right side of the panel:

  • Text Style
  • Metrics
  • General
  • Asset

Under the "Text Style" section another sub-sections are available:

  • Entries
  • Cultures

It is possible to configure the fonts based on both unicode ranges and on the basis of language. In other words, the font selection can be conditioned by language ISO codes (the standardized nomenclature used to classify languages).

In the "Entries" section different fonts that will be used for any text edited in SceneComposer can be set. First, a new child has to be added by using the "+" button. Any child can be deleted or can be moved up or down. For every new child there are three main properties which should be set:

  • bounds (lower and upper)
  • font (used later on)
drawing-4-1676339242.png

The bounds of the entry represent the ASCII decimal values which are equivalents of all the letter of the Latin alphabet (65 to 90 - capital letters from A to Z; 97 to 122 - lower cases). If, for a specific selected font, the selected bounds will be 65 ( = U+0041) for the lower and 90 ( = U+005A) for the upper, all the capital letters from a text which uses that style will be drawn with that specific chosen font.

After any bound has been set in decimal values, when push "Enter" those values will be automatically transformed into the coresponding ISO codes. For instance, if the lower bound is set as 3311, after press "Enter" it will be automatically displayed as the "U+0CEF" ISO Code. If the lower bound is set as 200000, it will be automatically displayed as the "U+1E8480" ISO Code.

In the "Cultures" section different entries can be set exactly in the same manner as mentioned above. In this way all the text style entries are grouped by culture.

See also:
drawing-4-1676339285.png

In the image below different cultures and entries can be seen (Click to enlarge image).

02_text-style_7.png

It is possible, if desired, to create a style which uses a specific font associated for any letter.

drawing-4-1676339596.png
  • The "Text Style" section has a great importance because of the selection of the main font used in association of a created style.
  • The "Metrics" section presents font line spacing information:
    • Ascender: defines the part of a lower-case letter that is taller than the font's x-height
    • Descender: defines the portion of a letter that extends below the baseline of a font.
    • Line Height: represents the vertical distance between lines of text
          lineGap = lineHeight - (ascender - descender)
      

       

drawing-4-1676339672.png
  • The "General" section provides all the necessary information about the created style: Name, Description, Icon and so forth.
  • The "Asset" section provides information about exporting, Id, Symbolic name, and Candera name and path.

To find the cultures that are used and the fonts that were set, a verification is done until a valid configuration is found. The codepoint resolution is done according to rules verified in the following order:

  • Check if Active Culture is in the Culture list of the current TextStyle
  • Check if Active Culture is in the Culture list of the Base Style
  • Configuration of Entries in current Text Style
  • Configuration of Entries in Base Style
  • Default Font from current Text Style
  • Default Font from Base Style

If none of the above checkings will give any result, the default code point will be used.