mirror of
https://github.com/love2d/love.git
synced 2026-08-16 00:02:12 +02:00
brutally murdered padding and predefined glyph loading
--HG-- branch : newfont
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user