Skip to content

Commit

Permalink
Fixed character interval of fallback font
Browse files Browse the repository at this point in the history
  • Loading branch information
yvt committed Feb 14, 2014
1 parent 0a41fce commit dbfe56a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Sources/Client/Quake3Font.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,8 @@ namespace spades {
color *= a;
renderer->SetColorAlphaPremultiplied(color);

float invScale = 1.f / scale;

for(size_t i = 0; i < txt.size();){
size_t chrLen = 0;
uint32_t ch = GetCodePointFromUTF8String(txt, i, &chrLen);
Expand Down Expand Up @@ -169,7 +171,7 @@ namespace spades {
fallback:
DrawFallback(ch, MakeVector2(x, y + yMin) * scale + offset,
(yMax - yMin) * scale, color);
x += MeasureFallback(ch, (yMax - yMin) * scale);
x += MeasureFallback(ch, (yMax - yMin) * scale) * invScale;
}
}
}
Expand Down

0 comments on commit dbfe56a

Please sign in to comment.