I am having a few issues with loading fonts. I am fully aware of adding them to my assets folder and then using the Resources.Load method on them or adding them via the editor but that is not really my goal, instead I would like to make my game fully skinnable. Ideally, I would like to have a folder in the user’s documents directory where players can create their own skins by modifying .xml files, replacing textures, sounds and fonts. The xml files, textures and sounds were easy enough to implement but fonts are a different story.
I am using TextMeshPro, so I do know that players will need to still generate their own asset file to skin the fonts in my game but that’s ok, my main goal is to find out whether it’s possible to import one of these files from outside of the project and use them in my game. Failing that, would it be possible to do the same thing but with a regular .ttf file and use the built in Unity Text component for something like this?
I appreciate any help on this subject, I feel like I have stumbled around for so long and got nowhere with it.
The main issue with this process is that the Font Asset Creator is an editor only tool using a Native Plugin which only works in the editor. As such, a user would not be able to generate a font asset at runtime (in the game).
My suggestion would be to offer users a selection of font assets to pick from and to load those via Asset Bundles.
Down the road, the new Integrated version of TMP should be able to create / allow for font files to be added at runtime and to create font assets for those. The system will also include the ability to add new glyphs into the font asset at runtime as well.
Thank you for the response. Including a selection of font assets was something I was debating since I was struggling to find a solution. I’m glad to know that this may be possible in the future.
The following functionality is current available. See the following post .
There is an issue with getting the path to OS fonts on iOS which I need to address. However, if you already new the path to those fonts, it should work by manually supplying your own paths.