23 [[nodiscard]] const_model_ptr_type
model()
const;
26 [[nodiscard]] const_material_ptr_type
material()
const;
53 [[nodiscard]] vector2_type
size()
const;
60 context_ptr_type aContext,
61 std::shared_ptr<font> aFont,
62 material_ptr_type aMaterial = {},
71 context_ptr_type aContext,
72 std::shared_ptr<font_texture> aFontTexture,
73 material_ptr_type aMaterial = {},
80 std::shared_ptr<font> m_pFont;
82 std::shared_ptr<font_texture> m_pFontTexture;
84 texture_ptr_type m_pBoundTexture;
86 material_ptr_type m_pMaterial;
88 model_ptr_type m_pModel;
94 std::size_t m_LaidOutAtlasGeneration = 0;
96 bool m_LayoutSent =
false;
98 std::size_t m_FallbackGlyphCount = 0;
102 vector2_type m_Size = {0, 0};
void set_text(std::string_view aUTF8)
lay out new text, replacing whatever was there.
text_modeler(context_ptr_type aContext, std::shared_ptr< font_texture > aFontTexture, material_ptr_type aMaterial={}, float aScale=0.f)
builds a modeler that draws from a texture of the font's atlas it shares with others
vector2_type size() const
the size of the text laid out by the last set_text, in model units
std::size_t uploaded_atlas_generation() const
the font atlas generation of the texture this modeler draws from
void upload()
brings the model and the atlas texture up to date.
text_modeler(context_ptr_type aContext, std::shared_ptr< font > aFont, material_ptr_type aMaterial={}, float aScale=0.f)
builds a modeler
const_model_ptr_type model() const
get the model, contains the uploaded geometry for the text
const_material_ptr_type material() const
get the material, used to render the model
std::size_t fallback_glyph_count() const
how many glyphs in the last layout could not be rasterised, and were drawn as the font's fallback ins...