1.26.2.1
Prysm
cohtml::UserFontDescription Struct Reference

Struct representing user font data. Baseline is 0. More...

Classes

struct  CharInfo
 Struct representing data for individual char. More...
 
struct  KerningPairInfo
 Struct representing kerning info between chars. More...
 

Public Member Functions

 UserFontDescription ()
 

Public Attributes

Fonts::UserFontType FontType
 The font type that's going to be used for loading and rendering. More...
 
const char * FontFamily
 The font family. More...
 
unsigned Size
 The font size in which the glyph are generated. In pixels. More...
 
unsigned Spread
 The font spread size with which the glyphs are generated. It shows us how many pixels does it take to cover the [0-0.5] distance field range. In pixels. More...
 
Fonts::FontWeight Weight
 The font weight. More...
 
bool IsBold
 Whether this is a bold font. More...
 
bool IsItalic
 Whether this is an italic font. More...
 
float LineHeight
 The line height of the font according to the Size of the font. In pixels. More...
 
float Ascent
 The ascent of the font (the distance from the baseline to the tops of the tallest glyphs). Positive number. In pixels. More...
 
float Descent
 The descent of the font (the distance from the baseline to the bottoms of the lowest glyphs). Negative number. In pixels. More...
 
CharInfoChars
 Pointer to the char info data. More...
 
unsigned NumChars
 Number of chars in this font. More...
 
KerningPairInfoKerningPairs
 Pointer to kerning info. More...
 
unsigned NumKerningPairs
 Number of kerning pairs. More...
 

Detailed Description

Struct representing user font data. Baseline is 0.

Constructor & Destructor Documentation

◆ UserFontDescription()

cohtml::UserFontDescription::UserFontDescription ( )
inline

Member Data Documentation

◆ Ascent

float cohtml::UserFontDescription::Ascent

The ascent of the font (the distance from the baseline to the tops of the tallest glyphs). Positive number. In pixels.

◆ Chars

CharInfo* cohtml::UserFontDescription::Chars

Pointer to the char info data.

◆ Descent

float cohtml::UserFontDescription::Descent

The descent of the font (the distance from the baseline to the bottoms of the lowest glyphs). Negative number. In pixels.

◆ FontFamily

const char* cohtml::UserFontDescription::FontFamily

The font family.

◆ FontType

Fonts::UserFontType cohtml::UserFontDescription::FontType

The font type that's going to be used for loading and rendering.

◆ IsBold

bool cohtml::UserFontDescription::IsBold

Whether this is a bold font.

Note
Ignored when Weight is specified (not Auto)

◆ IsItalic

bool cohtml::UserFontDescription::IsItalic

Whether this is an italic font.

◆ KerningPairs

KerningPairInfo* cohtml::UserFontDescription::KerningPairs

Pointer to kerning info.

Note
Kerning info is optional. If no info is present for given pair an implicit 0 amount of kerning is used. Kerning info is needed only for pairs with amount different from 0.

◆ LineHeight

float cohtml::UserFontDescription::LineHeight

The line height of the font according to the Size of the font. In pixels.

◆ NumChars

unsigned cohtml::UserFontDescription::NumChars

Number of chars in this font.

◆ NumKerningPairs

unsigned cohtml::UserFontDescription::NumKerningPairs

Number of kerning pairs.

◆ Size

unsigned cohtml::UserFontDescription::Size

The font size in which the glyph are generated. In pixels.

◆ Spread

unsigned cohtml::UserFontDescription::Spread

The font spread size with which the glyphs are generated. It shows us how many pixels does it take to cover the [0-0.5] distance field range. In pixels.

Note
Spread specifies how many pixels does the distance field spread from the border(between inside and outside of a letter) to the outside. Therefore it maps to the [0-0.5] range. Some tools consider spread to be double the above distance - from end to end and is mapped to the [0-1] range. If that's the case then that spread should be halved when used here.

◆ Weight

Fonts::FontWeight cohtml::UserFontDescription::Weight

The font weight.