This class that includes font buffer parameters. It is used as a key in the unordered_map to look up FontBuffer.
More...
#include <font_buffer.h>
This class that includes font buffer parameters. It is used as a key in the unordered_map to look up FontBuffer.
|
|
| FontBufferParameters () |
| | The default constructor for an empty FontBufferParameters.
|
| |
| | FontBufferParameters (HashedId font_id, HashedId text_id, float font_size, const mathfu::vec2i &size, TextAlignment text_alignment, GlyphFlags glyph_flags, bool caret_info, bool ref_count, bool enable_hyphenation=false, bool rtl_layout=false, float kerning_scale=kKerningScaleDefault, float line_height_scale=kLineHeightDefault, HashedId cache_id=kNullHash) |
| | Constructor for a FontBufferParameters. More...
|
| |
| bool | operator== (const FontBufferParameters &other) const |
| | The equal-to operator for comparing FontBufferParameters for equality. More...
|
| |
| size_t | operator() (const FontBufferParameters &key) const |
| | The hash function for FontBufferParameters. More...
|
| |
|
bool | operator() (const FontBufferParameters &lhs, const FontBufferParameters &rhs) const |
| | The compare operator for FontBufferParameters.
|
| |
| HashedId | get_font_id () const |
| |
| HashedId | get_text_id () const |
| |
| HashedId | get_cache_id () const |
| |
| const mathfu::vec2i & | get_size () const |
| |
| float | get_font_size () const |
| |
| TextAlignment | get_text_alignment () const |
| |
| float | get_kerning_scale () const |
| |
| float | get_line_height_scale () const |
| |
| GlyphFlags | get_glyph_flags () const |
| |
| bool | get_caret_info_flag () const |
| |
| bool | get_ref_count_flag () const |
| |
| bool | get_rtl_layout_flag () const |
| |
| bool | get_enable_hyphenation_flag () const |
| |
| int32_t | get_line_length () const |
| |
| bool | get_multi_line_setting () const |
| |
|
void | set_font_size (float size) |
| | Set font size.
|
| |
|
void | set_size (mathfu::vec2i &size) |
| | Set the size value.
|
| |
| flatui::FontBufferParameters::FontBufferParameters |
( |
HashedId |
font_id, |
|
|
HashedId |
text_id, |
|
|
float |
font_size, |
|
|
const mathfu::vec2i & |
size, |
|
|
TextAlignment |
text_alignment, |
|
|
GlyphFlags |
glyph_flags, |
|
|
bool |
caret_info, |
|
|
bool |
ref_count, |
|
|
bool |
enable_hyphenation = false, |
|
|
bool |
rtl_layout = false, |
|
|
float |
kerning_scale = kKerningScaleDefault, |
|
|
float |
line_height_scale = kLineHeightDefault, |
|
|
HashedId |
cache_id = kNullHash |
|
) |
| |
|
inline |
Constructor for a FontBufferParameters.
- Parameters
-
| [in] | font_id | The HashedId for the font. |
| [in] | text_id | The HashedID for the text. |
| [in] | font_size | A float representing the size of the font. |
| [in] | size | The requested size of the FontBuffer in pixels. The created FontBuffer size can be smaller than requested size as the FontBuffer size is calcuated by the layout and rendering result. |
| [in] | text_alignment | A horizontal alignment of multi line buffer. |
| [in] | kerning_scale | Value indicating kerning scale. |
| [in] | line_height_scale | Value indicating line height scale. |
| [in] | glyph_flags | A flag determing SDF generation for the font. |
| [in] | caret_info | A bool determining if the FontBuffer contains caret info. |
| [in] | ref_count | A bool determining if the FontBuffer manages reference counts of the buffer and referencing glyph cache rows. |
| [in] | enable_hyphenation | A bool determining if the hyphenation is enabled for the FontBuffer. |
| [in] | rtl_layout | A bool determining if the FontBuffer is for RTL (right to left) layout. |
| [in] | kerning_scale | A float value specifying a scale applied to the kerning value between glyphs. Default value is kKerningScaleDefault(1.0). |
| [in] | line_height_scale | A float value specifying a scale applied to the line height for each line break. Default value is kLineHeightDefault(1.0). |
| [in] | cache_id | An extra ID to distinguish cache entry. For instance, tweak the ID to have multiple FontBuffer instances with the same set of parameters. |
| HashedId flatui::FontBufferParameters::get_cache_id |
( |
| ) |
const |
|
inline |
- Returns
- Returns a cache id value.
| bool flatui::FontBufferParameters::get_caret_info_flag |
( |
| ) |
const |
|
inline |
- Returns
- Returns a flag indicating if the buffer has caret info.
| bool flatui::FontBufferParameters::get_enable_hyphenation_flag |
( |
| ) |
const |
|
inline |
- Returns
- Returns a flag indicating if the hyphenation is enabled.
| HashedId flatui::FontBufferParameters::get_font_id |
( |
| ) |
const |
|
inline |
- Returns
- Returns a font hash id.
| float flatui::FontBufferParameters::get_font_size |
( |
| ) |
const |
|
inline |
- Returns
- Returns the font size.
| GlyphFlags flatui::FontBufferParameters::get_glyph_flags |
( |
| ) |
const |
|
inline |
- Returns
- Returns a glyph setting info.
| float flatui::FontBufferParameters::get_kerning_scale |
( |
| ) |
const |
|
inline |
- Returns
- Returns the kerning scale.
| float flatui::FontBufferParameters::get_line_height_scale |
( |
| ) |
const |
|
inline |
- Returns
- Returns the line height scale.
| int32_t flatui::FontBufferParameters::get_line_length |
( |
| ) |
const |
|
inline |
Retrieve a line length of the text based on given parameters. a fixed line length (get_size.x) will be used if the text is justified or right aligned otherwise the line length will be determined by the text layout phase.
- Returns
- Returns the expected line width.
| bool flatui::FontBufferParameters::get_multi_line_setting |
( |
| ) |
const |
|
inline |
- Returns
- Returns the multi line setting.
| bool flatui::FontBufferParameters::get_ref_count_flag |
( |
| ) |
const |
|
inline |
- Returns
- Returns a flag indicating if the buffer manages reference counts.
| bool flatui::FontBufferParameters::get_rtl_layout_flag |
( |
| ) |
const |
|
inline |
- Returns
- Returns a flag indicating if the buffer is for RTL layout.
| const mathfu::vec2i& flatui::FontBufferParameters::get_size |
( |
| ) |
const |
|
inline |
- Returns
- Returns the size value.
| TextAlignment flatui::FontBufferParameters::get_text_alignment |
( |
| ) |
const |
|
inline |
- Returns
- Returns a text alignment info.
| HashedId flatui::FontBufferParameters::get_text_id |
( |
| ) |
const |
|
inline |
- Returns
- Returns a hash value of the text.
The documentation for this class was generated from the following file: