• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
Question by amrakdab · May 01, 2017 at 03:14 PM · fontsfontsizefont size

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

Comment

People who like this

0 Show 4
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Dog-Gamer · May 01, 2017 at 03:15 PM 0
Share

Do you use any coding to control your fonts?

avatar image amrakdab Dog-Gamer · May 02, 2017 at 01:02 AM 0
Share

no, all setup in the editor

avatar image AtLeastImTrying · May 02, 2017 at 04:36 AM 0
Share

You might be able to check for which platform the user is on, then change the font size proportionate to that with GUIStyle.fontSize.

avatar image amrakdab AtLeastImTrying · May 02, 2017 at 11:21 AM 0
Share

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 Mac

2 Replies

· Add your reply
  • Sort: 
avatar image

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 } }

Comment

People who like this

0 Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image AtLeastImTrying · May 02, 2017 at 05:38 AM 0
Share

Sorry I can't get it to "un-smush" so it's a little difficult to read.

avatar image

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...

Comment

People who like this

0 Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image amrakdab · May 03, 2017 at 11:41 PM 0
Share

this sounds like a good workaround, ill try it out

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

6 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Canvas Scaler doesn't affect fontsize when set to ConstantPixelSize 0 Answers

Dynamic fonts issue in GUI 1 Answer

How to change text size in c# by user? 1 Answer

How to calculate font size (or scale) for a given area base on how long a string is? 1 Answer

How can I obtain an exportable font size? 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges