Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
pulp::canvas::GlyphArrangement Class Reference

Glyph arrangement — the result of text layout, containing positioned glyphs for each line. More...

#include <text_layout.hpp>

Public Member Functions

 GlyphArrangement ()=default
void add_line (TextLine line)
 Add a line of laid-out text.
const std::vector< TextLine > & lines () const
 Get all lines.
int line_count () const
float total_width () const
 Get the bounding box of all laid-out text.
float total_height () const
size_t hit_test (float x, float y) const
 Find the text index nearest to a point (for cursor positioning).
float position_for_index (size_t index) const
 Get the x position for a given text index (for cursor rendering).
void clear ()
 Clear all layout data.

Detailed Description

Glyph arrangement — the result of text layout, containing positioned glyphs for each line.

This is the Pulp equivalent of shaped, laid-out text.

Uses Skia's HarfBuzz-based text shaper internally for:

  • Complex script shaping (Arabic, Devanagari, Thai, etc.)
  • Bidirectional text (via ICU)
  • Font fallback for missing glyphs
  • Kerning and ligatures

Constructor & Destructor Documentation

◆ GlyphArrangement()

pulp::canvas::GlyphArrangement::GlyphArrangement ( )
default

Member Function Documentation

◆ add_line()

void pulp::canvas::GlyphArrangement::add_line ( TextLine line)
inline

Add a line of laid-out text.

◆ clear()

void pulp::canvas::GlyphArrangement::clear ( )
inline

Clear all layout data.

◆ hit_test()

size_t pulp::canvas::GlyphArrangement::hit_test ( float x,
float y ) const

Find the text index nearest to a point (for cursor positioning).

◆ line_count()

int pulp::canvas::GlyphArrangement::line_count ( ) const
inline

◆ lines()

const std::vector< TextLine > & pulp::canvas::GlyphArrangement::lines ( ) const
inline

Get all lines.

◆ position_for_index()

float pulp::canvas::GlyphArrangement::position_for_index ( size_t index) const

Get the x position for a given text index (for cursor rendering).

◆ total_height()

float pulp::canvas::GlyphArrangement::total_height ( ) const
inline

◆ total_width()

float pulp::canvas::GlyphArrangement::total_width ( ) const
inline

Get the bounding box of all laid-out text.


The documentation for this class was generated from the following file:
  • /home/runner/work/pulp/pulp/core/canvas/include/pulp/canvas/text_layout.hpp