|
MayaFlux 0.4.0
Digital-First Multimedia Processing Framework
|
| MAYAFLUX_API GlyphOutline MayaFlux::Portal::Text::decompose_glyph | ( | FontFace & | face, |
| uint32_t | codepoint, | ||
| uint32_t | pixel_size, | ||
| float | tolerance = 0.5F |
||
| ) |
Decompose a Unicode codepoint into a tessellated polyline outline.
Loads the glyph via FT_LOAD_NO_BITMAP, walks the FT_Outline with FT_Outline_Decompose, and flattens conic and cubic Bezier segments into line segments at the given flatness tolerance.
The returned outline may be empty (points and contour_ends both empty) for whitespace codepoints or when the codepoint has no outline (e.g. space, tab). advance_x is still populated in that case so layout can proceed.
| face | Loaded FontFace. Must outlive this call. |
| codepoint | Unicode codepoint. |
| pixel_size | Glyph size in pixels. Passed to FT_Set_Pixel_Sizes. |
| tolerance | Flatness tolerance in pixels. Smaller values produce more segments and higher fidelity curves. |
Definition at line 168 of file GlyphOutline.cpp.
References MayaFlux::Portal::Text::GlyphOutline::advance_x, MayaFlux::Journal::API, MayaFlux::Portal::Text::GlyphOutline::codepoint, MayaFlux::Portal::Text::GlyphOutline::contour_ends, MayaFlux::Portal::Text::FontFace::get_face(), MayaFlux::Portal::Text::FontFace::is_loaded(), MF_ERROR, MF_WARN, MayaFlux::Portal::Text::GlyphOutline::points, MayaFlux::Journal::Portal, and tolerance.
Referenced by decompose_glyph(), and MayaFlux::Nodes::GpuSync::GlyphGeometryNode::rebuild_outlines().
Here is the call graph for this function:
Here is the caller graph for this function: