- Home /
Font Size changes between PC and Mac
Hi, I am writing a game with my son. We are targeting ios, so need to depoly the app on MacOS, but do most of our development on PC. However, when we load the project in MacOS, the fonts are tiny. If we scale them up, then go back to PC, the fonts are huge. Is there any way to keep the font sizes consistent between the two operating systems?
Thanks
You might be able to check for which platform the user is on, then change the font size proportionate to that with GUIStyle.fontSize
.
correct me if im wrong, you can only check the platform the deployed app is running on? this is happening while in the editor with the platform being set to ios on both the PC and $$anonymous$$ac
Answer by AtLeastImTrying · May 03, 2017 at 11:41 AM
If you would like to change the size based on the OS being used, you can use Platform Dependent Compilation where it will ignore all code that is defined for a specific Platform/OS.
using UnityEngine; using SystemCollections; public class Example { public int fontSize; void Start { #if UNITY_EDITOR_OSX fontSize = (number) #endif #if UNITY_EDITOR_WIN fontSize = (number) #endif } }
Sorry I can't get it to "un-smush" so it's a little difficult to read.
Answer by upasnavig90 · May 03, 2017 at 10:23 PM
you may use the best fit option in text component...it will adjust the size accordingly...