mirror of
https://github.com/love2d/love.git
synced 2026-08-16 16:20:42 +02:00
Added an optional spacing argument to love.graphics.newImageFont, allowing additional spacing (positive or negative) to be applied to all glyphs rendered using that font.
This commit is contained in:
@@ -39,7 +39,7 @@ namespace font
|
||||
class ImageRasterizer : public Rasterizer
|
||||
{
|
||||
public:
|
||||
ImageRasterizer(love::image::ImageData *imageData, uint32 *glyphs, int numglyphs);
|
||||
ImageRasterizer(love::image::ImageData *imageData, uint32 *glyphs, int numglyphs, int extraspacing);
|
||||
virtual ~ImageRasterizer();
|
||||
|
||||
// Implement Rasterizer
|
||||
@@ -49,6 +49,14 @@ public:
|
||||
virtual bool hasGlyph(uint32 glyph) const;
|
||||
|
||||
private:
|
||||
|
||||
// Information about a glyph in the ImageData
|
||||
struct ImageGlyphData
|
||||
{
|
||||
int x;
|
||||
int width;
|
||||
};
|
||||
|
||||
// Load all the glyph positions into memory
|
||||
void load();
|
||||
|
||||
@@ -61,12 +69,7 @@ private:
|
||||
// Number of glyphs in the font
|
||||
int numglyphs;
|
||||
|
||||
// Information about a glyph in the ImageData
|
||||
struct ImageGlyphData
|
||||
{
|
||||
int x;
|
||||
int width;
|
||||
};
|
||||
int extraSpacing;
|
||||
|
||||
std::map<uint32, ImageGlyphData> imageGlyphs;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user