@wsicarlos: what I found in my tests was the following:
- when you add new chars to the font texture, if the texture has to be rebuilt (to change its size), it will only be rebuilt with those new chars. All older chars are removed, and the texturerebuilt callbacks are invoked. On callback, you can have other gameobjects displaying text (UILabels, but also text meshes if needed) request their characters to be added to the font texture again. Any object that doesn't request its characters again takes the risk of not finding them in the texture anymore. Anyway, see my code for it, a diff with the original NGUI version will point you to the changes I made.
@Unisip
Thank you for your answer, your test is correct, but that's why i think is a problem.
The first time you mentioned about removing the unused chars, i am very confused about that, and considered that might be a problem.
After last night's testing, i finally solve this problem and now shows to everyone. You can check my test scene to see what happened when the unity rebuild the texture when it is full.
You didn't get this problem because you request the new chars at the same time when you get the callback, and unity collect all the request in this circle, and rebuilt the texture.
Anyone want to fully understand how the dynamic font works can use my test demo, and btw, unity's documentation is quite "easy" to understand with just few things on it!
And anyone want to use dynamic font in your own code should request the new character info just at the moment when you get the callback.