EasyTalk API
Loading...
Searching...
No Matches
EasyTalk.Utils.ComponentFontManager Class Reference

This class is used to manage font updates on Text and TextMeshPro components, such as the font size to use and the font to use for a particular language. More...

Static Public Member Functions

static void UpdateFonts (Component component, LanguageFontOverride fontOverride)
 Updates the font of each text component in the specified component and its children using the specified font settings, or the component's original font if no font is available.
 

Static Private Member Functions

static void HandleTextLocalizableFontCustomizations (Text text, Dictionary< int, LocalizableComponent > componentMapping, LanguageFontOverride baseSettingsFontOverride)
 Applies settings to the specified Text component based on the current language and overridden font settings, if the text component is mapped to
a LocalizableComponent which overrides settings.
 
static Dictionary< int, LocalizableComponentGetLocalizableTextComponentMap (Component component)
 Returns a mapping of Text component instance IDs to LocalizableComponent parents of those components, where the LocalizableComponents are children of the component passed in to this method.
 

Static Private Attributes

static Dictionary< int, TextFontSettings > originalFonts = new Dictionary<int, TextFontSettings>()
 A mapping of component instance IDs to the fonts which they originally used. This is used to revert components when the language is changed.
 

Detailed Description

This class is used to manage font updates on Text and TextMeshPro components, such as the font size to use and the font to use for a particular language.

Member Function Documentation

◆ GetLocalizableTextComponentMap()

static Dictionary< int, LocalizableComponent > EasyTalk.Utils.ComponentFontManager.GetLocalizableTextComponentMap ( Component component)
staticprivate

Returns a mapping of Text component instance IDs to LocalizableComponent parents of those components, where the LocalizableComponents are children of the component passed in to this method.

Parameters
componentThe parent component to retrieve mappings for.
Returns
A mapping of Text component instance IDs to the LocalizableComponent which controls or parents them.

◆ HandleTextLocalizableFontCustomizations()

static void EasyTalk.Utils.ComponentFontManager.HandleTextLocalizableFontCustomizations ( Text text,
Dictionary< int, LocalizableComponent > componentMapping,
LanguageFontOverride baseSettingsFontOverride )
staticprivate

Applies settings to the specified Text component based on the current language and overridden font settings, if the text component is mapped to
a LocalizableComponent which overrides settings.

Parameters
textThe Text component to modify.
componentMappingA mapping of Text component instance IDs to LocalizableComponents. If no mapping exists for the provided
Text component, this method will return without making modifications.
baseSettingsFontOverrideThe LanguageFontOverride set on EasyTalk Dialogue Settings.

◆ UpdateFonts()

static void EasyTalk.Utils.ComponentFontManager.UpdateFonts ( Component component,
LanguageFontOverride fontOverride )
static

Updates the font of each text component in the specified component and its children using the specified font settings, or the component's original font if no font is available.

Parameters
componentThe component to update fonts on.
fontOverrideThe font override settings to use.

Member Data Documentation

◆ originalFonts

Dictionary<int, TextFontSettings> EasyTalk.Utils.ComponentFontManager.originalFonts = new Dictionary<int, TextFontSettings>()
staticprivate

A mapping of component instance IDs to the fonts which they originally used. This is used to revert components when the language is changed.