Sparkle 0.0.1
Loading...
Searching...
No Matches
spk::FontMesh Struct Reference

Mesh specialization for font glyphs. More...

#include <spk_font_painter.hpp>

Inheritance diagram for spk::FontMesh:
Inheritance graph
Collaboration diagram for spk::FontMesh:
Collaboration graph

Classes

class  Builder
 Builder that converts text into glyph polygons. More...

Public Member Functions

 FontMesh ()=default
 Builds an empty font mesh.
 FontMesh (Font *p_font, const Font::Size &p_fontSize)
 Builds a font mesh using a font and size.
const Fontfont () const
 Returns the font used by this mesh.
Font::Bitmapbitmap ()
 Returns the bitmap associated with the font.
const Font::Bitmapbitmap () const
 Returns the bitmap associated with the font.
const Font::SizefontSize () const
 Returns the configured font size.
Public Member Functions inherited from spk::IMesh< FontVertex >
 IMesh ()
 Builds an empty mesh with a dynamic buffer set.
IMeshoperator= (const IMesh &p_other)
 Assigns polygon data from another mesh.
void clear ()
 Clears all polygons and notifies subscribers.
void append (const Polygon &p_shape)
 Appends a polygon and notifies subscribers.
EditionContract subscribeToEdition (const EditionJob &p_job) const
 Subscribes to mesh edition notifications.
const std::vector< FontVertex > & vertices () const
 Returns the cached vertex list for all polygons.
const std::vector< Polygon > & polygons () const
 Returns the stored polygons.
const std::vector< uint32_t > & indexes () const
 Returns the cached triangle indices for the mesh.
IMeshoperator+= (const IMesh &p_other)
 Appends polygons from another mesh and notifies subscribers.
const std::shared_ptr< spk::OpenGL::BufferSetObject > & bufferSet () const
 Returns the underlying buffer set.
void synchronize () const
 Updates GPU buffers when mesh data has changed.
IMesh fuze (const IMesh &p_other) const
 Returns a new mesh by concatenating another mesh.

Protected Member Functions

void _configureBufferSet () const override
 Configures the vertex buffer layout for font vertices.

Additional Inherited Members

Public Types inherited from spk::IMesh< FontVertex >
using Polygon
 Polygon type stored by the mesh.
using EditionContract
 Contract type returned by edition subscriptions.
using EditionJob
 Job type invoked on mesh edits.

Detailed Description

Mesh specialization for font glyphs.

See also
FontVertex
spk::FontMesh mesh(font, {16, 0});
Mesh specialization for font glyphs.
Definition spk_font_painter.hpp:51
const Font * font() const
Returns the font used by this mesh.
Definition spk_font_painter.cpp:303

Constructor & Destructor Documentation

◆ FontMesh()

spk::FontMesh::FontMesh ( Font * p_font,
const Font::Size & p_fontSize )

Builds a font mesh using a font and size.

Parameters
p_fontFont used for glyph bitmap data.
p_fontSizeRequested font size.

Member Function Documentation

◆ _configureBufferSet()

void spk::FontMesh::_configureBufferSet ( ) const
inlineoverrideprotectedvirtual

Configures the vertex buffer layout for font vertices.

Implements spk::IMesh< FontVertex >.

Here is the call graph for this function:

◆ bitmap() [1/2]

Font::Bitmap & spk::FontMesh::bitmap ( )

Returns the bitmap associated with the font.

Returns
Mutable font bitmap.
Here is the caller graph for this function:

◆ bitmap() [2/2]

const Font::Bitmap & spk::FontMesh::bitmap ( ) const

Returns the bitmap associated with the font.

Returns
Const font bitmap.

◆ font()

const Font * spk::FontMesh::font ( ) const

Returns the font used by this mesh.

Returns
Font pointer or nullptr.
Here is the caller graph for this function:

◆ fontSize()

const Font::Size & spk::FontMesh::fontSize ( ) const

Returns the configured font size.

Returns
Font size.
Here is the caller graph for this function:

The documentation for this struct was generated from the following files:
  • includes/structure/graphics/painter/spk_font_painter.hpp
  • srcs/structure/graphics/painter/spk_font_painter.cpp