LASi
Public Member Functions | Private Attributes | List of all members
StringDimensions Class Reference

Class StringDimensions maintains the relevant dimensions of a text string realized (i.e., drawn) in a given font face and font size. More...

#include <stringDimensions.h>

Public Member Functions

 StringDimensions (double xAdv=0.0, double yMin=0.0, double yMax=0.0, double spacingFactor=1.2)
 
void accrueXAdvance (const double xAdv)
 Sum up the individual x advances of each glyph: More...
 
void setYMin (const double yMin)
 Keep a running tab on the minimum y value (descent) from all glyphs: More...
 
void setYMax (const double yMax)
 Keep a running tab on the maximum y value (ascent) from all glyphs: More...
 
const double getXAdvance ()
 
const double getYMin ()
 
const double getYMax ()
 
const double getLineSpacing ()
 Line spacing is just the maximum ascent minus the maximum descent multiplied by the line spacing factor: More...
 

Private Attributes

double xadv
 
double ymin
 
double ymax
 
double lineSpacingFactor
 

Detailed Description

Class StringDimensions maintains the relevant dimensions of a text string realized (i.e., drawn) in a given font face and font size.

Used internally by LASi.

Constructor & Destructor Documentation

◆ StringDimensions()

StringDimensions::StringDimensions ( double  xAdv = 0.0,
double  yMin = 0.0,
double  yMax = 0.0,
double  spacingFactor = 1.2 
)
inline

Member Function Documentation

◆ accrueXAdvance()

void StringDimensions::accrueXAdvance ( const double  xAdv)
inline

Sum up the individual x advances of each glyph:

Referenced by LASi::PostscriptDocument::accrue_dimensions().

◆ getLineSpacing()

const double StringDimensions::getLineSpacing ( )
inline

Line spacing is just the maximum ascent minus the maximum descent multiplied by the line spacing factor:

References lineSpacingFactor.

Referenced by LASi::PostscriptDocument::get_dimensions().

◆ getXAdvance()

const double StringDimensions::getXAdvance ( )
inline

◆ getYMax()

const double StringDimensions::getYMax ( )
inline

◆ getYMin()

const double StringDimensions::getYMin ( )
inline

◆ setYMax()

void StringDimensions::setYMax ( const double  yMax)
inline

Keep a running tab on the maximum y value (ascent) from all glyphs:

Referenced by LASi::PostscriptDocument::accrue_dimensions().

◆ setYMin()

void StringDimensions::setYMin ( const double  yMin)
inline

Keep a running tab on the minimum y value (descent) from all glyphs:

Referenced by LASi::PostscriptDocument::accrue_dimensions().

Member Data Documentation

◆ lineSpacingFactor

double StringDimensions::lineSpacingFactor
private

Referenced by getLineSpacing().

◆ xadv

double StringDimensions::xadv
private

Referenced by getXAdvance().

◆ ymax

double StringDimensions::ymax
private

Referenced by getYMax().

◆ ymin

double StringDimensions::ymin
private

Referenced by getYMin().


The documentation for this class was generated from the following file: