I am creating a tool that users will be able to create their own contents(like powerpoint)and that content will be played in IOS Tablets. However, users should be able to load their own fonts to use in their texts in runtime. It's not available in Unity <2018.2. But I wonder if it is available on TextMeshPro since its using font assets created by their own.
Related
I'd like to include images in my Flutter application which are not asset images.
Let me clarify a bit. I am working with an embedded Unity application inside the Flutter app. I can communicate bidirectionally and part of the communication is sending a file location from Flutter to Unity, such that the Unity app can read that image and do something with it (e.g. a texture). But since assets are not directly accessible by location, I cannot give the path to the Unity part of the application.
So would there be a way to include images in the app and reference them by old school path?
I have flutter web application and there almost 25+ fonts need to be used ,
all font folder size more than 35mb so please suggest me best way to implement all font with consuming memory
you can user google font package if those fonts are available in google fonts.
google font flutter
if you are trying to use icons as a fonts like font awesome or other custom font libraries download those libraries as SVG and discard unused icons then use IcoMoon to generate custom font. using that you can also download dart font mappings to use in your app
IcoMoon
I'd like to select an image from my local system that is external to the Unity project. This could be on a computer, IOS, android, etc. What is the best strategy to allow a user to open an external image and load it during runtime?
This font needs to be dynamically changed so I can't put it in Resources.
I haven't found any resources or way to achieve this, all talk about Resources.
EDIT: I did look into AssetBunble but it looked overkill so I thought maybe requiring the user to install the font on his machine but Font.CreateDynamicFontFromOSFont does nothing. Whatever the given input (even invalid), it will always return the same "Arial" font and nothing visually change.
I might look into AssetBundles again but I don't want Unity installed on the target machine and if I understood right, you can't build an assetbundle without running Unity.
There is no Unity API to load standard font from disk or web into Unity's Font.
If you use Font.CreateDynamicFontFromOSFont, the font must be installed on the device. This is easy to do on some platforms like Windows but extremely hard on devices like Android.
The recommended way to do this is to use AssetBundles. You will need the Unity Editor to create the AssetBundles but you don't need it to load the AssetBundles during run-time. Put the fonts in AssetBundles then build it and host it on the server. Use UnityWebRequest API to download the Assetbundle then extract the font from it. You can always update this Assetbundle on the server.
If you want the user to to able to load the font from any source, you can automate the building part by asking the user where the font is, take that font and send/upload it to your server with the UnityWebRequest API. On the server side, run Unity Editor in a headless mode, retrieve the font sent to it and build an Assetbundle from it then send it back to the player and load it on the client side.
So, UnityWebRequestAssetBundle.GetAssetBundle is used to download the AssetBundle and AssetBundle.LoadAssetAsync is used to the fonts in it.
There is no other way to do this unless you have the Unity source code which is really expensive. By doing it this way, you won't need the font to be installed and won't run into issues on mobile devices. This post shows how to build and load an Assetbundle but you have to do that in headless mode.
Is it possible in Unity to upload and download files while in a game? I want to make a minecraft-style building game and allow the user to import and use their own models (.obj files, etc), while in the game. I've been using Playfab for a backend and Photon for online cabilities, but as far as I can tell it will only work with image files (in Playfab). Is there a way to accomplish this and what would I need to use?
Yes, the way to go is to use Asset Bundles
Asset Bundles are platform specific assets that you create in Unity, but that you don't put in your build. Instead you can download them later, just as you want.
The process is a bit long, but not that difficult. The unity manual is actually really good and it should be easy to follow. Here is the link:
Asset Bundles documentation