|
FastUIDraw
|
Glyph provides the interfaces to realizing glyph data for rendering glyphs. The big classes being Glyph, GlyphCache, GlyphAtlas and FontBase. Part of the main library libFastUIDraw. More...
Namespaces | |
| fastuidraw::CharacterEncoding | |
| A CharacterEncoding is used to decide how to interpret characters. The value itself is just a 32-bit value that mirrors the FT_Encoding of FreeType. | |
| fastuidraw::GlyphGenerateParams | |
| GlyphGenerateParams encapsulates values to determine how glyphs are to be produced. These values cannot be changed if there are any FontBase derived objects alive. | |
Classes | |
| class | fastuidraw::FontBase |
| FontBase provides an interface for a font to generate glyph rendering data. More... | |
| class | fastuidraw::FontDatabase |
| A FontDatabase performs the act of font selection and glyph selection. It uses the values of FontProperties (except for FontProperties::source_label()) to select suitable font or fonts. More... | |
| class | fastuidraw::FontFreeType |
| A FontFreeType implements the interface of FontBase from a scalable font loaded by libfreetype. More... | |
| class | fastuidraw::FontMetrics |
| Represents various metric values global to an entire font. More... | |
| class | fastuidraw::FontProperties |
| Represents defining properties of a font used by FontDatabase to perform font merging. More... | |
| class | fastuidraw::FreeTypeFace |
| A FreeTypeFace wraps an FT_Face object of the FreeType library together with a mutex in a reference counted object. More... | |
| class | fastuidraw::FreeTypeLib |
| A FreeTypeLib wraps an FT_Library object of the FreeType library together with a mutex in a reference counted object. More... | |
| class | fastuidraw::Glyph |
| A Glyph is essentially an opaque pointer to data for rendering and performing layout of a glyph. More... | |
| class | fastuidraw::GlyphAtlasProxy |
| An GlyphAtlasProxy is a proxy for a GlyphAtlas; one can allocate through it. Internally it tracks all that was allocated with it. More... | |
| class | fastuidraw::GlyphAttribute |
| A GlyphAttribute represents one Painter Attribute per glyph corner. More... | |
| class | fastuidraw::GlyphCache |
| A GlyphCache represents a cache of glyphs and manages the uploading of the data to a GlyphAtlas. The methods of GlyphAtlas are thread safe because it maintains an internal mutex lock for the durations of its methods. More... | |
| class | fastuidraw::GlyphMetrics |
A GlyphMetrics provides information on the metrics of a glyph, all the values are in units of the font glyph. The function units_per_EM() provides the conversion factor to pixel coordinates via where PixelSize is the pixel size in which one is to render the text. More... | |
| class | fastuidraw::GlyphMetricsValue |
| A GlyphMetricsValue is to be used by a FontBase derived object to specify the values of a GlyphMetrics object. More... | |
| class | fastuidraw::GlyphRenderCostInfo |
| class | fastuidraw::GlyphRenderData |
| GlyphRenderData provides an interface to specify data used for rendering glyphs and to pack that data onto a GlyphAtlas. More... | |
| class | fastuidraw::GlyphRenderDataBandedRays |
| class | fastuidraw::GlyphRenderDataRestrictedRays |
| class | fastuidraw::GlyphRenderDataTexels |
| A GlyphRenderDataTexels holds texel data for rendering a glyph. Such texel data can be for both distance field and coverage glyph rendeding. More... | |
| class | fastuidraw::GlyphRenderer |
| Specifies how to render a glyph. More... | |
| class | fastuidraw::GlyphSource |
Macros | |
| #define | FASTUIDRAW_CHARACTER_ENCODING_VALUE(a, b, c, d) (uint32_t(a) << 24u) | (uint32_t(b) << 16u) | (uint32_t(c) << 8u) | uint32_t(d) |
Enumerations | |
| enum | fastuidraw::CharacterEncoding::encoding_value_t : uint32_t { fastuidraw::CharacterEncoding::unicode = FASTUIDRAW_CHARACTER_ENCODING_VALUE('u', 'n', 'i', 'c'), fastuidraw::CharacterEncoding::ms_symbol = FASTUIDRAW_CHARACTER_ENCODING_VALUE('s', 'y', 'm', 'b'), fastuidraw::CharacterEncoding::sjis = FASTUIDRAW_CHARACTER_ENCODING_VALUE('s', 'j', 'i', 's'), fastuidraw::CharacterEncoding::prc = FASTUIDRAW_CHARACTER_ENCODING_VALUE('g', 'b', ' ', ' '), fastuidraw::CharacterEncoding::big5 = FASTUIDRAW_CHARACTER_ENCODING_VALUE('b', 'i', 'g', '5'), fastuidraw::CharacterEncoding::wansung = FASTUIDRAW_CHARACTER_ENCODING_VALUE('w', 'a', 'n', 's'), fastuidraw::CharacterEncoding::johab = FASTUIDRAW_CHARACTER_ENCODING_VALUE('j', 'o', 'h', 'a'), fastuidraw::CharacterEncoding::adobe_latin1 = FASTUIDRAW_CHARACTER_ENCODING_VALUE('l', 'a', 't', '1'), fastuidraw::CharacterEncoding::adobe_standard = FASTUIDRAW_CHARACTER_ENCODING_VALUE('A', 'D', 'O', 'B'), fastuidraw::CharacterEncoding::adobe_expert = FASTUIDRAW_CHARACTER_ENCODING_VALUE('A', 'D', 'B', 'E'), fastuidraw::CharacterEncoding::adobe_custom = FASTUIDRAW_CHARACTER_ENCODING_VALUE('A', 'D', 'B', 'C'), fastuidraw::CharacterEncoding::apple_roman = FASTUIDRAW_CHARACTER_ENCODING_VALUE('a', 'r', 'm', 'n') } |
| Enumeration type to define character encodings. More... | |
| enum | fastuidraw::glyph_type { fastuidraw::coverage_glyph, fastuidraw::distance_field_glyph, fastuidraw::restricted_rays_glyph, fastuidraw::banded_rays_glyph, fastuidraw::invalid_glyph = 0x1000, fastuidraw::adaptive_rendering = invalid_glyph } |
| Provides an enumeration of the rendering data for a glyph. More... | |
Glyph provides the interfaces to realizing glyph data for rendering glyphs. The big classes being Glyph, GlyphCache, GlyphAtlas and FontBase. Part of the main library libFastUIDraw.
| #define FASTUIDRAW_CHARACTER_ENCODING_VALUE | ( | a, | |
| b, | |||
| c, | |||
| d | |||
| ) | (uint32_t(a) << 24u) | (uint32_t(b) << 16u) | (uint32_t(c) << 8u) | uint32_t(d) |
Conveniance macro to define a 32-bit character encoding scheme from four unsigned 8-bit values.
Definition at line 35 of file character_encoding.hpp.
| enum fastuidraw::CharacterEncoding::encoding_value_t : uint32_t |
Enumeration type to define character encodings.
| Enumerator | |
|---|---|
| unicode | Unicode character set to cover all version of Unicode. |
| ms_symbol | Miscrosoft Symbol Encoding; uses the character codes 0xF020 - 0xF0FF. |
| sjis | Shift JIS encoding for Japanese characters. |
| prc | Character encoding for the Simplified Chinese of the People's Republic of China. |
| big5 | Characted encoding for Traditional Chinese of Taiwan and Hong Kong |
| wansung | Encoding of the Korean characters as Extended Wansung (MS Windows code page 949). See also https://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WindowsBestFit/bestfit949.txt |
| johab | The Korean standard character set (KS C 5601-1992). This corrresponds to MS Windows code page 1361. |
| adobe_latin1 | Latin-1 character encoding as defined by Type 1 PostScript font, limited to 256 character codes. |
| adobe_standard | Adobe Standard character encoding found in Type 1, CFF and OpenType/CFF fonts, limited to 256 character codes. |
| adobe_expert | Adobe Expert character encoding found in Type 1, CFF and OpenType/CFF fonts, limited to 256 character codes. |
| adobe_custom | Custom character encoding found in Type 1, CFF and OpenType/CFF fonts, limited to 256 character codes. |
| apple_roman | Apply Roman character encoding; a number of TrueType and OpenType fonts have this 8-bit encoding because quite older version of Mac OS support it. |
Definition at line 49 of file character_encoding.hpp.
Provides an enumeration of the rendering data for a glyph.
| Enumerator | |
|---|---|
| coverage_glyph | |
| distance_field_glyph | |
| restricted_rays_glyph | Glyph is a Restricted rays glyph, generated from a GlyphRenderDataRestrictedRays. Glyph is scalable. |
| banded_rays_glyph | Glyph is a Banded rays glyph, generated from a GlyphRenderDataBandedRays. Glyph is scalable. |
| invalid_glyph | Tag to indicate invalid glyph type; the value is much larger than the last glyph type to allow for later ABI compatibility as more glyph types are added. Value is also to indicate to Painter::draw_glyphs() to draw glyphs adaptively (i.e. choose a renderer based from the size of the rendered glyphs). |
| adaptive_rendering | Tag to indicate invalid glyph type; the value is much larger than the last glyph type to allow for later ABI compatibility as more glyph types are added. Value is also to indicate to Painter::draw_glyphs() to draw glyphs adaptively (i.e. choose a renderer based from the size of the rendered glyphs). |
Definition at line 34 of file glyph_renderer.hpp.
| float fastuidraw::GlyphGenerateParams::banded_rays_average_number_curves_thresh | ( | void | ) |
When generating banded rays glyphs see (GlyphRenderDataBandedRays), specifies the threshhold for the average number of curves across bands to stop recursing to finer bands.
| enum return_code fastuidraw::GlyphGenerateParams::banded_rays_average_number_curves_thresh | ( | float | v | ) |
Set the value returned by banded_rays_average_number_curves_thresh(void) const, initial value is 2.5. Returns routine_success if value is successfully changed.
| v | value |
| unsigned int fastuidraw::GlyphGenerateParams::banded_rays_max_recursion | ( | void | ) |
When generating banded rays glyphs see (GlyphRenderDataBandedRays), specifies the maximum number of times to recurse when generating sub-bands. The number of bands that are generated in a dimension is 2^N where N is the number of levels of recurion used to generate bands.
| enum return_code fastuidraw::GlyphGenerateParams::banded_rays_max_recursion | ( | unsigned int | v | ) |
Set the value returned by banded_rays_max_recursion(void) const, initial value is 11. Returns routine_success if value is successfully changed.
| v | value |
|
inline |
Conveniance functions to create a CharacterEncoding value from an arbitary 4-tuple of uint8_t values.
Definition at line 130 of file character_encoding.hpp.
| void fastuidraw::FontDatabase::create_glyph_sequence | ( | FontGroup | group, |
| input_iterator | character_codes_begin, | ||
| input_iterator | character_codes_end, | ||
| output_iterator | output_begin, | ||
| uint32_t | selection_strategy = 0u |
||
| ) |
Fill Glyph values from an iterator range of character code values.
| input_iterator | read iterator to type that is castable to uint32_t |
| output_iterator | write iterator to Glyph |
| group | FontGroup to choose what font |
| character_codes_begin | iterator to 1st character code |
| character_codes_end | iterator to one past last character code |
| output_begin | begin iterator to output |
| selection_strategy | using bit-wise ors of values of selection_bits_t to choose the matching criteria of selecting a font. |
Definition at line 365 of file font_database.hpp.
| void fastuidraw::FontDatabase::create_glyph_sequence | ( | const FontBase * | h, |
| input_iterator | character_codes_begin, | ||
| input_iterator | character_codes_end, | ||
| output_iterator | output_begin, | ||
| uint32_t | selection_strategy = 0u |
||
| ) |
Fill Glyph values from an iterator range of character code values.
| input_iterator | read iterator to type that is castable to uint32_t |
| output_iterator | write iterator to Glyph |
| h | pointer to font from which to fetch the glyph, if the glyph is not present in the font attempt to get the glyph from a font of similiar properties |
| character_codes_begin | iterator to 1st character code |
| character_codes_end | iterator to one past last character code |
| output_begin | begin iterator to output |
| selection_strategy | using bit-wise ors of values of selection_bits_t to choose the matching criteria of selecting a font. |
Definition at line 385 of file font_database.hpp.
| void fastuidraw::FontDatabase::create_glyph_sequence_no_merging | ( | const FontBase * | h, |
| input_iterator | character_codes_begin, | ||
| input_iterator | character_codes_end, | ||
| output_iterator | output_begin | ||
| ) |
Fill an array of Glyph values from an array of character code values.
| input_iterator | read iterator to type that is castable to uint32_t |
| output_iterator | write iterator to Glyph |
| h | pointer to font from which to fetch the glyph, if the glyph is not present in the font attempt to get the glyph from a font of similiar properties |
| character_codes_begin | iterator to first character code |
| character_codes_end | iterator to one pash last character code |
| output_begin | begin iterator to output |
Definition at line 405 of file font_database.hpp.
| float fastuidraw::GlyphGenerateParams::distance_field_max_distance | ( | void | ) |
When creating distance field data, the distances are normalized and clamped to [0, 1]. This value provides the normalization which effectivly gives the maximum distance recorded in the distance field texture. Recall that the values stored in texels are uint8_t's so larger values will have lower accuracy. The units are in pixels. Default value is 1.5.
| enum return_code fastuidraw::GlyphGenerateParams::distance_field_max_distance | ( | float | v | ) |
Set the value returned by distance_field_max_distance(void) const, initial value is 96.0, i.e. 1.5 pixels. Return routine_success if value is successfully changed.
| v | value |
| enum return_code fastuidraw::GlyphGenerateParams::distance_field_pixel_size | ( | unsigned int | v | ) |
Set the value returned by distance_field_pixel_size(void) const, initial value is 48. Return routine_success if value is successfully changed.
| v | value |
| unsigned int fastuidraw::GlyphGenerateParams::distance_field_pixel_size | ( | void | ) |
Pixel size at which to generate distance field scalable glyphs.
| int fastuidraw::GlyphGenerateParams::restricted_rays_max_recursion | ( | void | ) |
When generating restricted rays glyph data see (GlyphRenderDataRestrictedRays), specifies the maximum level of recursion that will be used to generate the hierarchy of boxes.
| enum return_code fastuidraw::GlyphGenerateParams::restricted_rays_max_recursion | ( | int | v | ) |
Set the value returned by restricted_rays_max_recursion(void) const, initial value is 12. Returns routine_success if value is successfully changed.
| v | value |
| enum return_code fastuidraw::GlyphGenerateParams::restricted_rays_minimum_render_size | ( | float | v | ) |
Set the value returned by restricted_rays_minimum_render_size(void) const, initial value is 32.0. Returns routine_success if value is successfully changed.
| v | value |
| float fastuidraw::GlyphGenerateParams::restricted_rays_minimum_render_size | ( | void | ) |
When generating restricted rays glyph data see (GlyphRenderDataRestrictedRays), specifies the expected smallest size on the scrren at which to render glyphs via a GlyphRenderDataRestrictedRays. The value is used to include curves near the boundary of bounding box so that anti-aliasing works correctly when the glyph is renderer very small. A negative value indicates that no slack is taken/used.
| int fastuidraw::GlyphGenerateParams::restricted_rays_split_thresh | ( | void | ) |
When generating restricted rays glyph data see (GlyphRenderDataRestrictedRays), specifies the threshhold value for number of curves allowed in a single box before a box.
| enum return_code fastuidraw::GlyphGenerateParams::restricted_rays_split_thresh | ( | int | v | ) |
Set the value returned by restricted_rays_split_thresh(void) const, initial value is 4. Returns routine_success if value is successfully changed.
| v | value |
1.8.13