brutally murdered padding and predefined glyph loading

--HG--
branch : newfont
This commit is contained in:
Bill Meltsner
2011-03-05 23:37:36 -05:00
parent 94b4319878
commit 9d38cba626
6 changed files with 7 additions and 124 deletions
+3 -12
View File
@@ -34,18 +34,9 @@ namespace opengl
Font::Font(love::font::Rasterizer * r, const Image::Filter& filter)
: rasterizer(r), height(r->getHeight()), lineHeight(1), mSpacing(1)
{
type = FONT_UNKNOWN;
love::font::GlyphData * gd;
for(unsigned int i = 0; i < MAX_CHARS; i++)
{
gd = r->getGlyphData(i);
widths[i] = gd->getWidth();
spacing[i] = gd->getAdvance();
bearingX[i] = gd->getBearingX();
bearingY[i] = gd->getBearingY();
if (type == FONT_UNKNOWN) type = (gd->getFormat() == love::font::GlyphData::FORMAT_LUMINANCE_ALPHA ? FONT_TRUETYPE : FONT_IMAGE);
}
love::font::GlyphData * gd = r->getGlyphData(0);
type = (gd->getFormat() == love::font::GlyphData::FORMAT_LUMINANCE_ALPHA ? FONT_TRUETYPE : FONT_IMAGE);
delete gd;
}
Font::~Font()
-9
View File
@@ -57,15 +57,6 @@ namespace opengl
FontType type;
public:
static const unsigned int MAX_CHARS = 256;
// The widths of each character.
int widths[MAX_CHARS];
// The spacing of each character.
int spacing[MAX_CHARS];
// The X-bearing of each character.
int bearingX[MAX_CHARS];
// The Y-bearing of each character.
int bearingY[MAX_CHARS];
/**
* Default constructor.