Merge remote-tracking branch 'origin/master' into jgrpp

# Conflicts:
#	src/string.cpp
This commit is contained in:
Jonathan G Rennison
2018-12-10 18:40:05 +00:00
18 changed files with 1059 additions and 468 deletions

View File

@@ -208,6 +208,7 @@ class FreeTypeFontCache : public FontCache {
private:
FT_Face face; ///< The font face associated with this font.
int req_size; ///< Requested font size.
int used_size; ///< Used font size.
typedef SmallMap<uint32, SmallPair<size_t, const void*> > FontTable; ///< Table with font table cache
FontTable font_tables; ///< Cached font tables.
@@ -241,6 +242,7 @@ private:
public:
FreeTypeFontCache(FontSize fs, FT_Face face, int pixels);
~FreeTypeFontCache();
virtual int GetFontSize() const { return this->used_size; }
virtual SpriteID GetUnicodeGlyph(WChar key) { return this->parent->GetUnicodeGlyph(key); }
virtual void SetUnicodeGlyph(WChar key, SpriteID sprite) { this->parent->SetUnicodeGlyph(key, sprite); }
@@ -295,6 +297,7 @@ void FreeTypeFontCache::SetFontSize(FontSize fs, FT_Face face, int pixels)
pixels = Clamp(min(head->Lowest_Rec_PPEM, 20) + diff, scaled_height, MAX_FONT_SIZE);
}
}
this->used_size = pixels;
FT_Error err = FT_Set_Pixel_Sizes(this->face, 0, pixels);
if (err != FT_Err_Ok) {