FS#4870 - Ù (U+00D9) no displayed for large fonts

Attached to Project: OpenTTD
Opened by Ingo von Borstel (planetmaker) - Sunday, 04 December 2011, 13:11 GMT
Last edited by Remko Bijker (Rubidium) - Saturday, 17 December 2011, 21:43 GMT
Type Bug
Category Core
Status Closed
Assigned To No-one
Operating System All
Severity Low
Priority Normal
Reported Version trunk
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No


For both sets that character is not available in the large font (e.g. Newspaper headings) and shown as '?' instead. It's sprite #635 in the base grf.

trunk r23419
This task depends upon

Closed by  Remko Bijker (Rubidium)
Saturday, 17 December 2011, 21:43 GMT
Reason for closing:  Fixed
Additional comments about closing:  In r23582. Thanks for the graphics.
Comment by Remko Bijker (Rubidium) - Sunday, 04 December 2011, 18:04 GMT
Sprite 635 of the (original) base GRF is basically worthless; it's a whole string of characters. So somewhere in the code that character and many others are "removed".

What we could do is remove this revoking and action A replace the sprites with the correct sprite in openttd.grf. Though then we should probably do so for all large characters that are 'rejected' from the base grf.
Comment by frosch (frosch) - Monday, 05 December 2011, 17:15 GMT
Related coop task:

So, IMO: If someone draws all the character for openttd.grf, we can remove that stuff. If not, then OpenGFX shall use Action 12 :)
Comment by PaulC (PaulC) - Tuesday, 06 December 2011, 23:44 GMT
I've already drawn all of the missing characters for both base sets, they just to be arranged into proper sprite sheets before thay can be coded. If possible it would be useful to know in advance which characters in which fonts can be replaced using action A, then I can keep all of those together and seperate from the action 12 characters.
Comment by Ingo von Borstel (planetmaker) - Wednesday, 07 December 2011, 05:56 GMT
Well, we can supply all. Those which have no recongnizable or completely bogus (like sprite #635) form in trg1.grf can be actionA replaced, the others can be added via action12. I haven't yet prepared an exact list, but something like will give us an idea which we can actionA replace (all basically empty ones). We can action12 replace the characters where OpenTTD has its special characters like the plane symbol and similar.
Comment by PaulC (PaulC) - Wednesday, 07 December 2011, 10:23 GMT
OK, I've had another look at and compared it to the base set, so I think I can see which characters we can action A and which sprites they correspond to. There were just two characters on that list that I'm not sure about:

60 { 0x0178, 0x9F }, // Capital letter Y with diaeresis -- seems to work just fine with no action 12/A

61 { 0x010D, 0x63 }, // Small letter c with caron -- is this really in the base set, and if so where?

Otherwise it looks reasonably straightforward. I'll try and put something together in the next day or so.
Comment by Ingo von Borstel (planetmaker) - Wednesday, 07 December 2011, 14:54 GMT
Yes, those two lines are needed but need no(t much) attention in this context.

Indeed both characters are in the base set, but at a different place than they should be by the unicode / utf-8 standards, this is the mapping from the unicode place to the TTD place. unicode character 0x178 is found instead at position 0x9F (which corresponds to sprites 2 + 0x9F - 0x20 = 129 (normal), 226 + 0x9F - 0x20 = 353 (tiny) and 450 + 0x9F - 0x20 = 577 (large).

Similar should be true for the small c with caron, but in this case it is simply mapped to the normal letter 'c' - why ever. It is already existing and action12 replaced in the extra grfs and cannot be actionA replaced.

What we can do is actionA replace all those empty sprites which could be a letter which we have in the base grf.

We need to use Action12 for these characters as they are occupied by special symbols:
{ 0x00A0, 0x20 }, // Non-breaking space / Up arrow
{ 0x00AA, CLRA }, // Feminine ordinal indicator / Down arrow
{ 0x00AC, CLRA }, // Not sign / Tick mark
{ 0x00AD, 0x20 }, // Soft hyphen / X mark
{ 0x00AF, CLRA }, // Macron / Right arrow
{ 0x00B4, CLRA }, // Acute accent / Train symbol
{ 0x00B5, CLRA }, // Micro sign / Truck symbol
{ 0x00B6, CLRA }, // Pilcrow sign / Bus symbol
{ 0x00B7, CLRA }, // Middle dot / Aircraft symbol
{ 0x00B8, CLRA }, // Cedilla / Ship symbol
{ 0x00B9, CLRA }, // Superscript 1 / Superscript -1
{ 0x00BC, CLRA }, // One quarter / Small up arrow
{ 0x00BD, CLRA }, // One half / Small down arrow

The rest mentioned in unicode.h probably can be ActionA replaced, which is basically all where CLRL is used to clear the large glyph due to being ugly / not present / wrong; best example is the sprite 635 (U+00D9) which should be an Ù.
Comment by PaulC (PaulC) - Saturday, 17 December 2011, 17:41 GMT
Right, I've mentioned previously to Rubidium about redrawing the characters in openttd.grf (currently they are taken from OGFX which is not a good match for the original base set) and about adding new characters to provide additional language support etc. Taking all of the above into account as well I've ended up doing a complete redraw and rewrite of the existing files. To summarise this includes:

* All additional OTTD characters redrawn to match the original base set
* New latin letters including those missing from existing translations
* New symbols including a broad selection of currency signs
* All missing base set characters added using action A/12 as appropriate
* Fixed some bugs in the original base set, also redrawn some letters with diacritics to keep them consistant and properly distinguishable (trg1 is a bit of a mess in this regard)

The action A's require the following sprites in the base set to be reactivated: #384, 582, 584, 585, 586, 587, 592, 594, 595, 596, 597, 604, 608, 626, 633, 634, 635, 640, 648, 658, 665, 666 and 672.

Crits and comments welcome.