Inkscape
Vector Graphics Editor
|
Keep track of font metrics. More...
#include <Layout-TNG.h>
Public Member Functions | |
FontMetrics () | |
void | reset () |
void | set (FontInstance const *font) |
double | emSize () const |
double | lineSize () const |
void | setZero () |
FontMetrics & | operator*= (double x) |
void | max (FontMetrics const &other) |
Save the larger values of ascent and descent between this and other. | |
void | computeEffective (const double &line_height) |
Calculate the effective ascent and descent including half "leading". | |
double | getTypoAscent () const |
double | getTypoDescent () const |
double | getXHeight () const |
double | getMaxAscent () const |
double | getMaxDescent () const |
Public Attributes | |
double | ascent |
double | descent |
double | xheight |
double | ascent_max |
double | descent_max |
Keep track of font metrics.
Two use cases:
Note: Leading refers to the "external" leading which is added (subtracted) due to a computed value of 'line-height' that differs from 'font-size'. "Internal" leading which is specified inside a font is not used in CSS. The 'font-size' is based on the font's em size which is 'ascent' + 'descent'.
This structure was renamed (and modified) from "LineHeight".
It's useful for this to be public so that ScanlineMaker can use it.
Definition at line 624 of file Layout-TNG.h.
|
inline |
Definition at line 627 of file Layout-TNG.h.
References reset().
Referenced by Inkscape::Text::Layout::_calculateCursorShapeForEmpty().
void Inkscape::Text::Layout::FontMetrics::computeEffective | ( | const double & | line_height | ) |
Calculate the effective ascent and descent including half "leading".
Definition at line 110 of file Layout-TNG-Output.cpp.
Referenced by SPText::_buildLayoutInit(), and SPFlowtext::_buildLayoutInput().
|
inline |
Definition at line 640 of file Layout-TNG.h.
References ascent, and descent.
Referenced by Inkscape::Text::Layout::InfiniteScanlineMaker::completeLine(), Inkscape::Text::Layout::ShapeScanlineMaker::makeScanline(), operator<<(), operator<<(), Inkscape::Text::Layout::queryCursorShape(), and Inkscape::Text::Layout::ShapeScanlineMaker::setLineHeight().
|
inline |
Definition at line 661 of file Layout-TNG.h.
References ascent_max.
|
inline |
Definition at line 662 of file Layout-TNG.h.
References descent_max.
|
inline |
Definition at line 658 of file Layout-TNG.h.
References ascent.
|
inline |
Definition at line 659 of file Layout-TNG.h.
References descent.
|
inline |
Definition at line 660 of file Layout-TNG.h.
References xheight.
|
inline |
Definition at line 642 of file Layout-TNG.h.
void Inkscape::Text::Layout::FontMetrics::max | ( | FontMetrics const & | other | ) |
Save the larger values of ascent and descent between this and other.
Needed for laying out a line with mixed font-sizes, fonts, or line spacings.
Definition at line 101 of file Layout-TNG-Output.cpp.
References ascent, ascent_max, descent, descent_max, and xheight.
Referenced by Inkscape::Text::Layout::getNearestCursorPositionTo().
|
inline |
Definition at line 646 of file Layout-TNG.h.
References ascent, ascent_max, descent, descent_max, and xheight.
|
inline |
Definition at line 629 of file Layout-TNG.h.
References ascent, ascent_max, descent, descent_max, and xheight.
Referenced by SPText::_buildLayoutInit(), SPFlowtext::_buildLayoutInput(), and FontMetrics().
void Inkscape::Text::Layout::FontMetrics::set | ( | FontInstance const * | font | ) |
Definition at line 90 of file Layout-TNG-Output.cpp.
References ascent, ascent_max, descent, descent_max, FontInstance::GetMaxAscent(), FontInstance::GetMaxDescent(), FontInstance::GetTypoAscent(), FontInstance::GetTypoDescent(), FontInstance::GetXHeight(), and xheight.
|
inline |
Definition at line 643 of file Layout-TNG.h.
References ascent, ascent_max, descent, descent_max, and xheight.
Referenced by Inkscape::Text::Layout::InfiniteScanlineMaker::InfiniteScanlineMaker().
double Inkscape::Text::Layout::FontMetrics::ascent |
Definition at line 665 of file Layout-TNG.h.
Referenced by SPText::_buildLayoutInit(), SPFlowtext::_buildLayoutInput(), Inkscape::Text::Layout::_calculateCursorShapeForEmpty(), Inkscape::Text::Layout::characterBoundingBox(), emSize(), Inkscape::Text::Layout::getNearestCursorPositionTo(), getTypoAscent(), lineSize(), max(), operator*=(), operator<<(), operator<<(), reset(), set(), and setZero().
double Inkscape::Text::Layout::FontMetrics::ascent_max |
Definition at line 668 of file Layout-TNG.h.
Referenced by getMaxAscent(), max(), operator*=(), reset(), set(), and setZero().
double Inkscape::Text::Layout::FontMetrics::descent |
Definition at line 666 of file Layout-TNG.h.
Referenced by SPText::_buildLayoutInit(), SPFlowtext::_buildLayoutInput(), Inkscape::Text::Layout::_calculateCursorShapeForEmpty(), Inkscape::Text::Layout::characterBoundingBox(), emSize(), Inkscape::Text::Layout::getNearestCursorPositionTo(), getTypoDescent(), lineSize(), max(), operator*=(), operator<<(), operator<<(), Inkscape::Text::Layout::queryCursorShape(), reset(), set(), and setZero().
double Inkscape::Text::Layout::FontMetrics::descent_max |
Definition at line 669 of file Layout-TNG.h.
Referenced by getMaxDescent(), max(), operator*=(), reset(), set(), and setZero().
double Inkscape::Text::Layout::FontMetrics::xheight |
Definition at line 667 of file Layout-TNG.h.
Referenced by SPText::_buildLayoutInit(), SPFlowtext::_buildLayoutInput(), Inkscape::Text::Layout::_calculateCursorShapeForEmpty(), getXHeight(), max(), operator*=(), operator<<(), operator<<(), reset(), set(), and setZero().