Difference between revisions of "I18N - Character mapping"

From The DarkMod Wiki
Jump to navigationJump to search
(add note)
m (remove outdated note)
Line 60: Line 60:
 
}
 
}
 
</pre>
 
</pre>
 
{{infobox|Note: Due to a bug in v1.07, the remapping does not take place simultanously, that the remaps are applied in order they appear. So a mapping of A => B and B => C will map A incorrectly to C (instead of B). This will be fixed in v1.08. In the meantime, the character mappings have their order adjusted to B => C and A => B so that this works.}}
 
 
 
{{i18n}}* [[Font patcher]]
 
{{i18n}}* [[Font patcher]]
  
 
[[Category:fonts]]
 
[[Category:fonts]]

Revision as of 18:29, 11 August 2014

The D3 code that handles the GUI bitmap font can only load a specific range of bytes as characters. To get the most out of the available entries, a special font is used (Carleton for the menu f.i.). These fonts are build/patched so that the right characters appear in the right place.

Encodings

Note that the language files (f.i. strings/german.lang) as well as the readables and the FM dictionariaries are expected to be in the following encodings:

Remapping

The characters are remapped upon loading the dictionary/readable from their source encoding (e.g. ISO 8859-2) to the special character map TDM uses. Responsible for this are mapping files, f.i. "strings/czech.map". If a map file for a specific language is not found, "strings/default.map" is used instead.

The content of a map file is wrapped in { and }, and each mapping consists of two hexadecimal numbers, the source and the target character number.

Examples

For russian:

{
        0xFF    0xB6            // я
}

For European languages in ISO 8859-2 charset (f.i. Czech):

// a comment
{
        0xF2    0xA1            // ň
        0xDB    0xA2            // Ű (similiar to Ü, used in Hungarian)
        0xFB    0xA4            // ű
        0xA9    0xA6            // Š
        0xB9    0xA8            // š
        0xA1    0xAA            // Ą
        0xC8    0xAC            // Č
        0xCA    0xAB            // Ę
        0xE8    0xAE            // č
        0xD5    0xB0            // Ő (similiar to Ö, used in Hungarian)
        0xA3    0xB1            // Ł
        0xAb    0xB2            // Ť
        0xCF    0xB3            // Ď
        0xAC    0xB4            // Ž
        0xB3    0xB5            // ł
        0xBf    0xB6            // ż
        0xEF    0xB7            // ď
        0xBE    0xB8            // ž
        0xF5    0xB9            // ő (similiar to ö, used in Hungarian)
        0xB1    0xBA            // ą
        0xEA    0xBB            // ę
        0xF8    0xF7            // ř
        0xD8    0xD7            // Ř
        0xEC    0xA3            // ě
        0xCC    0xA5            // Ě
        0xD9    0xA9            // Ů
        0xF9    0xAF            // ů
        0xBB    0xB6            // ť
}

See Also

Translation resources

Overview of translations

Translation discussions