The font I’m using for English letters has a material that has thicker outline/shadow compared to Chinese/Korean/Japanese. I have all Latin characters/numbers baked in the English font asset. So if Chinese/Korean/Japanese use them it can fallback to the English font asset.
The problem I have is that when the fallback occurs, the material used for the Latin/Number characters are not the one defined in the English font asset. Rather, they have thinner outline/shadow as defined in the Chinese/Korean/Japanese font asset.
Is there any way to make the fallback use the Material of the fallback font asset?
I’m aware of <font=“Arial” Material=“Arial Shadow”> but it requires putting fallback font assets inside Resource folder. I’ve been trying to avoid Resource folder completely in favor of Addressable system.
The ratio of sampling point size to padding is what determined the effective range / visual appearance of the thickness of things like Outline, etc.
So when you create your font asset assets and more importantly fallbacks, make sure this ratio is the same between all of them. For instance, if the primary font asset has a sampling point size of 100 with padding of 10 or 10% ratio. Then the fallbacks could have a sampling point size of 80 with padding of 8 or sampling of 50 with padding of 5. Having the same ratio will ensure the outline thickness is visually consistent between them.
My English font asset and Asian font asset have different material settings which produces different outline/shadow. This is intentional because in my case the Latin characters simply need thicker outline.
However, when the Latin characters are rendered by the fallback system, they are of the correct font but not the correct material.
BlackSans SDF
SimSun SDF with ASCII characters fallback to BlackSans SDF
What is the Sampling Point size and padding of these two font assets?
When the fallback is used, TMP creates a new material that uses the atlas texture of the fallback font asset but with the same properties as the primary font asset.
If you need to preserve the material settings, you can disable Match Material Presets in the TMP Settings.
If you need to preserve / make sure the default material and settings of the fallback font asset is ued, you can disable Match Material Presets in the TMP Settings. See if that works for your needs.
P.S. I haven’t played with this setting in a while so there appears to be a few potential issues when modifying the Primary font asset material where it also tries to modify the sub object which it should not when Match Material Presets is disabled. I’ll fix that (Update - Already fixed on my end).
It works. Thanks very much.
On second thought, I decided to make the materials have values as close as possible.
Because as suggested by your video, the default material preset should have no outline.
In that in my case I want the fallback character to have a different material instead of the default material.
Is that even possible without using multifont?
Right now it is not possible to control what material preset gets used by the fallback as it always uses the default material.
Control over what Material Preset is used by the fallback is something that has been requested in the past. I guess I need to revisit this.
One suggestion that was made was to always use the same index of material preset between the Primary and Fallback. This would require adding perhaps a list of material presets per font asset where this list could be ordered and then kept synchronized with the fallbacks.
Still not sure how to tackle this from a logic / intuitiveness point of view but the feature certainly has a use case.
SerifGothicStd-Heavy Heading has a stroke. SerifGothicStd-Heavy SDF has a fallback font with additional characters, but when the fallback is used the stroke is missing.
Would this be to do with the padding etc when creating the font assets? The default material for SerifGothicStd-Heavy SDF doesn’t have any stroke etc but I assume the fallback system utilises the actual material used by the text box.
For testing, I created a dynamic font asset and added “ABC” to it. I then switched it to static to prevent adding any additional characters to it.
I assigned a fallback that contains additional characters to this static font asset.
I then created a text object. Assigned the static font asset that only contains “ABC” and typed ABCD in the text input box. This resulted in the D coming from the fallback (as expected).
I subsequently created a new material preset with an outline for the static font asset. Applied the Preset and all characters including the D got the outline.
See if the following steps produce the same result.
Make sure you have Match Material Presets enabled in the TMP Settings as seen below.
P.S. Make sure that your fallback font asset has a Ratio of Sampling Point Size to Padding that is about the same as the Primary. If the fallback has a very small Ratio then the outline might not be visible for the same material property values.
Thanks again! I set it all up again from the start and it does seem to be working now. One difference I noticed between my tests is the main font asset in the first test (that didn’t work) was missing the source font file under the generation settings.
In my second test (that works) the source font is set and population mode is set to static.