Starting with FontManager 3.41, Font_Paint and Font_ScanString now accept strings in 8, 16 or 32-bit forms. This is invoked by bits 12 & 13 in the flags in R2.
All other Font SWIs only accept 8-bit strings.
A 16-bit string must be half-word aligned, and consists of a number of 16-bit halfwords. A 32-bit string must be word aligned, and consists of a number of 32-bit words.
Below is how the string “Hello” is represented in 8, 16 and 32-bit string form.
String form | Data |
---|---|
8-bit | 48 65 6C 6C 6F 00 |
16-bit | 0048 0065 006C 006C 006F 0000 |
32-bit | 00000048 00000065 0000006C 0000006C 0000006F 00000000 |
This allows access to characters outside the first 256. Control codes work as before, but have to be introduced by a character of the appropriate width.
The parameters of control sequences are handled differently in 16 and 32-bit modes. More information is available on font’s encoding.
Regardless of the setting of the 16/32-bit bits, string lengths continue to be in bytes (such as R7 on entry to Font_Paint).