View Full Version : Special character showing strangely in FGU Calendar
Sulimo
February 4th, 2021, 23:56
Hello,
This is a fairly minor issue, but it is reproducible in a CoreRPG campaign.
You just need a calendar with the ä character in the second character of a day name.
You will see what is shown in the screen shot below.
It only seems to affect the Day Name (in this case Eärenya), but not one of the month names (example Yestärë). So it appears to be something with the way the Day abbreviations are shown in FGU (FGC is showing fine).
I don't think this has anything to do with encoding (it's using ISO-8859-1 (https://www.w3schools.com/charsets/ref_html_8859.asp)), and the ä character is part of that encoding scheme (I could be wrong though). I tried ä as well, however, that did not work (same issue).
FG Classic on the Left and FG Unity on the Right.
https://i.imgur.com/t1OCHBw.png
Let me know if there is anything else you might need to know.
I think I can post the calendar, but I'm not sure. Middle-earth calendars are out on the Web in a lot of places, but the license holder is a bit notorious for taking things down.
I could potentially PM the .mod file if necessary.
darrenan
February 5th, 2021, 00:23
It's the font. One has a glyph for that character point and the other doesn't.
Sulimo
February 5th, 2021, 00:34
Not sure what you mean, the Calendar is not changing the fonts (that is not defined in the module), so the Month with ä should be the same as the day with ä, yes the Month display appears to be bold, that looks like the only difference to my eye.
Have a look at the FGU portion of the picture again. The same character appears twice, once how it should (in the Month name) and once messed up (in the day name).
https://i.imgur.com/Dr3JRne.png
darrenan
February 5th, 2021, 00:40
FGC and FGU are using different fonts for that screen is what I mean. The font name in the ruleset might be the same, but I'm guessing the actual .ttf/.fgf files are different (probably .ttf, I think the old bitmap fonts have been phased out at this point?)
EDIT - I'm probably wrong. Looking at the corerpg ruleset I don't see any evidence that it's doing any special casing for FGC vs. FGU. Probably something more subtle. Just ignore me :-P
darrenan
February 5th, 2021, 00:49
This thread looks relevant though: https://www.fantasygrounds.com/forums/showthread.php?59715-Font-issue-discrepancy-between-Classic-and-Unity
darrenan
February 5th, 2021, 00:50
which you also posted in lol
Sulimo
February 5th, 2021, 00:54
Not really, I know all about the Windows-1252 vs. ISO-8859-1. That is why I linked to the ISO-8859-1 character set in the first post, the character exists there, and is not in the portion that caused issues with Windows-1252.
The issue with Windows-1252 is characters 128-159, which does not include the ä character (which is 228 on both Windows-1252 and ISO-8859-1).
Yes, I did post there, it's come up enough times.
damned
February 5th, 2021, 09:18
It looks to me like the bold font has the character and the regular font does not.
Moon Wizard
February 6th, 2021, 22:29
Can you provide the .mod file; just so I can make sure I'm looking at the exact same issue?
Thanks,
JPG
Moon Wizard
February 6th, 2021, 22:54
Never mind. I was able to recreate.
It's actually not the font. It's an interesting problem with encodings that is different between FGC and FGU. With FGC, strings are limited to ISO-8859-1, which is always a single byte per letter; while in FGU, strings are UTF-8, which are variable numbers of bytes depending on letter. Lua doesn't have any special handling for multi-byte letter representation, so when we pull the first two "letters" of the string in Lua, it's only getting the first two bytes. This means that it won't get the right information if any of the characters in the first two letters of the string are multi-byte in the UTF-8 string. I'll have to see if I can detect UTF-8 specific multi-byte characters in this specific case.
Regards,
JPG
Moon Wizard
February 7th, 2021, 00:30
Ok, I added a UTF-8-safe substring helper function in CoreRPG to handle this. It will be in the ruleset updates later this month.
Regards,
JPG
Sulimo
February 7th, 2021, 03:09
Woot, thanks Moon Wizard.
I can send you the mod file if you wanted to test with it, just let me know.
Moon Wizard
February 7th, 2021, 03:42
No need. I was able to recreate; but I always ask by default, because I'm not always able to recreate.
Regards,
JPG
Powered by vBulletin® Version 4.2.1 Copyright © 2026 vBulletin Solutions, Inc. All rights reserved.