- ajsmith595
- Posts: 8
- Joined:
Unity Fonts Error
When I import my XAML file, I get the following error:
Assets/XAML/test.xaml(11): Unable to convert 'Fonts/Segoe UI Black' to a valid value for property TextBlock.FontFamily.
UnityEngine.Debug:LogError(Object, Object)
<ImportXaml>c__AnonStorey0:<>m__0() (at Assets/NoesisGUI/Plugins/Editor/NoesisPostprocessor.cs:359)
UnityEditor.EditorApplication:Internal_CallUpdateFunctions()
The font family describes what should be used for a TextBlock in my XAML, but it can never find the font I want. Of course, this font was purely for testing so that I could figure out how to actually import fonts correctly: I clearly have not found that out yet! Haha! I have tried different variations of the font family property like 'Fonts/Segoe UI Black.ttf', 'Fonts/#Segoe UI Black', 'Fonts/#Segoe UI Black.ttf', but they never work. What is the way that fonts should be imported into Unity? I have attached the image to show the file structure of the project
Inside 'Fonts', there is a ttf called 'Segoe UI Black.ttf'. Can anyone identify my problem?
Assets/XAML/test.xaml(11): Unable to convert 'Fonts/Segoe UI Black' to a valid value for property TextBlock.FontFamily.
UnityEngine.Debug:LogError(Object, Object)
<ImportXaml>c__AnonStorey0:<>m__0() (at Assets/NoesisGUI/Plugins/Editor/NoesisPostprocessor.cs:359)
UnityEditor.EditorApplication:Internal_CallUpdateFunctions()
The font family describes what should be used for a TextBlock in my XAML, but it can never find the font I want. Of course, this font was purely for testing so that I could figure out how to actually import fonts correctly: I clearly have not found that out yet! Haha! I have tried different variations of the font family property like 'Fonts/Segoe UI Black.ttf', 'Fonts/#Segoe UI Black', 'Fonts/#Segoe UI Black.ttf', but they never work. What is the way that fonts should be imported into Unity? I have attached the image to show the file structure of the project
Inside 'Fonts', there is a ttf called 'Segoe UI Black.ttf'. Can anyone identify my problem?
-
sfernandez
Site Admin
- Posts: 2984
- Joined:
Re: Unity Fonts Error
Hi,
You should use FontFamily="Fonts/#Segoe UI" and FontWeight="Black" to select that font.
We internally use FreeType to process font files and it seems that the library uses "Preferred Family" entry in .ttf 'name' table to fill the family name. In that particular font that value is "Segoe UI".
Take a look at this tutorial if you want to know more about text and fonts: http://www.noesisengine.com/docs/Gui.Co ... orial.html
You should use FontFamily="Fonts/#Segoe UI" and FontWeight="Black" to select that font.
We internally use FreeType to process font files and it seems that the library uses "Preferred Family" entry in .ttf 'name' table to fill the family name. In that particular font that value is "Segoe UI".
Take a look at this tutorial if you want to know more about text and fonts: http://www.noesisengine.com/docs/Gui.Co ... orial.html
- ajsmith595
- Posts: 8
- Joined:
Re: Unity Fonts Error
That worked! Thank you!Hi,
You should use FontFamily="Fonts/#Segoe UI" and FontWeight="Black" to select that font.
We internally use FreeType to process font files and it seems that the library uses "Preferred Family" entry in .ttf 'name' table to fill the family name. In that particular font that value is "Segoe UI".
Take a look at this tutorial if you want to know more about text and fonts: http://www.noesisengine.com/docs/Gui.Co ... orial.html
Re: Unity Fonts Error
By the way we plan to show this information (and a nice text rendering preview) in the Unity preview panel.
Thanks for your feedback!
Thanks for your feedback!
Who is online
Users browsing this forum: Google [Bot], Semrush [Bot] and 94 guests