Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • 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
0
Question by grendayzer77 · May 09, 2014 at 12:10 AM · iosfontsmall

Font size ios devices

Hi, i've a problem with my fontsize, on unity it looks great, but once i build and test my game on ipad2 the size change (very small). Is there a solution to fix that ? Is it true that dynamic font can't be used for ios ?

ps : I used a dynamic font for my script

Thanks.

Comment
Add comment · Show 2
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 Scribe · May 09, 2014 at 01:06 AM 0
Share

If you increase the size in the editor does it increase on the build as well, if so its unlikely a problem with dynamic font and more likely due to a difference in pixel density, in which case you can use http://docs.unity3d.com/Documentation/ScriptReference/Screen-dpi.html to make it consistent on different mobile devices. Check my answer here: http://answers.unity3d.com/questions/678598/how-to-set-up-same-sized-text-on-all-screens.html

Hope that helps!

avatar image grendayzer77 · May 09, 2014 at 08:37 AM 0
Share

Thank you for the answer, it helps me and i know now the ratio to determenate my fontsize for different devices i hope. i took Screen.width (on debug.log) and compare it with the Screen.width of the ipad2 and i found that is about /2.5 and i go with it. I don't know if it's the best way but it works :). Thanks again

4 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by VIPINSIRWANI · May 09, 2014 at 10:32 AM

Select Font in assets and in inspector window set character as Dynamic and try this code it will work

public GUIText FinalScore;

 Void Start()
  {
      FinalScore.fontSize = (int)(Screen.width * 0.12f);
  }
Comment
Add comment · 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
0

Answer by grendayzer77 · May 09, 2014 at 11:09 AM

 private var score : GameObject;
 private var z : int;
 
 //ipad 2 and ipad retina
 
 if (Screen.width == 768)
 {
     z = 2.5;
 }
 else if (Screen.width == 1536)
 { 
     z = 5.0;
 }
 
 score = new GameObject ("Score");
 score.AddComponent (GUIText);
 score.guiText.fontSize = 22 * z;
 
 // you can added (color, alignement, font...)
 
 
Comment
Add comment · 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 grendayzer77 · May 09, 2014 at 11:10 AM 0
Share

it works for ipad2, i didn't test it on ipad retina. Tell me if it works for retina.

avatar image
0

Answer by jonas-echterhoff · May 09, 2014 at 12:45 PM

Dynamic fonts work fine on iOS (support for that was added in Unity 4.0, since then dynamic fonts are supported on all platforms). The reason your fonts are appearing small is probably just that you are running on the high resolution screen of your iPad - as others suggested, just use a larger font size, for larger screen resolutions.

Comment
Add comment · 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 grendayzer77 · May 09, 2014 at 01:58 PM 0
Share

Thanks, i did it and it works.

avatar image
0

Answer by Owen-Reynolds · May 24, 2020 at 03:06 AM

When using a Canvas, "RenderMode: WorldSpace" works fine. It looks the same on iOS as it does in the editor. "ScreenSpace - Camera" doesn't. It seems to count things in pixel sizes, which means iOS's double pixels make text and buttons appear 1/2-sized, and puts some items in the wrong spot (if the position was counted in pixels). I'm not sure about the 3rd setting "ScreenSpace - Overlay".

Comment
Add comment · 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

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.

Follow this Question

Answers Answers and Comments

24 People are following this question.

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

Related Questions

Custom Font on iOS4.3.2 & iOS5.0 ?? 0 Answers

IOS Unity 5 UI, Font/Text not displaying/Disappearing 3 Answers

How to use IOS built-in font like Helvetica 0 Answers

iOS font missing when build is nested in another project only after Unity 5.3 update. 0 Answers

Unity Facebook Plugin terminates app after login (iOS) 1 Answer


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