25#include "common/rect.h"
26#include "common/hashmap.h"
27#include "common/str.h"
28#include "twp/spritesheet.h"
52 uint operator()(
Twp::KerningKey val)
const {
return (uint)(val.first ^ val.second); }
69 virtual ~Font() =
default;
71 virtual int getLineHeight() = 0;
72 virtual float getKerning(CodePoint prev, CodePoint next) = 0;
73 virtual Glyph getGlyph(CodePoint chr) = 0;
83 int getLineHeight()
final {
return _lineHeight; }
84 float getKerning(CodePoint prev, CodePoint next)
final {
return 0.f; }
85 Glyph getGlyph(CodePoint chr)
final;
113 int getLineHeight()
final {
return _lnHeight; }
114 float getKerning(CodePoint prev, CodePoint next)
final;
115 Glyph getGlyph(CodePoint chr)
final;
155 void setColor(
const Color &c) {
159 Color getColor()
const {
return _col; }
161 void setMaxWidth(
float maxW) {
165 float getMaxWidth()
const {
return _maxW; }
167 void setHAlign(TextHAlignment align) {
171 TextHAlignment getHAlign()
const {
return _hAlign; }
173 void setVAlign(TextVAlignment align) {
177 TextVAlignment getVAlign()
const {
return _vAlign; }
181 Math::Vector2d getBounds();
183 void draw(
Gfx &gfx,
const Math::Matrix4 &trsf = Math::Matrix4());
194 TextHAlignment _hAlign = TextHAlignment::thLeft;
195 TextVAlignment _vAlign = TextVAlignment::tvCenter;
197 Math::Vector2d _bnds;
char32_t u32char_type_t
Definition: ustr.h:55
Definition: algorithm.h:29