Introduction
The FontMap module provides a means by which font names can be translated between different formats. Primarily this is used by the DrawFile SVG conversion code but may be used by other clients as necessary.
Technical Details
Font details
In order to perform the translations between different schemes the module uses a number of features of the fonts to determine compatibility together with a mapping file provided by the user. Because the mapping between font types is expected to be inexact the closest suitable matches will be returned wherever possible.
There are four major features which are used to determine the fonts. The most obvious of these is the name. The name can be used to provide information about other features of the font, for example through the use of 'Italic' or 'Bold' as part of the name.
The other three features are the use of 'italic', the 'weight' of the font, and its 'stretch'.
The FontMap module does not attempt to match specialist or symbolic fonts. Other, more complex, schemes such as Panose may provide more accurate font matching than the FontMap module provides. In the absence of Panose categorisations of RISC OS fonts the FontMap provides a simplified, yet functional, mapping system.
SWI Calls
| R0 | = | Flags:
| ||||||||||||||||||||||||
| R1 | = | Pointer to source font name | ||||||||||||||||||||||||
| R2 | = | Italic type:
| ||||||||||||||||||||||||
| R3 | = | Weight type:
| ||||||||||||||||||||||||
| R4 | = | Stretch type:
| ||||||||||||||||||||||||
| R5 | = | Pointer to destination buffer to fill in, or 0 to request length required | ||||||||||||||||||||||||
| R6 | = | Size of destination buffer | ||||||||||||||||||||||||
| R2 | = | Italic type of destination (see values above) |
| R3 | = | Weight type of destination (see values above) |
| R4 | = | Stretch type of destination (see values above) |
| R6 | = | Length of name, or buffer required |
This SWI is used to translate between different font types. In addition, it may be used to apply features to RISC OS fonts by specifying 'RISC OS' as the source and destination and selecting the relevant features in the input feature fields (R2-R4). Similarly, by specifying 'unspecified' values within the RISC OS fields, the features of the font are given by the returned registers (R2-R4 on exit).