Thread: How are fonts defined in Unity?
-
March 27th, 2020, 22:18 #1
How are fonts defined in Unity?
According to the Unity wiki:
<font name="..." >
<fgffile > ... </fgffile>
<ttf >
<file > ... </file>
<name > ... </name>
<size > ... </size>
<bold > ... </bold>
<weight > ... </weight>
<italic > ... </italic>
<underline > ... </underline>
<strikethrough > ... </strikethrough>
</ttf>
<color > ... </color>
<shadow >
<offset > ... </offset>
<color > ... </color>
</shadow>
</font>
<font name="reference-r">
<ttf >
<file >"graphics/fonts/calibri.ttf"</file>
<name >"Calibri"</name>
<size >18</size>
</ttf>
<color >"#000000"</color>
</font>Last edited by lozanoje; March 27th, 2020 at 22:40.
-
March 27th, 2020, 23:05 #2
Open the font in a font viewer and check that "Calibri" is the actual name of the font within the font itself - this is what the <name> parameter must match.
Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!
-
March 28th, 2020, 00:05 #3
Last edited by lozanoje; March 28th, 2020 at 00:20.
-
March 28th, 2020, 00:33 #4
In the error message
font: Missing file () for font (reference-r). [Tema Base La Llamada de Cthulhu (Viriato139ac)] [graphics/graphics_fonts.xml]
The font filename should be within the first parentheses: font: Missing file (graphics/fonts/calibri.ttf) for font (reference-r). [Tema Base La Llamada de Cthulhu (Viriato139ac)] [graphics/graphics_fonts.xml]
In the XML that you pasted into the first post, there are spaces preceding the closing > bracket. Try removing those spaces.
-
March 28th, 2020, 00:47 #5
Here's a sample from a recent font extension:
Code:<font name="reference-r"> <ttf file="graphics/fonts/JetBrainsMono-Regular.ttf" name="JetBrains Mono" size="15" /> <color value="#000000" /> </font>
-
March 28th, 2020, 01:05 #6
-
March 28th, 2020, 01:10 #7
-
March 28th, 2020, 01:14 #8
font: Missing file () for font (reference-r). [Tema Base La Llamada de Cthulhu (Viriato139ac)] [graphics/graphics_fonts.xml]
This part of the error message ruleset manager active container name,so it appears to be looking for the font in a custom ruleset or extension. There are many graphics_fonts.xml files. There is one for CoreRPG and there is usually one for each ruleset, etc. Can you check that the graphics_fonts.xml you are editing is in the folder just above the folder containing the font file?
-
March 28th, 2020, 01:22 #9
-
March 28th, 2020, 01:55 #10Code:
<font name="reference-page-header"> <ttf file="graphics/fonts/calibri.ttf" name="Calibri" size="18" /> <color value="#000000" /> </font>
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks