I’ve got some dynamic fonts in my game project and I’ve noticed that, if I increase their atlas size, then APK file size increases too. I don’t think that dynamic fonts need to store any data and the application shouldn’t be built with atlas textures for dynamic fonts. Before increasing atlas sizes, my app was like 47MB, now it’s 68MB. I need atlases resolution to be at 1024x1024, so all characters would fit.
"com.unity.textmeshpro": "2.0.1"
1 Like
Static font assets are self contained and their contribution to the APK size will mostly be the atlas texture size. Their source font file is not included in the build as these font assets are static.
Dynamic font assets need access to their source font file in order to dynamically add characters and glyphs to them. As such the source font file is included in the build thus increasing contributing to the APK size.
The atlas texture of dynamic font asset is at size = 0 when initially created. When the first glyph is added to the atlas texture, it is then size to whatever you specified in the Generation Settings. In the Editor changes to dynamic font assets are persistent but they are not in builds. Therefore, if you Reset your dynamic font asset before creating your final build, these atlas textures should be size = 0 thus not contributing to the build size.
In your case, the contribution to the APK size increase is likely the inclusion of the source font file.
P.S. I would recommend upgrading to version 2.1.1 of the TMP package which is the latest release.