Font families

Use the fontFamily style attribute to define a generic or specific font family.

This section describes the possible values of the fontFamily style attribute.

Syntax

font-family [,...]
  1. font-family defines a generic or a native font family.

Usage

A set of generic font families is supported, that are interpreted by the front end according to the graphical capability of the paltform.

If the fontFamily is not a generic font family, it is interpreted as a native font family, which identifies a local font supported by the front-end. Usually, it is one of the fonts installed on the platform operating system. See front-end documentation for a list of supported native fonts.

A native font family should be used only if the front-end can't determine a proper default font family for the desired platform.

Important: A font family containing white-spaces must be single quoted. In the XML definition of the style, this leads to a single quoted string that is, in turn, enclosed in double quotes:
<StyleAttribute name="fontFamily" value="'Courier New'" />
When specifying a comma-separated list of font families, the front-end will use the best matching font available on the platform. You can mix generic and native font families:
<StyleAttribute name="fontFamily" value="'Times New Roman',Times,serif" />
Table 1. Generic font families to front-end platform fonts
Generic font family name GDC HTML5 GMA GMI
serif
Times serif (CSS) Serif Times New Roman
sans-serif
Arial sans-serif (CSS) Sans-Serif Helvetica Neue
cursive
Comic Sans Ms cursive (CSS) N/A (keeps defauft font) Marker Felt
fantasy
Algerian fantasy (CSS) N/A (keeps defauft font) Papyrus
monospace
Courier New monspace (CSS) Monospace Courier
Note:
  • The HTML5 front-end used the font family as font-family property in a CSS style. For more details, see CSS generic-font-families
  • The GMI front-end tries to find a font family in the available fonts of the application (i.e. the iOS built-in fonts and any application specific fonts) which matches the fontFamily given in the styles. If none is found, the fallback is "Helvetica Neue".
  • The GMA front-end maps generic font family names to Androidâ„¢ generic font names (Serif, Monospace), these are then mapped to real font names. The real font name depends from the Android brand. For example Sans-serif is usually implemented with the "Roboto" font.

Example

<StyleAttribute name="fontFamily" value="sans-serif" />
<StyleAttribute name="fontFamily" value="'Courier New'" />
<StyleAttribute name="fontFamily" value="'Times New Roman',Times,serif" />