1.Some text occasionally turns into white block 2.Font grabled switch to background on iPhone12

I have two questions:

  1. Chinese fonts are normal at ordinary times, but occasionally some fonts will turn into white squares, other fonts are still normal, and the problem of reloading prefab still exists,This is not inevitable. It’s normal to re-enter the application
  2. On iPhone12,Sometimes when switch to the background, all font will become garbled,This is not inevitable. It will only appear on the iPhone 12

No error log were found for both problems

unity 2019.3.4
TextMeshPro:2.0.1
Atlas Population Mode: Dynamic
Padding:8
atlas:2048x2048

Sorry my bad English

Fitst question, maybe use dynamic, atlas is out of scope,but second question may be unity bug,please help me

By white squares, do you mean the missing glyph “□”.

If that is the case, this simply means that the source font file used by this dynamic font asset does not contain the characters and glyph for the given language you have selected.

See the following two videos which will provide more insight on this.

Does this happen only on the iPhone 12 or is that the specific device you are testing with?

Can you post an image of this garbled text?

In terms of the iPhone 12 issue, that might be metal related so please see if the issue also occurs if you switch to OpenGL for instance.

Hi
I can confirm that it is not a problem with the font asset,Because the same characters is sometimes normal, sometimes it becomes “□”,It should the atlas is out of scope
Second question, we have dozens of mobile phones, only iphone12 have this problem,And the same font, some are normal, some have problems

6730507--774667--IMG20210116_100955.png

The “□” character is the missing glyph which is shown when the requested character is not found in the primary font asset or any of its fallbacks. If the character is known to be present in the font asset and then suddenly it turned into this missing glyph then that is pretty strange.

Are you able to reliably reproduce this missing glyph behavior? If so can you please submit a bug report with project for me to take a closer look at?

In terms of the image you posted, this looks like some corruption in perhaps the texture or reading the texture which is a completely different issue than the missing glyph part. This second issue is most likely specific to the iPhone 12 and perhaps Metal. Please test to see if the behavior is the same using OpenGL.

Fitst question,I am almost certain that it is because the size limit of the dynamic atlas was exceeded, because I reproduced it, and I reduced the size of the atlas text, “□” never appeared again.

Second question, the picture I uploaded is a problem in iPhone12. Maybe because I reduced the size of the text in the atlas, this problem never appeared again, so this may still be a bug in the dynamic atlas. We are already considering enabling static atlas. I can almost be sure that it has something to do with switching the background, because a colleague is easier to reproduce by switching the background
The project is so big,sorry I can’t upload,and I checked the log carefully and found no error.

Make sure you have Multi Atlas Texture enabled on the dynamic font asset as this will enable the font asset to create / add new atlas textures as needed to handle glyphs that didn’t fit in the existing atlas texture(s). This also makes it possible to use smaller textures like 512 x 512 or 1024 x 1024.

As per my recommendation outlined in the videos, you should be using a static font asset for the known text in the project for any given language or groups of languages and then assign as fallback to these primary static font assets, a dynamic font asset with multi atlas texture enabled to handle all unknown characters / user input.

It is also important to understand that changes to dynamic font asset in the Editor are persistent but not in builds where dynamic font assets are reset to their build / ship state for each play session. This means, you only need to plan for new characters being added in a play session and not over the life of the application.

Depending on your sampling point size, the dynamic fallbacks could be 512 x 512 or 1024 x 1024 but no larger as even at a sampling point size of 90 with padding of 9, you can almost fit the entire extended ASCII in a 1024 x 1024. Further more given CJK characters can actually still look very good at lower sampling point size like 50 to 72, you can fit even more characters. Filling a dynamic 2048 x 2048 would be unlikely in a play session and just using lots of memory while sitting mostly empty.

What do you mean by changing the background? Does that involve changing the screen size / resolution?

Also please see if the issue occurs in OpenGL as it might be specific to Metal and only on the iPhone 12. For instance, there is a rendering issue on the new M1 Mac minis but only in Metal.