Classes and methods for handling fonts.
More...
Detailed Description
Classes and methods for handling fonts.
Classes
A class holding font family information. The class provides various ways to support fonts such as a font collection (multiple fonts in a file), referencing a font by a famly name etc.
More...
This class that includes font buffer parameters. It is used as a key in the unordered_map to look up
FontBuffer.
More...
This class has additional properties for font metrics.
More...
This struct holds all the font vertex data.
More...
Temporary buffers used while generating
FontBuffer. Word boundary information. This information is used only with a typography layout with a justification.
More...
This struct holds the glyph information that is used when re-creating a
FontBuffer.
More...
this is used with the texture atlas rendering.
More...
FontManager manages font rendering with OpenGL utilizing freetype and harfbuzz as a glyph rendering and layout back end.
More...
This struct holds the script information used for a text layout.
More...
Enumerations
Specify how to layout texts. Default value is TextLayoutDirectionLTR.
enum
flatui::TextAlignment {
kTextAlignmentLeft = 0,
kTextAlignmentRight = 1,
kTextAlignmentCenter = 2,
kTextAlignmentJustify = 4,
kTextAlignmentLeftJustify = kTextAlignmentJustify,
kTextAlignmentRightJustify = kTextAlignmentJustify | kTextAlignmentRight,
kTextAlignmentCenterJustify = kTextAlignmentJustify | kTextAlignmentCenter
}
enum
flatui::FontBufferStatus {
kFontBufferStatusReady = 0,
kFontBufferStatusNeedReconstruct = 1,
kFontBufferStatusNeedCacheUpdate = 2
}
A status of FontBuffer correspoinding current glyph cache contents.
Enumerations:
More...
A flag controlling appending behavior of the ellipsis.
Enumerations:
More...
Variables
Constant to convert FreeType unit to pixel unit.
More...
Default value for a line height factor.
More...
Default value for a kerning scale factor.
More...
A sentinel value representing an invalid caret position.
const int32_t flatui::kIndexInvalid = -1
const uint32_t flatui::kDefaultColor = 0xffffffff
const int32_t flatui::kVerticesPerGlyph = 4
The number of vertices/indices per a glyph entry.
The default size of the glyph cache width.
The default size of the glyph cache height.
The default size of the max glyph cache slices. The number of cache slices grows up to the value.
The default language used for a line break.
A constant to spefify loading a system font. Used with OpenFont() and SelectFont() API Currently the system font is supported on iOS/macOS and Android only.
static const HashedId flatui::kSystemFontId = HashId(kSystemFont)
Enumeration Type Documentation
A flag controlling appending behavior of the ellipsis. Enumerations:
kEllipsisModeTruncateCharacter - Truncate characters to make a space.
kEllipsisModeTruncateWord - Truncate whole word to make a space.
A status of FontBuffer correspoinding current glyph cache contents. Enumerations:
kFontBufferStatusReady - The font buffer is ready to use.
kFontBufferStatusNeedReconstruct - The glyph cache has been flushed.
- The font buffer needs to be reconstructed.
kFontBufferStatusNeedCacheUpdate - The glyph cache texture needs to be
- uploaded.
Alignment of the text.
- Note
- : Used for a typographic alignment in a label. The enumeration is different from flatui::Alignment as it supports justification setting. Note that in RTL layout direction mode, the setting is flipped. (e.g. kTextAlignmentLeft becomes kTextAlignmentRight) kTextAlignLeft/Right/CenterJustify variants specify how the last line is flushed left, right or centered.
Enumerations:
kTextAlignmentLeft - Text is aligned to the left of the given area. Default setting.
kTextAlignmentRight - Text is aligned to the right of the given area.
kTextAlignmentCenter - Text is aligned to the center of the given area.
kTextAlignmentJustify - Text is 'justified'. Spaces between words are stretched to align both the left and right ends of each line of text.
kTextAlignmentLeftJustify - An alias of kTextAlignmentJustify. The last line of a paragraph is aligned to the left.
kTextAlignmentRightJustify - Text is 'justified'. The last line of a paragraph is aligned to the right.
kTextAlignmentCenterJustify - Text is 'justified'. The last line of a paragraph is aligned to the center.
For more detail of each settings, refer: https://en.wikipedia.org/wiki/Typographic_alignment
Variable Documentation
flatui::kFreeTypeUnit = 64
Constant to convert FreeType unit to pixel unit.
In FreeType & Harfbuzz, the position value unit is 1/64 px whereas configurable in FlatUI. The constant is used to convert FreeType unit to px.
flatui::kKerningScaleDefault = 1.0f
Default value for a kerning scale factor.
The kerning value is derived as the factor * kerning value retrieved from harfbuzz. To change the kerning scale, use SetKerningScale() API.
flatui::kLineHeightDefault = 1.2f
Default value for a line height factor.
The line height is derived as the factor * a font height. To change the line height, use SetLineHeightScale() API.