18 #ifndef ION_TEXT_FREETYPEFONT_H_
19 #define ION_TEXT_FREETYPEFONT_H_
27 #if defined(ION_USE_ICU)
28 #include "third_party/iculx_hb/include/layout/ParagraphLayout.h"
43 : size(0.f, 0.f), bitmap_offset(0.f, 0.f), advance(0.f, 0.f) {}
46 bool IsZeroSize()
const {
return size[0] == 0.0f || size[1] == 0.0f; }
65 size_t sdf_padding,
const void* data,
size_t data_size);
73 const math::Vector2f GetKerning(
CharIndex char_index0,
76 #if defined(ION_USE_ICU)
77 void GetFontRunsForText(icu::UnicodeString chars,
80 iculx::FontRuns* runs)
const;
81 GlyphIndex GlyphIndexForICUFont(
const icu::LEFontInstance* icu_font,
82 int32 glyph_id)
const;
87 const Layout BuildLayout(
const std::string&
text,
89 void AddFallbackFont(
const FontPtr& fallback)
override;
109 std::shared_ptr<Helper> helper_;
118 #endif // ION_TEXT_FREETYPEFONT_H_
math::Vector2f size
Width and height of the glyph, in pixels.
This derived Font class represents a FreeType2 font.
bool IsZeroSize() const
Returns true if glyph x- or y-size is zero.
uint32 CharIndex
Typedef for a Unicode index of a character.
This struct defines parameters affecting layout of a single text string when passed to BuildLayout()...
base::ReferentPtr< FreeTypeFont >::Type FreeTypeFontPtr
Convenience typedef for shared pointer to a FreeTypeFont.
math::Vector2f advance
Number of pixels to advance in X and Y to draw the next glyph after this.
GlyphMetrics()
The default constructor initializes everything to 0.
A Layout instance specifies how glyphs are arranged to form text.
math::Vector2f bitmap_offset
Distance in X and Y from the baseline to the top left pixel of the glyph bitmap, in pixels...
This struct represents the metrics for a single glyph.
A grid representing a rendered glyph, with each grid pixel representing pixel coverage in the range (...
A SharedPtr is a smart shared pointer to an instance of some class that implements reference counting...
Font is a base class for implementation-specific representations of fonts.