Added support for loading BMFont bitmap font files with love.graphics.newFont (see issue #190.) Some esoteric BMFont features are not supported.

Moved the Font module Lua wrapper code out of the freetype implementation folder.

--HG--
branch : minor
This commit is contained in:
Alex Szpakowski
2014-09-28 16:00:40 -03:00
parent 34688e929e
commit 8edb90a719
18 changed files with 714 additions and 199 deletions
+13 -7
View File
@@ -24,11 +24,13 @@
// LOVE
#include "Rasterizer.h"
#include "image/ImageData.h"
#include "filesystem/FileData.h"
#include "common/Module.h"
#include "common/int.h"
// STD
// C++
#include <string>
#include <vector>
namespace love
{
@@ -42,16 +44,20 @@ public:
virtual ~Font() {}
// Implements Module.
virtual ModuleType getModuleType() const { return M_FONT; }
virtual Rasterizer *newRasterizer(love::filesystem::FileData *data) = 0;
virtual Rasterizer *newTrueTypeRasterizer(love::filesystem::FileData *data, int size) = 0;
virtual Rasterizer *newBMFontRasterizer(love::filesystem::FileData *fontdef, const std::vector<image::ImageData *> &images) = 0;
virtual Rasterizer *newImageRasterizer(love::image::ImageData *data, const std::string &glyphs) = 0;
virtual Rasterizer *newImageRasterizer(love::image::ImageData *data, uint32 *glyphs, int length) = 0;
virtual Rasterizer *newRasterizer(Data *data, int size) = 0;
virtual Rasterizer *newRasterizer(love::image::ImageData *data, const std::string &glyphs) = 0;
virtual Rasterizer *newRasterizer(love::image::ImageData *data, uint32 *glyphs, int length) = 0;
virtual GlyphData *newGlyphData(Rasterizer *r, const std::string &glyph) = 0;
virtual GlyphData *newGlyphData(Rasterizer *r, uint32 glyph) = 0;
// Implement Module
// Implement Module.
virtual ModuleType getModuleType() const { return M_FONT; }
virtual const char *getName() const = 0;
}; // Font