I can’t correctly display accented characters with version 3 of the Z-code with Ozmoo.
The documentation mentions these three possibilities, but is it the second that prevents me from doing so?
- Embedding custom font.
- Custom alphabets in Z-machine version 5 and 8.
- Custom character mappings.
You need to use a custom font for it to work, and you have to have the right character mappings in place.
Of course, Ozmoo can only show the characters that have been mapped in. So, if you use the German mapping, Ozmoo can show ä and ü but not à or ê, etc.
Also, Ozmoo can only show accented characters which have their default position in the ZSCII table. If you alter the ZSCII table by adding Unicode characters etc, this may break.
The game doesn’t have to have a custom alphabet to work with accented characters in Ozmoo, but if it doesn’t it will have a few problems:
- String compression becomes really bad if you use a lot of accented characters
- Dictionary resolution gets horrible for words containing accented characters, since one accented character takes up four character positions out of six.
Is there a game file I can try?
I have identified the issue, it comes from the use of the Zcharacter directive with version 3. With this directive an accentuated character takes up 2 instead of 4 slots.
print "à â ä ç é è ê ë î ï ô ö ù û ü ÿ œ æ « » ^";
print "À Â Ä Ç É È Ê Ë Î Ï Ô Ö Ù Û Ü Œ Æ ^";
Indeed, this means setting up a customized alphabet table. This isn’t part of the Z-machine specification for z3. Some interpreters will recognize and use the custom alphabet table anyway. Ozmoo is not one of them.
Here is the relevant part of the spec:
In Versions 5 and later, the interpreter should look at the word at $34 in the header. If this is zero, then the alphabet table drawn out in S 3.5.3 continues in use. Otherwise it is interpreted as the byte address of an alphabet table specific to this story file.
Thank you. The support of version 3 in languages other than English therefore does not make much sense, especially since it is restrictive and the rendering is rather austere.
It depends on the language I guess. If it’s just that say one character in 20 has an accent, it may be acceptable to use the default alphabet table. Or if you’re writing a short game so there’s room for all the text you need even if the compression ration is bad. You could also instruct players to skip the accents in input, which will eliminate the problem with poor dictionary resolution.
But I certainly agree that z5 is a lot more suitable for non-English games.