mirror of
https://github.com/love2d/love.git
synced 2026-08-17 19:23:38 +02:00
some final changes to make it work better, and to fix how printf displayed
This commit is contained in:
@@ -69,11 +69,10 @@ namespace opengl
|
|||||||
glScalef(sx, sy, 1.0f);
|
glScalef(sx, sy, 1.0f);
|
||||||
int first = (int)text[0];
|
int first = (int)text[0];
|
||||||
int s = -bearingX[first];
|
int s = -bearingX[first];
|
||||||
int by = bearingY[first];
|
|
||||||
for (unsigned int i = 0; i < text.size(); i++) {
|
for (unsigned int i = 0; i < text.size(); i++) {
|
||||||
int g = (int)text[i];
|
int g = (int)text[i];
|
||||||
if (!glyphs[g]) g = 32; // space
|
if (!glyphs[g]) g = 32; // space
|
||||||
glyphs[g]->draw(bearingX[g] + s, -bearingY[g]+by, 0, 1, 1, 0, 0);
|
glyphs[g]->draw(bearingX[g] + s, -bearingY[g], 0, 1, 1, 0, 0);
|
||||||
s += spacing[g] * mSpacing;
|
s += spacing[g] * mSpacing;
|
||||||
}
|
}
|
||||||
glPopMatrix();
|
glPopMatrix();
|
||||||
@@ -105,7 +104,7 @@ namespace opengl
|
|||||||
|
|
||||||
int Font::getWidth(const char character) const
|
int Font::getWidth(const char character) const
|
||||||
{
|
{
|
||||||
return widths[(int)character];
|
return spacing[(int)character];
|
||||||
}
|
}
|
||||||
|
|
||||||
void Font::setLineHeight(float height)
|
void Font::setLineHeight(float height)
|
||||||
|
|||||||
Reference in New Issue
Block a user