mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-24 21:11:39 +00:00
- Fixed: SBarInfo couldn't print extended ASCII characters.
SVN r2838 (trunk)
This commit is contained in:
parent
59b19d36fb
commit
0619a2677e
2 changed files with 8 additions and 8 deletions
|
@ -1352,16 +1352,16 @@ public:
|
|||
if(script->spacingCharacter == '\0')
|
||||
ax += font->GetSpaceWidth();
|
||||
else
|
||||
ax += font->GetCharWidth((int) script->spacingCharacter);
|
||||
ax += font->GetCharWidth((unsigned char) script->spacingCharacter);
|
||||
str++;
|
||||
continue;
|
||||
}
|
||||
int width;
|
||||
if(script->spacingCharacter == '\0') //No monospace?
|
||||
width = font->GetCharWidth((int) *str);
|
||||
width = font->GetCharWidth((unsigned char) *str);
|
||||
else
|
||||
width = font->GetCharWidth((int) script->spacingCharacter);
|
||||
FTexture* character = font->GetChar((int) *str, &width);
|
||||
width = font->GetCharWidth((unsigned char) script->spacingCharacter);
|
||||
FTexture* character = font->GetChar((unsigned char) *str, &width);
|
||||
if(character == NULL) //missing character.
|
||||
{
|
||||
str++;
|
||||
|
@ -1378,7 +1378,7 @@ public:
|
|||
|
||||
if(script->spacingCharacter != '\0')
|
||||
{
|
||||
double spacingSize = font->GetCharWidth((int) script->spacingCharacter);
|
||||
double spacingSize = font->GetCharWidth((unsigned char) script->spacingCharacter);
|
||||
switch(script->spacingAlignment)
|
||||
{
|
||||
default:
|
||||
|
@ -1444,7 +1444,7 @@ public:
|
|||
if(script->spacingCharacter == '\0')
|
||||
ax += width + spacing - (character->LeftOffset+1);
|
||||
else //width gets changed at the call to GetChar()
|
||||
ax += font->GetCharWidth((int) script->spacingCharacter) + spacing;
|
||||
ax += font->GetCharWidth((unsigned char) script->spacingCharacter) + spacing;
|
||||
str++;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -745,13 +745,13 @@ class CommandDrawString : public SBarInfoCommand
|
|||
if(script->spacingCharacter == '\0')
|
||||
x -= static_cast<int> (font->StringWidth(str)+(spacing * str.Len()));
|
||||
else //monospaced, so just multiplay the character size
|
||||
x -= static_cast<int> ((font->GetCharWidth((int) script->spacingCharacter) + spacing) * str.Len());
|
||||
x -= static_cast<int> ((font->GetCharWidth((unsigned char) script->spacingCharacter) + spacing) * str.Len());
|
||||
break;
|
||||
case ALIGN_CENTER:
|
||||
if(script->spacingCharacter == '\0')
|
||||
x -= static_cast<int> (font->StringWidth(str)+(spacing * str.Len()) / 2);
|
||||
else
|
||||
x -= static_cast<int> ((font->GetCharWidth((int) script->spacingCharacter) + spacing) * str.Len() / 2);
|
||||
x -= static_cast<int> ((font->GetCharWidth((unsigned char) script->spacingCharacter) + spacing) * str.Len() / 2);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue