I’m trying to see if it’s possible to take an OS font and duplicate/create it into my project folder without manually copying and pasting it into my project.
I’m sorry if this has already been answered, but I couldn’t find anything like it on here, apart from my previous attempt:
If anyone can tell me if this is possible or knows of any way of a work around similar to what I’m trying to do I would be very grateful.
When using the GetOSInstalledFontNames() function, does the font you are trying to work with show up in the returned array on that particular platform?
Let’s go back a few steps so that I clearly understand your needs.
You are trying to avoid having to include a font in your project. I assume for build size reasons. As such you want to use one of the OS fonts already on the device itself.
You are able to get a reference to the names of the fonts on the device by using the GetOSInstalledFontNames() function. You are also able to create a font by using the CreateDynamicFontFromOSFont() function.
Once the font is created using CreateDynamicFontFromOSFont, you should be fine provided you hold on to a reference to this font. As far as I know, on the device, you cannot make this font persistent which means every time the app runs, you will need to create this font using the above mechanism.
Is the issue that you are unable to create / use an OS font or the you are unable to make that into a persistent asset?
I don’t think I can build to WebGL without the fonts as assets when just using CreateDynamicFontFromOSFont(). I get the error “Need to include font data on WebGL”.
GetPathsToOSFonts(), that will be handy. Do you know what version and when it will be released?