@ -6140,84 +6140,84 @@ namespace TMPro
}
}
// Search for the character in potential local Sprite Asset assigned to the text objec t.
if ( m_spriteAsset ! = null )
// Since we have been unable to locate the character thus far using the designated font style and weight. Attempt to locate this character using normal style and regular font weight to synthesize i t.
if ( fontStyle ! = FontStyles . Normal | | fontWeight ! = FontWeight . Regular )
{
TMP_SpriteChara cter spriteC haracter = TMP_FontAssetUtilities . GetSpriteCharacterFromSprite Asset ( unicode , m_spriteAsset , tru e) ;
character = TMP_FontAssetUtilities . GetCharacterFromFont Asset ( unicode , fontAsset , true , FontStyles . Normal , FontWeight . Regular , out isUsingAlternativeTypefac e) ;
if ( spriteCharacter ! = null )
return spriteCharacter ;
if ( character ! = null )
{
// Add character to font asset lookup cache
fontAsset . AddCharacterToLookupCache ( unicode , character , FontStyles . Normal , FontWeight . Regular , isUsingAlternativeTypeface ) ;
return character ;
}
// Search for the character in the list of fallback assigned in the TMP Settings (General Fallbacks).
// Search potential Global fallback font assets .
if ( TMP_Settings . fallbackFontAssets ! = null & & TMP_Settings . fallbackFontAssets . Count > 0 )
character = TMP_FontAssetUtilities . GetCharacterFromFontAssets ( unicode , fontAsset , TMP_Settings . fallbackFontAssets , true , fontStyle , fontWeight , out isUsingAlternativeTypeface ) ;
character = TMP_FontAssetUtilities . GetCharacterFromFontAssets ( unicode , fontAsset , TMP_Settings . fallbackFontAssets , true , FontStyles . Normal , FontWeight . Regular , out isUsingAlternativeTypeface ) ;
if ( character ! = null )
{
// Add character to font asset lookup cache
fontAsset . AddCharacterToLookupCache ( unicode , character , fontStyle , fontWeight , isUsingAlternativeTypeface ) ;
fontAsset . AddCharacterToLookupCache ( unicode , character , FontStyles . Normal , FontWeight . Regular , isUsingAlternativeTypeface ) ;
return character ;
}
// Search for the character in the Default Font Asset assigned in the TMP Settings file.
if ( TMP_Settings . defaultFontAsset ! = null )
character = TMP_FontAssetUtilities . GetCharacterFromFontAsset ( unicode , TMP_Settings . defaultFontAsset , true , fontStyle , fontWeight , out isUsingAlternativeTypeface ) ;
character = TMP_FontAssetUtilities . GetCharacterFromFontAsset ( unicode , TMP_Settings . defaultFontAsset , true , FontStyles . Normal , FontWeight . Regular , out isUsingAlternativeTypeface ) ;
if ( character ! = null )
{
// Add character to font asset lookup cache
fontAsset . AddCharacterToLookupCache ( unicode , character , fontStyle , fontWeight , isUsingAlternativeTypeface ) ;
fontAsset . AddCharacterToLookupCache ( unicode , character , FontStyles . Normal , FontWeight . Regular , isUsingAlternativeTypeface ) ;
return character ;
}
}
// Search for the character in the Default Sprite Asset assigned in the TMP Settings file .
if ( TMP_Settings . defaultS priteAsset ! = null )
// Search for the character in potential local Sprite Asset assigned to the text object .
if ( m_s priteAsset ! = null )
{
TMP_SpriteCharacter spriteCharacter = TMP_FontAssetUtilities . GetSpriteCharacterFromSpriteAsset ( unicode , TMP_Settings . defaultS priteAsset, true ) ;
TMP_SpriteCharacter spriteCharacter = TMP_FontAssetUtilities . GetSpriteCharacterFromSpriteAsset ( unicode , m_s priteAsset, true ) ;
if ( spriteCharacter ! = null )
return spriteCharacter ;
}
// Since we have been unable to locate the character thus far using the designated font style and weight. Attempt to locate this character using normal style and regular font weight in order to synthesize it.
if ( fontStyle ! = FontStyles . Normal | | fontWeight ! = FontWeight . Regular )
{
character = TMP_FontAssetUtilities . GetCharacterFromFontAsset ( unicode , fontAsset , true , FontStyles . Normal , FontWeight . Regular , out isUsingAlternativeTypeface ) ;
if ( character ! = null )
{
// Add character to font asset lookup cache
fontAsset . AddCharacterToLookupCache ( unicode , character , FontStyles . Normal , FontWeight . Regular , isUsingAlternativeTypeface ) ;
return character ;
}
// Search potential Global fallback font assets.
// Search for the character in the list of fallback assigned in the TMP Settings (General Fallbacks).
if ( TMP_Settings . fallbackFontAssets ! = null & & TMP_Settings . fallbackFontAssets . Count > 0 )
character = TMP_FontAssetUtilities . GetCharacterFromFontAssets ( unicode , fontAsset , TMP_Settings . fallbackFontAssets , true , FontStyles . Normal , FontWeight . Regular , out isUsingAlternativeTypeface ) ;
character = TMP_FontAssetUtilities . GetCharacterFromFontAssets ( unicode , fontAsset , TMP_Settings . fallbackFontAssets , true , fontStyle , fontWeight , out isUsingAlternativeTypeface ) ;
if ( character ! = null )
{
// Add character to font asset lookup cache
fontAsset . AddCharacterToLookupCache ( unicode , character , FontStyles . Normal , FontWeight . Regular , isUsingAlternativeTypeface ) ;
fontAsset . AddCharacterToLookupCache ( unicode , character , fontStyle , fontWeight , isUsingAlternativeTypeface ) ;
return character ;
}
// Search for the character in the Default Font Asset assigned in the TMP Settings file.
if ( TMP_Settings . defaultFontAsset ! = null )
character = TMP_FontAssetUtilities . GetCharacterFromFontAsset ( unicode , TMP_Settings . defaultFontAsset , true , FontStyles . Normal , FontWeight . Regular , out isUsingAlternativeTypeface ) ;
character = TMP_FontAssetUtilities . GetCharacterFromFontAsset ( unicode , TMP_Settings . defaultFontAsset , true , fontStyle , fontWeight , out isUsingAlternativeTypeface ) ;
if ( character ! = null )
{
// Add character to font asset lookup cache
fontAsset . AddCharacterToLookupCache ( unicode , character , FontStyles . Normal , FontWeight . Regular , isUsingAlternativeTypeface ) ;
fontAsset . AddCharacterToLookupCache ( unicode , character , fontStyle , fontWeight , isUsingAlternativeTypeface ) ;
return character ;
}
// Search for the character in the Default Sprite Asset assigned in the TMP Settings file.
if ( TMP_Settings . defaultSpriteAsset ! = null )
{
TMP_SpriteCharacter spriteCharacter = TMP_FontAssetUtilities . GetSpriteCharacterFromSpriteAsset ( unicode , TMP_Settings . defaultSpriteAsset , true ) ;
if ( spriteCharacter ! = null )
return spriteCharacter ;
}
return null ;