2 using System.Collections;
3 using System.Collections.Generic;
6 #pragma warning disable 0649 // Disabled warnings related to serialized fields not assigned in this script but used in the editor. 21 get {
return "1.3.0"; }
29 get {
return instance.m_enableWordWrapping; }
32 private bool m_enableWordWrapping;
39 get {
return instance.m_enableKerning; }
42 private bool m_enableKerning;
49 get {
return instance.m_enableExtraPadding; }
52 private bool m_enableExtraPadding;
59 get {
return instance.m_enableTintAllSprites; }
62 private bool m_enableTintAllSprites;
69 get {
return instance.m_enableParseEscapeCharacters; }
72 private bool m_enableParseEscapeCharacters;
79 get {
return instance.m_missingGlyphCharacter; }
82 private int m_missingGlyphCharacter;
89 get {
return instance.m_warningsDisabled; }
92 private bool m_warningsDisabled;
99 get {
return instance.m_defaultFontAsset; }
109 get {
return instance.m_defaultFontAssetPath; }
112 private string m_defaultFontAssetPath;
119 get {
return instance.m_defaultFontSize; }
122 private float m_defaultFontSize;
129 get {
return instance.m_defaultAutoSizeMinRatio; }
132 private float m_defaultAutoSizeMinRatio;
139 get {
return instance.m_defaultAutoSizeMaxRatio; }
142 private float m_defaultAutoSizeMaxRatio;
149 get {
return instance.m_defaultTextMeshProTextContainerSize; }
152 private Vector2 m_defaultTextMeshProTextContainerSize;
159 get {
return instance.m_defaultTextMeshProUITextContainerSize; }
162 private Vector2 m_defaultTextMeshProUITextContainerSize;
169 get {
return instance.m_autoSizeTextContainer; }
172 private bool m_autoSizeTextContainer;
179 get {
return instance.m_fallbackFontAssets; }
182 private List<TMP_FontAsset> m_fallbackFontAssets;
189 get {
return instance.m_matchMaterialPreset; }
192 private bool m_matchMaterialPreset;
199 get {
return instance.m_defaultSpriteAsset; }
209 get {
return instance.m_defaultSpriteAssetPath; }
212 private string m_defaultSpriteAssetPath;
219 get {
return instance.m_defaultColorGradientPresetsPath; }
222 private string m_defaultColorGradientPresetsPath;
229 get {
return instance.m_enableEmojiSupport; }
230 set {
instance.m_enableEmojiSupport = value; }
233 private bool m_enableEmojiSupport;
240 get {
return instance.m_defaultStyleSheet; }
250 get {
return instance.m_leadingCharacters; }
253 private TextAsset m_leadingCharacters;
260 get {
return instance.m_followingCharacters; }
263 private TextAsset m_followingCharacters;
272 if (
instance.m_linebreakingRules ==
null)
273 LoadLinebreakingRules();
275 return instance.m_linebreakingRules;
279 private LineBreakingTable m_linebreakingRules;
297 PackageResourceImporterWindow.ShowPackageImporterWindow();
313 if (s_Instance ==
null)
317 if (settings !=
null)
318 s_Instance = settings;
373 public static void LoadLinebreakingRules()
379 if (s_Instance.m_linebreakingRules ==
null)
380 s_Instance.m_linebreakingRules =
new LineBreakingTable();
382 s_Instance.m_linebreakingRules.leadingCharacters =
GetCharacters(s_Instance.m_leadingCharacters);
383 s_Instance.m_linebreakingRules.followingCharacters =
GetCharacters(s_Instance.m_followingCharacters);
394 Dictionary<int, char> dict =
new Dictionary<int, char>();
395 string text = file.text;
397 for (
int i = 0; i < text.Length; i++)
401 if (dict.ContainsKey((
int)c) ==
false)
416 public Dictionary<int, char> leadingCharacters;
417 public Dictionary<int, char> followingCharacters;
static string version
Returns the release version of the product.
static bool enableKerning
Controls if Kerning is enabled on newly created text objects by default.
static string defaultFontAssetPath
The relative path to a Resources folder in the project.
static bool enableParseEscapeCharacters
Controls if Escape Characters will be parsed in the Text Input Box on newly created text objects.
static TMP_StyleSheet defaultStyleSheet
The Default Style Sheet used by the text objects.
static bool autoSizeTextContainer
Set the size of the text container of newly created text objects to match the size of the text.
static TextAsset followingCharacters
Text file that contains the following characters used for line breaking for Asian languages.
static float defaultFontSize
The Default Point Size of newly created text objects.
static string defaultSpriteAssetPath
The relative path to a Resources folder in the project.
static Vector2 defaultTextMeshProTextContainerSize
The Default Size of the Text Container of a TextMeshPro object.
static TMP_FontAsset defaultFontAsset
Returns the Default Font Asset to be used by newly created text objects.
static TMP_Settings instance
Get a singleton instance of the settings class.
static TMP_FontAsset GetFontAsset()
Returns the Font Asset defined in the TMP Settings file.
static TMP_SpriteAsset GetSpriteAsset()
Returns the Sprite Asset defined in the TMP Settings file.
static TMP_Settings GetSettings()
Returns the Sprite Asset defined in the TMP Settings file.
static bool enableTintAllSprites
Controls if TintAllSprites is enabled on newly created text objects by default.
static int missingGlyphCharacter
The character the will be used as a replacement for missing glyphs in a font asset.
static bool enableEmojiSupport
Determines if Emoji support is enabled in the Input Field TouchScreenKeyboard.
static bool enableWordWrapping
Controls if Word Wrapping will be enabled on newly created text objects by default.
static bool enableExtraPadding
Controls if Extra Padding is enabled on newly created text objects by default.
static TextAsset leadingCharacters
Text file that contains the leading characters used for line breaking for Asian languages.
static bool matchMaterialPreset
Controls whether or not TMP will create a matching material preset or use the default material of the...
static Vector2 defaultTextMeshProUITextContainerSize
The Default Width of the Text Container of a TextMeshProUI object.
static TMP_Settings LoadDefaultSettings()
Static Function to load the TMP Settings file.
static float defaultTextAutoSizingMaxRatio
The multiplier used to computer the default Max point size when Text Auto Sizing is used.
static bool warningsDisabled
Controls the display of warning message in the console.
static string defaultColorGradientPresetsPath
The relative path to a Resources folder in the project that contains Color Gradient Presets.
static float defaultTextAutoSizingMinRatio
The multiplier used to computer the default Min point size when Text Auto Sizing is used.
static TMP_StyleSheet GetStyleSheet()
Returns the Sprite Asset defined in the TMP Settings file.
static List< TMP_FontAsset > fallbackFontAssets
Returns the list of Fallback Fonts defined in the TMP Settings file.
static TMP_SpriteAsset defaultSpriteAsset
The Default Sprite Asset to be used by default.
static Dictionary< int, char > GetCharacters(TextAsset file)
Get the characters from the line breaking files
static LineBreakingTable linebreakingRules