Donner
C++20 SVG rendering library
Loading...
Searching...
No Matches
donner::FontMetrics Struct Reference

A container for font information relevant for computing font-relative lengths, per https://www.w3.org/TR/css-values/#font-relative-lengths. More...

#include "donner/base/RelativeLengthMetrics.h"

Public Member Functions

double exUnit () const
 The value of an "ex" unit.
 
double chUnit () const
 The value of a "ch" unit.
 

Static Public Member Functions

static FontMetrics DefaultsWithFontSize (double fontSize)
 Construct a FontMetrics with default values for a given font size.
 

Public Attributes

double fontSize = 16.0f
 "em" measurement.
 
double rootFontSize = 16.0f
 The font-size of the root element, "rem".
 
double exUnitInEm = 0.5f
 x-height measurement.
 
double chUnitInEm
 Equal to the used advance measure of the "0" glyph in the font used to render it.
 

Detailed Description

A container for font information relevant for computing font-relative lengths, per https://www.w3.org/TR/css-values/#font-relative-lengths.

Member Function Documentation

◆ DefaultsWithFontSize()

static FontMetrics donner::FontMetrics::DefaultsWithFontSize ( double fontSize)
inlinestatic

Construct a FontMetrics with default values for a given font size.

Parameters
fontSizeThe font size to use for the default values.

Member Data Documentation

◆ chUnitInEm

double donner::FontMetrics::chUnitInEm
Initial value:
=
0.5f

Equal to the used advance measure of the "0" glyph in the font used to render it.


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