Added support for faux-bold and faux-italic

Former-commit-id: 259429e8d38b0299e30d539253b50e3aab12c76b
This commit is contained in:
Lynix
2015-01-08 14:19:53 +01:00
parent 88af94b987
commit a9ef2f7e36
4 changed files with 100 additions and 51 deletions

View File

@@ -87,6 +87,8 @@ class NAZARA_API NzFont : public NzResource, NzNonCopyable
{
NzRecti aabb;
NzRectui atlasRect;
bool requireFauxBold;
bool requireFauxItalic;
bool flipped;
bool valid;
int advance;
@@ -105,7 +107,7 @@ class NAZARA_API NzFont : public NzResource, NzNonCopyable
nzUInt64 ComputeKey(unsigned int characterSize, nzUInt32 style) const;
void OnAtlasCleared();
const Glyph& PrecacheGlyph(GlyphMap& glyphMap, unsigned int characterSize, bool bold, char32_t character) const;
const Glyph& PrecacheGlyph(GlyphMap& glyphMap, unsigned int characterSize, nzUInt32 style, char32_t character) const;
std::shared_ptr<NzAbstractFontAtlas> m_atlas;
std::unique_ptr<NzFontData> m_data;

View File

@@ -18,7 +18,7 @@ class NAZARA_API NzFontData
NzFontData() = default;
virtual ~NzFontData();
virtual bool ExtractGlyph(unsigned int characterSize, char32_t character, bool bold, NzFontGlyph* dst) = 0;
virtual bool ExtractGlyph(unsigned int characterSize, char32_t character, nzUInt32 style, NzFontGlyph* dst) = 0;
virtual NzString GetFamilyName() const = 0;
virtual NzString GetStyleName() const = 0;
@@ -31,6 +31,8 @@ class NAZARA_API NzFontData
virtual unsigned int QueryLineHeight(unsigned int characterSize) const = 0;
virtual float QueryUnderlinePosition(unsigned int characterSize) const = 0;
virtual float QueryUnderlineThickness(unsigned int characterSize) const = 0;
virtual bool SupportsStyle(nzUInt32 style) const = 0;
};
#endif // NAZARA_FONTDATA_HPP