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 Jason B · Mar 30, 2011 at 12:30 AM · guisizefontaspect-ratio

How can I calculate font size to always be more or less standardized across a variety of resolutions?

I searched and didn't find what I was looking for. I've tried multiplying the font size by screen dimensions, but that falls apart due to the fact that different aspect ratios exist.

From what I can see, I have three potential options, and I'm curious what the best approach to this would be:

A) A mathematical way to determine how to standardize font sizes across all resolutions and aspect ratios (and if so, how?).

B) I could fill an array with font sizes across various resolutions, and make every single GUI Style a static variable that can be accessed anywhere. On a resolution change, I'd have to find the corresponding font sizes and plug them in to every single GUI Style in the game. The major downside to this is having to test every single GUI in every single possible resolution, and then eyeball it and figure out the right size for each resolution.

C) One last thing I thought of was using one formula for 4:3 resolutions, and another for 16:9 resolutions since I know that a simple formula can work as long as I use a particular aspect ratio. Only problem is, I have no idea how to tell what aspect ratio a resolution is (except the 4:3 ones which I just have memorized). Kind of wish someone invented an aspect ratio calculator or something, heh...

Before it's mentioned, using GUIText isn't feasible. Thanks.

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

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by AngryOldMan · Mar 30, 2011 at 12:36 AM

Rather than use fonts use a plane with a texture/material on with your writing on. it's what we did on our menu. that way you have much more control over how it looks, however it's not too effcient if you have say.. a text based game lol.

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 Jason B · Mar 30, 2011 at 12:49 AM 0
Share

Unfortunately at the rate I rewrite things, I think I'd go mad from heading into my paint program so many times. :P

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

No one has followed this question yet.

Related Questions

how do i change the font size on a gui text box 3 Answers

How i colourize a Button and change the Font Size of it ? 1 Answer

Is there a way to measure the pixel with/height of a string with a given font? 2 Answers

Changing the size of a GUI label 1 Answer

Is there a way to get the size of text? 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