|
FlowArithmeticCalculator 1.0.0
Flow Arithmetic Calculator
|
Utility class that holds static font instances and handles scaling them on window resizes. More...
#include <FontManager.h>
Collaboration diagram for gui::renderer::FontManager:Static Public Member Functions | |
| static void | recalculateFontSizes (float aspectX, float aspectY, float xScale, float yScale) |
| Recalculates the font sizes. | |
| static const SkFont & | getFontForVariant (const business_logic::components::UIText::Variant &variant) |
| Gets the font for the given variant. | |
Static Public Attributes | |
| static SkPaint | textFontFillPaint |
| The paint for the text font fill. | |
| static SkPaint | textFontStrokePaint |
| The paint for the text font stroke. | |
| static SkFont | menuChoiceFont |
| The font for the menu choice font. | |
| static SkFont | menuHeadlineFont |
| The font for the menu headline font. | |
| static SkFont | menuCaptionFont |
| The font for the menu caption font. | |
| static SkFont | captionFont |
| The font for the caption font. | |
Static Private Attributes | |
| static sk_sp< SkTypeface > | typeface |
| The typeface for the text font. | |
| static sk_sp< SkFontMgr > | fontMgr |
| The font manager. | |
Utility class that holds static font instances and handles scaling them on window resizes.
Definition at line 38 of file FontManager.h.
|
static |
Gets the font for the given variant.
| variant | The variant of the label |
Definition at line 89 of file FontManager.cpp.
References business_logic::components::UIText::Caption, captionFont, business_logic::components::UIText::Choice, business_logic::components::UIText::Headline, business_logic::components::UIText::MenuCaption, menuCaptionFont, menuChoiceFont, and menuHeadlineFont.
Referenced by gui::elements::SkiaBaseBlockRenderer::render().
Here is the caller graph for this function:
|
static |
Recalculates the font sizes.
This method adapts the font sizes by multiplying them by the a scale factor.
The scale factor is calculated according to the following formula:
scaling = min(aspectX, aspectY) * min(xScale, yScale)
| aspectX | The aspect ratio of the window width to the base width (constants::FONT_ASPECT_BASE_WINDOW_WIDTH) |
| aspectY | The aspect ratio of the window height to the base height (constants::FONT_ASPECT_BASE_WINDOW_HEIGHT) |
| xScale | The scale factor for the X axis |
| yScale | The scale factor for the Y axis |
Definition at line 77 of file FontManager.cpp.
References gui::constants::CAPTION_FONT_SIZE_BASE, captionFont, gui::constants::MENU_CAPTION_FONT_SIZE_BASE, gui::constants::MENU_CHOICE_FONT_SIZE_BASE, gui::constants::MENU_HEADLINE_FONT_SIZE_BASE, menuCaptionFont, menuChoiceFont, and menuHeadlineFont.
Referenced by gui::renderer::SkiaRendererImpl::handleWindowResized().
Here is the caller graph for this function:
|
static |
The font for the caption font.
Definition at line 68 of file FontManager.h.
Referenced by getFontForVariant(), recalculateFontSizes(), and gui::elements::SkiaBaseBlockRenderer::renderValueAboveBlock().
|
staticprivate |
The font manager.
Definition at line 105 of file FontManager.h.
|
static |
The font for the menu caption font.
Definition at line 63 of file FontManager.h.
Referenced by getFontForVariant(), and recalculateFontSizes().
|
static |
The font for the menu choice font.
Definition at line 53 of file FontManager.h.
Referenced by getFontForVariant(), and recalculateFontSizes().
|
static |
The font for the menu headline font.
Definition at line 58 of file FontManager.h.
Referenced by getFontForVariant(), and recalculateFontSizes().
|
static |
The paint for the text font fill.
Definition at line 43 of file FontManager.h.
Referenced by gui::elements::SkiaBaseBlockRenderer::renderValueAboveBlock().
|
static |
The paint for the text font stroke.
Definition at line 48 of file FontManager.h.
|
staticprivate |
The typeface for the text font.
Definition at line 100 of file FontManager.h.