• 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 WillNode · Dec 12, 2016 at 07:09 AM · uitextfontstyle

Trying to make Fonts Fallbacks to real Bold/Italic font data

I have a problem. See the screenshot...

alt text

If i choose using Font Style, it's creating alternative character itself, instead of fallback into other existing font.

How I fix this? I see solution like this but it's only for legacy GUI. I need this, so < b> and < i> can appear correctly in my game.

screenshot-98.png (81.6 kB)
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

3 Replies

· Add your reply
  • Sort: 
avatar image
3
Best Answer

Answer by WillNode · Dec 13, 2016 at 09:52 AM

I figured out about how Unity getting specific font style. Few experiments told me something about things that work and don't. I'll leave this to everyone who have the same problem. From beginning:

  1. Every fonts have a fallback list. That's the list that labeled as "Reference to other fonts in project"

  2. This fallback list is also used as a way to getting alternative bold/italic styling. Therefore, you should make sure every font family are referenced to each other. The inspector shows this can be solved by giving the same name to all font families (this is default, anyway).

  3. If nothing found, they'll attempt to get it from system. Here's the proof:

  4. List item

  5. You must pay attention for that, because it is mean they are not pick the font from project files (therefore, giving varies result on different platforms).

  6. The importer is might broken. See the list again. Even it's same, but for me, it still doesn't work. Fonts still doesn't reference each other, see below.

  7. List item

  8. You can't solve it by deleting then reimporting it again. Closing the project, delete Libraries Folder, reimpoting all project. It didn't work. The solution is type "enter" on Font Names (aka. modify Font Names box), so the importer will start to look for fallbacks in project (took me hours to figure this).

  9. You must do this on all font, one by one.

  10. Sometime the trick above is still don't work. Why? The importer might broken. Sometimes, it is work but didn't show up on importer, or it doesn't been updated. The only way fix this is attempt to modify font's .meta file

If you open font's .meta file, you'll see this section...

   fallbackFontReferences:
   - {fileID: 12800000, guid: fe015f6966a3b3f408fcbbcda2cd14b0, type: 3}
   - {fileID: 12800000, guid: 59146b2b5ecbcde448ff42c68fe3726f, type: 3}

These GUIDs are reference to font fallbacks, so you can check or add if there GUIDs refer to correct font file. I'm solving my problem by adding bold/italic GUIDs to regular font's .meta file.


screenshot-104.png (144.2 kB)
screenshot-103.png (33.9 kB)
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 pfreese · Dec 13, 2016 at 11:33 PM 0
Share

If you are not seeing the font fallbacks correctly determined for an imported font, that sounds like a bug. Please submit a report and be sure to include the problematic fonts.

avatar image WillNode · Dec 14, 2016 at 05:04 AM 0
Share

Yeah, i'm using 5.2.1, not sure if this are addressed in newer version. So i'll try it on latest build and file a repro if this still reproducible.

avatar image pfreese WillNode · Dec 15, 2016 at 08:05 PM 0
Share

Ah, that explains it. This was definitely fixed (I think it was in 5.4).

avatar image ThomLaurent · Nov 13, 2017 at 12:24 PM 0
Share

Still not fixed on Unity 5.6.1 and more recent versions, see this bug report to stay tuned.

avatar image
1

Answer by pfreese · Dec 12, 2016 at 10:17 PM

If you are importing the bold and italic versions of the font along with the normal version (and they have identical family names), it should work automatically when changing style. Check to see how the imported fonts are set up.

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 WillNode · Dec 13, 2016 at 09:54 AM 0
Share

thanks, your answer actually help me up to see how they imported.

avatar image
0

Answer by gamebytom · Apr 10, 2019 at 06:15 PM

I had the same problem on Unity 2018 3.7 - one of my fonts would not use the real bold font with bold tags in RTF text boxes. It used automatic bolding instead, even though the font families were the same. This didn't happen with all of my fonts - some of my fonts worked perfectly, but with one font it didn't work.... I solved it by increasing the Dynamic Pixels Per Unit on the Canvas from 1 to 3.

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.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

90 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 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 make on screen text resizable 0 Answers

Is there a way to get the size of text? 1 Answer

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

Text blurred: uGUI 4.6 9 Answers

How to measure the width of a string? 0 Answers

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges