FontScaling Class Reference

#include <font_scaling.h>

Detailed Description

Provides utilities for querying and scaling font dimensions across platforms. All methods are static and operate on reference font sizes and scale factors.

Static Public Member Functions

static MAXON_METHOD Float GetReferenceFontSize ()
 
static MAXON_METHOD Float GetReferenceFontHeight ()
 
static MAXON_METHOD Int32 GetFontHeight (const OSFontDefinition &fontDef)
 
static MAXON_METHOD Float GetFontScale (Opt< Float > fontSize={})
 
static MAXON_METHOD Float ScaleDimension (Float dimension, Opt< Float > fontSize={})
 
static MAXON_METHOD Int32 ScaleDimension (Int32 dimension, Opt< Float > fontSize={})
 

Private Member Functions

 MAXON_INTERFACE_NONVIRTUAL (FontScaling, MAXON_REFERENCE_STATIC, "net.maxon.interface.fontscaling")
 

Member Function Documentation

◆ MAXON_INTERFACE_NONVIRTUAL()

MAXON_INTERFACE_NONVIRTUAL ( FontScaling  ,
MAXON_REFERENCE_STATIC  ,
"net.maxon.interface.fontscaling"   
)
private

◆ GetReferenceFontSize()

static MAXON_METHOD Float GetReferenceFontSize ( )
static

Returns the reference font size used as the baseline for scaling calculations.

◆ GetReferenceFontHeight()

static MAXON_METHOD Float GetReferenceFontHeight ( )
static

Returns the reference font height in pixels.

◆ GetFontHeight()

static MAXON_METHOD Int32 GetFontHeight ( const OSFontDefinition &  fontDef)
static

Returns the font height in pixels for the given OS font definition.

Parameters
fontDefThe OS font definition to measure.
Returns
The font height in pixels as an Int32.

◆ GetFontScale()

static MAXON_METHOD Float GetFontScale ( Opt< Float >  fontSize = {})
static

Computes the font scale multiplier based on the optional font size parameter.

Parameters
fontSizeOptional font size override; if omitted, uses the font size defined in preferences.
Returns
The computed scale factor as a Float.

◆ ScaleDimension() [1/2]

static MAXON_METHOD Float ScaleDimension ( Float  dimension,
Opt< Float >  fontSize = {} 
)
static

Scales a floating-point dimension value by the computed font scale factor.

Parameters
dimensionThe dimension value to scale.
fontSizeOptional font size override; if omitted, uses the font size defined in preferences.
Returns
The scaled dimension as a Float.

◆ ScaleDimension() [2/2]

static MAXON_METHOD Int32 ScaleDimension ( Int32  dimension,
Opt< Float >  fontSize = {} 
)
static

Scales an integer dimension value by the computed font scale factor.

Parameters
dimensionThe integer dimension value to scale.
fontSizeOptional font size override; if omitted, uses the font size defined in preferences.
Returns
The scaled dimension as an Int32.