Jazz2::UI::Windows::Context struct

What the interface is measured with.

Public static functions

static auto GetFont(float scale) -> UI::Font*
Returns the font of the interface at a scale of the interface.

Public functions

auto Px(float units) const -> float
Converts units to whole pixels.
auto MeasureText(StringView text) const -> float
Returns the width of a text in pixels.
auto GetTextHeight() const -> float
Returns the height of a line of text in pixels.

Public variables

float Scale
Pixels per unit.

Function documentation

static UI::Font* Jazz2::UI::Windows::Context::GetFont(float scale)

Returns the font of the interface at a scale of the interface.

The readable font drawn for the scale if Theme::ReadableFont is set and it can be read, otherwise the pixel font of the game. It's not kept anywhere, the fonts that have the palette baked in are dropped when a level with another palette is loaded, and the readable font of a scale no longer used goes too.