Change TextMesh Pro material preset on localizatio

More
7 years 8 months ago - 7 years 8 months ago #2112 by Eze
Hi,

I'm using I2 Localization (2.6.10 f1) with TextMesh Pro (1.0.55.0b7) and I'm trying to figure out how to change the font with it's non default material preset.

I've got two languages. Both are using different fonts. Each TMPro font has two material presets. Default one and customized one that I'm using in a few places throughout the project.
When secondary term is set to Text Mesh Pro Font the font changes as it should but sets each Text Mesh Pro font to default material preset. So my customized material preset is replaced.

I tried using material as the secondary term but it didn't change the font.

Is there any way to select material preset for localization?

(Unity 5.5.2p2)
Last edit: 7 years 8 months ago by Eze.

Please Log in or Create an account to join the conversation.

More
7 years 8 months ago #2115 by Frank
Hi,

If you set a material as the secondary Term with a reference to the material, it will load automatically the font matching that material.

However, there was an issue where the font HAD to be only in the root of the Resources folder, otherwise it wont find it.
I changed that so that it will look for it in the same folder than the material.

You can download that change from the beta folder v2.6.11 a5. I also modified the TextMeshPro example scene to have one of the labels having FONTS in the secondary term, and another label using MATERIALS.

Hope that helps,
Frank

Are you :-) Give I2L 5 stars!
Are you :-( Please lets us know how to improve it!
To get the betas as soon as they are ready, check this out

Please Log in or Create an account to join the conversation.

More
7 years 8 months ago #2132 by Frank
Hi,
Thanks for sending me the video showing your setup!!

The problem is that in previous versions of TextMeshPro, the fonts were forced to end in " SDF", and all the submaterials needed to have the format: "XXX SDF - name"   (e.g. font: "Arial SDF" material: "Arial SDF - Outline).

That was the only way that worked for the submaterials to be recognized in the TextMeshPro popup. But that restriction seems that is not longer needed.
I'm going to modify the code to account for that.

In the meantime, if you need to get it working, just add the " SDF" to the end of your font, and to the middle of you material:

e.g.
Font: "Bangers-Regular 145p SDF"
material: "Bangers-Regular 145p SDF - Outline Underlay"

Hope that helps,
   Frank

Are you :-) Give I2L 5 stars!
Are you :-( Please lets us know how to improve it!
To get the betas as soon as they are ready, check this out

Please Log in or Create an account to join the conversation.

More
7 years 8 months ago #2133 by Frank
Hi,
I modified the code to detect any fontasset, even if it doesn't end in " SDF".
If you downloaded 2.6.11b3, it should work as expected.

Hope that helps,
    Frank

Are you :-) Give I2L 5 stars!
Are you :-( Please lets us know how to improve it!
To get the betas as soon as they are ready, check this out

Please Log in or Create an account to join the conversation.

Time to create page: 0.171 seconds
Template by JoomlaShine