Member attributes: Ranges

This attribute determines the font glyphs to incorporate when converting a particular font resource member.

Syntax

Form 1:

character, ...

first‑character-last‑character, ...

first‑character-last‑character:map‑character, ...

Form 2:

ranges‑file‑name

Discussion

With the attribute Ranges you specify a list of font glyphs to take in account when converting a font specified in FontName attribute of a particular font resource member. Accordingly, glyphs not listed in this attribute are not guaranteed to be available in the resulting font. This attribute allows you to control precisely the amount of font information generated for the target system. The individual font glyphs are represented by their corresponding UNICODE character codes, which you can express by using the following syntax:

Syntax of a character

Description

decimal‑digits

The character code is represented by a decimal number. For example the number 65 stands for the upper case letter A or the number 916 is the code of the greek letter Delta.

0xhex‑digits

The character code is represented by a hexadecimal number prefixed by 0x. For example the number 0x41 stands for the upper case letter A or the number 0x394 is the code of the greek letter Delta.

'character'

Specifies the character itself enclosed between a pair of '...' (single quote) signs. For example: 'A'.

In its simplest form, the attribute is initialized with a single character. A range of glyphs, in turn, is specified by a pair of first-character and last-character separated by a - (minus) sign. You can combine any number of individual characters and ranges by separating them with the , (comma) sign. For example, the initialization value 'a'-'z','0'-'9','-','+' results in a font resource containing the letters a .. z, digits 0 .. 9 and the both individual glyphs - and +.

Additionally, it is possible to assign a glyph or a range of glyphs to another characters within the resulting font. For this purpose the desired destination character is specified after the : (colon) sign. For example, 'a'-'z':'A' forces the font converter to include all lower case letters a .. z and to store them at the codes corresponding to the upper case letters A .. Z. With such font, printing an upper case letter will result in the corresponding lower case letter being displayed on the screen.

In its second form, the attribute can be configured with a path referring to a text file, where the desired font character ranges (e.g. file.txt) are stored. The syntax of this file correspond exactly to the syntax described above. If the attribute doesn't specify an absolute file path, the path is considered as being relative to the directory of the unit, the affected font resource is defined inside as its member.

Please note, the converted font resource includes automatically the default character of the respective TrueType font. This character will be displayed on the screen instead of all characters, which are not contained in the font resource. Usually the default characters appear as small empty boxes.

TIP

If you create the ranges files .txt with an external tool or editor, please ensure that the files start with a correct UTF-8 BOM (Byte Order Mark) 0xEF 0xBB 0xBF. With UTF-8 you can encode all characters from the Unicode range 0x0001 .. 0xFFFF directly in the text (e.g. 'A'). If BOM is missing, Embedded Wizard falls back in a compatibility mode and interprets the files as containing ASCII characters only. In such case all Unicode characters > 0x007F have to be coded by using the sequence 0x followed by the character code in hexadecimal notation.

Modify the attribute

To inspect or modify the value of a Ranges attribute, select first the affected font resource member. Thereupon, the attribute is listed in the middle area of Inspector. Please note the available file selection assistant you can activate by clicking on the button right to the attribute. This assistant is useful if you want to select a file containing the font ranges:

Localization

The attribute Ranges can be localized allowing the creation of font resource members optimized to display multilingual text. For this purpose expand the attribute by clicking on the small triangle left to the attribute. All available language specific values are listed thereupon below the attribute and can be modified individually:

If you haven't specified any particular language specific value for the attribute, the value from the fallback language Default is used automatically. Once localized values can be removed easily by pressing the keys CtrlR when the affected value is selected.

IMPORTANT

If the font resource is localized for multiple languages, it is important to specify in the Ranges attribute for each affected language a unique set of glyphs. In other words, the font may not contain multiple glyphs with the same code. When ranges overlap, Embedded Wizard reports an error.