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
1
Question by JamesJLinden · Dec 16, 2014 at 05:28 PM · fontfonts

Change fonts from within single Text object?

Is there a way for me to change fonts while in the same Text object? This way I can keep sprite glyphs a secondary font and switch to them when I need them.

alt text

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

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by wesleywh · Dec 16, 2014 at 07:18 PM

You can change just the text by using " Some Text ".

Here is an example using the GUI label:

 GUI.Label(Rect(10,10, 100, 50),"<size=20>Text</size>");

EDIT: Well good thing I added the example because the whole "" thing doesn't show up lol.

Comment
Add comment · Show 4 · 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 JamesJLinden · Dec 16, 2014 at 07:37 PM 0
Share

To be more specific I'm working with the UnityEngine.UI.Text object. Is there any way to do this without the GUI.Label object? Just trying to keep the rendering transformations of my objects uniform.

avatar image wesleywh · Dec 16, 2014 at 07:45 PM 0
Share

I haven't used that before. The GUI.Label is just an example all you need is this:

 "<size=WhateverSize> Your Text Here </size>"
avatar image JamesJLinden · Dec 16, 2014 at 08:22 PM 0
Share

Is that actually changing the font? Looks like it's just changing the size...

avatar image wesleywh · Dec 16, 2014 at 09:25 PM 0
Share

Oh Wow I feel dumb... sorry about miss reading. You are very correct in thinking that it will only change the size of those characters. So I tried to do a little more research on this subject and I came up with these links for you:

$$anonymous$$odifying Individual Letters

Change Text Component Via Script

avatar image
0

Answer by BMayne · Dec 16, 2014 at 10:53 PM

Hey there,

Unfortunately there does not seem to be a nativ way to do this with UnityEngine.UI Most of the code driving the creation of the text is written in C++ which you have no access too and it does not take in two font materials. There is a very round about and hack way to get a max of two fonts but it requires a lot of work.

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

29 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

Related Questions

Font Render Issue Unity 5.3.4f1 on Samsung devices 1 Answer

Font.CacheFontForText is 87.3% in the profiler and causes a HUGE lag spike 1 Answer

Building custom Font with script, can not change CharacterInfo 1 Answer

Dynamic font with no material turns black after update (sometimes) 1 Answer

How can I create Font objects at runtime? 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