TypeSetter.ixx File
Text layout engine for computing glyph positions and bounding boxes. More...
Included Headers
#include <memory>
#include <span>
#include <string>
#include <limits>
#include <algorithm>
#include <utility>
#include <vector>
#include <helios.math>
#include <helios.util.Colors>
#include <helios.engine.core.data.FontId>
#include <helios.rendering.shader.Shader>
#include <helios.rendering.text.FontResourceProvider>
#include <helios.rendering.text.Glyph>
Namespaces Index
| namespace | helios |
| namespace | rendering |
|
Graphics rendering infrastructure. More... | |
| namespace | text |
|
Text rendering abstractions and data types. More... | |
Classes Index
| struct | TextLayout |
|
Result of text layout computation. More... | |
| class | TypeSetter |
|
Computes text layout by positioning glyphs and generating vertex data. More... | |
Description
Text layout engine for computing glyph positions and bounding boxes.
File Listing
The file content with the documentation metadata removed is:
31export namespace helios::rendering::text {
38 struct TextLayout {
90 class TypeSetter {
109 const std::string_view text,
111 const helios::engine::core::data::FontId fontId,
112 FontResourceProvider& fontResourceProvider) {
114 helios::math::aabbf aabb = {};
116 if (text.empty()) {
117 return TextLayout {aabb};
121 vertices.reserve(text.size() * 6);
134 for (char c : text) {
135 auto glyph = fontResourceProvider.glyph(c, fontId);
137 float xpos = penX + glyph.bearing[0] * scale;
159 aabb = helios::math::aabbf(minX, minY, minZ, maxX, maxY, maxZ);
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.