-
Notifications
You must be signed in to change notification settings - Fork 814
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unicode font rendering #2904
Unicode font rendering #2904
Conversation
a3b8931
to
a2d27f1
Compare
The correct list of blocks is:
Which allows display of most languages based on Latin, Cyrillic and Greek |
Basic Latin and Latin-1 Supplement was done in the previous update to the code 😉 so it's not added in this change. |
@@ -101,7 +101,7 @@ std::vector<std::string> HelpTextLines; | |||
void InitHelp() | |||
{ | |||
HelpFlag = false; | |||
char tempString[512]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There might be other character arrays that need to be doubled in size to accommodate the larger characters. I'd search for strcpy
and strcat
. Some of them, like tempstr
seem large enough as is; others I'm not sure about.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer to do that in a later update, and maybe search them out by testing (ASAN reports them at runtime)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There were a couple more of those, apparently.
|
||
char path[32]; | ||
sprintf(path, "fonts\\%i-00.pcx", FontSizes[size]); | ||
sprintf(path, "fonts\\%i-%02d.pcx", FontSizes[size], row); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, plan is to add the rest, but maybe we should simply skip any such missing symbols 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AJenbo I would vote for writing a error character. A questions mark or a box or something.
The program shouldn't stop executing or simply print nothing.
That could also help to diagnostic future errors.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess that might be safe to do considering that UTF-8 is self synchronizing. But I would go for ?
as that is more canonical and simpler to add to the code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since you said backspace would be easy, and because it's an easy issue for the player to stumble on, I think that should be fixed before merging. Everything else that was mentioned can be handled in future PRs so I'd consider those optional.
EDIT: I should have also mentioned that I didn't find anything new in my code review except my comment about the in-game chat backspace.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just barely noticed this typo as I was finishing my review (Uft8 vs Utf8). Apart from this, I think it's ready for merge.
This adds full support for the first 1279 Unicode symbols:
Which is needed for the following existing translations: