SHIP:Fonts

From Serious Documentation
Revision as of 10:51, 28 November 2012 by Admin (talk | contribs) (Including Font Files and Codepoints)
Jump to: navigation, search

Font Resources

Fonts are instantiated in the Resources area.

Including Font Files and Codepoints

The first step in making a font available to text within the SHIP GUI is to import a font file and declare what characters from that font file your GUI needs to have available. SHIPTide understands True Type fonts, normally files with a ".ttf" suffix in most operating systems.

The fontfamilyinfo node in the resources area holds this information. You can add a font family into SHIPTide a number of ways:

  • With the resources node) selected, Add New->fontfamilyinfo}},
  • Use the File->import media wizard
  • Drag a .ttf file from your OS desktop anywhere into SHIPTide

An example fontfamilyinfo node might look like this:

Example fontfamilyinfo Node

In this example, the fBigNumbers font uses the Square721BT.ttf True Type font file. It also includes the following codepoints (16-bit unicode characters):

Codepoint(s) Character(s)
0x20..0x46 ASCII " " through capital "F", including "0" to "9"
0x78 ASCII "x"
0xB0 The degrees symbol (°)
0xB1 The plus/minus symbol (±)

This codepoints range gives us the complete hex digit set, plus most symbols including degrees, as well as the lower case "x" so that hex numbers like "0x50" can be displayed.

The fontfamilyinfo node does not technically require significant SHIPEngine memory, however the specific fontinfo instantiations within the family will grow proportionately to the number of codepoints listed in the fontfamilyinfo node. Specifying a very large codepoint set will, when the sizes/styles are specified in the fontinfo nodes, drive large or even unsupportable memory requirements depending on the SIM.

Establishing the Font Sizes and Styles Available

Once you have the font resources identified (i.e. fontfamilyinfo nodes created and linked to .ttf files with codepoints selected), the next step is to articulate the set of font sizes and styles your GUI needs from that font.

fontinfo nodes within a fontfamilyinfo node perform this function. Each fontinfo entry describes one font size, in pixels of height. This entry generates a bitmap array of the codepoints at that size.

An example fontinfo node within the fBigFonts fontfamilyinfo node might look like this:

Example fontinfo Node

Font Defaults

Font Overrides and Selection

References