Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 noodlesdev · Aug 14, 2016 at 03:20 PM · uitextfontmaximumfont size

How can I set the UI Text font size higher than 300px ? | Unity 5.4

The maximum UI Text font size can't be set higher than 300, but I want it to be like 500 or something. Is there a free way of doing this ?

Thanks in advance.

Comment
Add comment · Show 1
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 DCordoba · Aug 14, 2016 at 05:53 PM 0
Share

clarification: this is not a answer, just a fix to change the size. you can easy increase the scale of the RectTransform attached to the gameobject that contains the text, this will increase the text size in the canvas.

2 Replies

· Add your reply
  • Sort: 
avatar image
3

Answer by DiegoSLTS · Aug 15, 2016 at 03:05 AM

You can set a bigger size changing the fontSize field with a script. A simple example:

Add a Canvas with a Text child. Set the Canvas to scale with screen size and put something like 1920x1080. Set the Text's anchor to stretch vertical and horizontal and make sure top, bottom, left and right are 0. Add this script to the Text.

 using UnityEngine;
 using UnityEngine.UI;
 using System.Collections;
 
 public class TextSizeTest : MonoBehaviour {
 
     [SerializeField]
     int size = 300;
 
     Text t;
 
     void Awake() {
         t = GetComponent<Text> ();
     }
     
     void Update () {
         t.fontSize = size;
     }
 }

Press play and try different values in the inspector.

I just tested with the default Arial font and another .ttf that I imported. The max may be different for different fonts with more characters.

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 DCordoba · Aug 17, 2016 at 07:40 PM 0
Share

so, the clamp of the size is in the inspector, not in the text class, I learn something new, thanks.

avatar image
0

Answer by Addyarb · Aug 14, 2016 at 08:38 PM

You don't need to increase the size of the font, you just need to scale the transform of the object that your Text component is on. There's almost no scenario where manually increasing the font size past 300 makes sense.

To get a font size equivalent to that of a 500 size, try scaling your font to 100 and then setting the scale to 5,5,5.

Comment
Add comment · Show 3 · 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 noodlesdev · Aug 14, 2016 at 09:59 PM 0
Share

I'm so stupid hahaha thanks!

avatar image DiegoSLTS · Aug 15, 2016 at 03:10 AM 2
Share

Scaling streches the image, it looks really bad if you scale a text by 5.

Also, "There's almost no scenario where manually increasing the font size past 300 makes sense" sounds too arbitrary.

avatar image noodlesdev DiegoSLTS · Aug 17, 2016 at 07:49 PM 0
Share

True but I just set the font to 300 and scaled it by 1.2 or something. Works for now...

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

77 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 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 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 avatar image avatar image avatar image avatar image avatar image

Related Questions

How to fix TextMeshPro breaking lines and escaping random characters? 0 Answers

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

Text blurred: uGUI 4.6 9 Answers

When game resolution is 4k, UI text font size stops scaling from 145 0 Answers

How to measure the width of a string? 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