Added basic kerning support for TrueType and BMFont fonts (resolves issue #1055.)

This commit is contained in:
Alex Szpakowski
2015-07-02 21:07:34 -03:00
parent 4550409ffa
commit bf432aff7c
8 changed files with 80 additions and 7 deletions
+4
View File
@@ -211,6 +211,7 @@ private:
love::font::GlyphData *getRasterizerGlyphData(uint32 glyph);
const Glyph &addGlyph(uint32 glyph);
const Glyph &findGlyph(uint32 glyph);
float getKerning(uint32 leftglyph, uint32 rightglyph);
void printv(const Matrix4 &t, const std::vector<DrawCommand> &drawcommands, const std::vector<GlyphVertex> &vertices);
std::vector<StrongRef<love::font::Rasterizer>> rasterizers;
@@ -227,6 +228,9 @@ private:
// maps glyphs to glyph texture information
std::unordered_map<uint32, Glyph> glyphs;
// map of left/right glyph pairs to horizontal kerning.
std::unordered_map<uint64, float> kerning;
FontType type;
Texture::Filter filter;