Inviwo  0.9.10.1
Inviwo documentation
inviwo::TextBoundingBox Struct Reference

struct for holding bounding box information for a specific text More...

#include <textboundingbox.h>

Public Member Functions

 TextBoundingBox (const size2_t &textExt, const ivec2 &glyphsOrigin, const size2_t &glyphsExt, int baselineOffset)
 
void updateGlyphPenOffset (int baselineOffset)
 

Public Attributes

size2_t textExtent {0}
 
ivec2 glyphsOrigin {0}
 relative origin of bottom-left most glyph
 
size2_t glyphsExtent
 extent of bbox containing all glyphs extending to top right corner More...
 
ivec2 glyphPenOffset {0}
 pen offset to align first glyph perfectly on first baseline
 

Detailed Description

struct for holding bounding box information for a specific text

The textual bounding box for a string has its origin (0,0) at the bottom-left corner and is given by its extent. The bounding box enclosing all glyphs has its own origin relative to (0,0). The first line starts at (0,0) + textExtent.y - ascender (i.e. getBaseLineOffset()).

The glyph bounding box might be larger than the textual bounding box. It is guaranteed to enclose all glyphs including overhang, e.g. caused by italic glyphs or glyphs exceeding ascend and descend.

Member Data Documentation

◆ glyphsExtent

size2_t inviwo::TextBoundingBox::glyphsExtent
Initial value:
{
0}

extent of bbox containing all glyphs extending to top right corner


The documentation for this struct was generated from the following files: