Please remove limit 128 chars from wfn fonts and make 256 for full ASCII support (2 languages)
acfonts.cpp
and add translation GUI::ListBox in acgui.c
void GUIListBox::Draw()
{
...
#ifdef THIS_IS_THE_ENGINE
// Allow it to change the string to unicode if it's TTF
char oritext[200];
strcpy(oritext, get_translation(items[a + topItem]));
ensure_text_valid_for_font(oritext, font);
#else
char *oritext = items[a + topItem];
#endif
if (alignment == GALIGN_LEFT)
wouttext_outline(x + 1 + pixel_size, thisyp + 1, font, oritext);
else {
int textWidth = wgettextwidth(oritext, font);
if (alignment == GALIGN_RIGHT)
wouttext_outline(rightHandEdge - textWidth, thisyp + 1, font, oritext);
else
wouttext_outline(((rightHandEdge - x) / 2) + x - (textWidth / 2), thisyp + 1, font, oritext);
}
...
acfonts.cpp
Spoiler
class WFNFontRenderer : public IAGSFontRenderer {
public:
...
virtual bool SupportsExtendedCharacters(int fontNumber) { return false; } // Make TRUE
...
};
void WFNFontRenderer::EnsureTextValidForFont(char *text, int fontNumber)
{
// Clear
}
int WFNFontRenderer::GetTextWidth(const char *texx, int fontNumber)
{
...
if (((unsigned char)thisCharacter > 127) && (sizeof(tabaddr) <= 128)) thisCharacter = '?'; // Remove
...
}
int WFNFontRenderer::GetTextHeight(const char *texx, int fontNumber)
{
...
if (((unsigned char)thisCharacter > 127) && (sizeof(tabaddr) <= 128)) thisCharacter = '?'; // Remove
...
}
int WFNFontRenderer::printchar(int xxx, int yyy, wgtfont foo, int charr)
{
...
if (((unsigned char)charr > 127) && (sizeof(tabaddr) <= 128)) // Remove this strings
charr = '?';
...
}
public:
...
virtual bool SupportsExtendedCharacters(int fontNumber) { return false; } // Make TRUE
...
};
void WFNFontRenderer::EnsureTextValidForFont(char *text, int fontNumber)
{
// Clear
}
int WFNFontRenderer::GetTextWidth(const char *texx, int fontNumber)
{
...
if (((unsigned char)thisCharacter > 127) && (sizeof(tabaddr) <= 128)) thisCharacter = '?'; // Remove
...
}
int WFNFontRenderer::GetTextHeight(const char *texx, int fontNumber)
{
...
if (((unsigned char)thisCharacter > 127) && (sizeof(tabaddr) <= 128)) thisCharacter = '?'; // Remove
...
}
int WFNFontRenderer::printchar(int xxx, int yyy, wgtfont foo, int charr)
{
...
if (((unsigned char)charr > 127) && (sizeof(tabaddr) <= 128)) // Remove this strings
charr = '?';
...
}
[close]
and add translation GUI::ListBox in acgui.c
Spoiler
void GUIListBox::Draw()
{
...
#ifdef THIS_IS_THE_ENGINE
// Allow it to change the string to unicode if it's TTF
char oritext[200];
strcpy(oritext, get_translation(items[a + topItem]));
ensure_text_valid_for_font(oritext, font);
#else
char *oritext = items[a + topItem];
#endif
if (alignment == GALIGN_LEFT)
wouttext_outline(x + 1 + pixel_size, thisyp + 1, font, oritext);
else {
int textWidth = wgettextwidth(oritext, font);
if (alignment == GALIGN_RIGHT)
wouttext_outline(rightHandEdge - textWidth, thisyp + 1, font, oritext);
else
wouttext_outline(((rightHandEdge - x) / 2) + x - (textWidth / 2), thisyp + 1, font, oritext);
}
...
[close]