Difference between revisions of "SHIP:Fonts"

From Serious Documentation
Jump to: navigation, search
(Including Font Files and Codepoints)
(Establishing the Font Sizes and Styles Available)
Line 39: Line 39:
 
{{Node|fontinfo}} nodes within a  {{Node|fontfamilyinfo}} node perform this function.  Each  {{Node|fontinfo}} entry describes one font size, in pixels of height.  This entry generates a bitmap array of the codepoints at that size.   
 
{{Node|fontinfo}} nodes within a  {{Node|fontfamilyinfo}} node perform this function.  Each  {{Node|fontinfo}} entry describes one font size, in pixels of height.  This entry generates a bitmap array of the codepoints at that size.   
  
An example {{Node|fontinfo}} node within the fBigFonts {{Node|fontfamilyinfo}} node might look like this:
+
An example {{Node|fontinfo}} node within the '''fBigFonts''' {{Node|fontfamilyinfo}} node might look like this:
  
 
[[File:SHIPTide-fontExample2.png|400px|border|center|Example {{Node|fontinfo}} Node]]
 
[[File:SHIPTide-fontExample2.png|400px|border|center|Example {{Node|fontinfo}} Node]]
 +
 +
In this example, this GUI has a 64-pixel high set of the codepoints from the .ttf file specified in its parent '''fBigFonts''' {{Node|fontfamilyinfo}} node.
 +
 +
The height is the full height of the tallest character of the whole font (regardless of the codepoints selected).  This spans the lowest descender (commonly a '''j''') to the tallest ascender (commonly a '''[''' or '''!''').
  
 
== Font Defaults ==
 
== Font Defaults ==

Revision as of 11:17, 28 November 2012

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

In this example, this GUI has a 64-pixel high set of the codepoints from the .ttf file specified in its parent fBigFonts fontfamilyinfo node.

The height is the full height of the tallest character of the whole font (regardless of the codepoints selected). This spans the lowest descender (commonly a j) to the tallest ascender (commonly a [ or !).

Font Defaults

Font Overrides and Selection

References