STAR TREK 2d20
Page 1 of 4 123 ... Last
  1. #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>
    So my try was:

    <font name="reference-r">
    <ttf >
    <file >"graphics/fonts/calibri.ttf"</file>
    <name >"Calibri"</name>
    <size >18</size>
    </ttf>
    <color >"#000000"</color>
    </font>
    But it keeps saying that the font cant be found, but it is there (at graphics/fonts)
    Last edited by lozanoje; March 27th, 2020 at 22:40.

  2. #2
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,362
    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!

  3. #3
    Quote Originally Posted by Trenloe View Post
    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.
    I've used AMP Font Viewer:



    [3/28/2020 12:18:33 AM] [<color="red">ERROR</color>] font: Missing file () for font (reference-r). [Tema Base La Llamada de Cthulhu (Viriato139ac)] [graphics/graphics_fonts.xml]
    [3/28/2020 12:18:36 AM] [WARNING] Frame desktop contains out-of-range values in Middle.
    Last edited by lozanoje; March 28th, 2020 at 00:20.

  4. #4
    pindercarl's Avatar
    Join Date
    Jan 2015
    Posts
    925
    Blog Entries
    2
    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.

  5. #5

    Join Date
    May 2016
    Location
    Jacksonville, FL
    Posts
    2,211
    Blog Entries
    7
    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>

  6. #6
    Quote Originally Posted by pindercarl View Post
    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.
    I place spaces because in the wiki there are spaces, I've removed, same message. But you are right, between parentheses should be the font the xml file is referring to.

  7. #7
    Quote Originally Posted by Talyn View Post
    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>
    Yes, thats the way FGC defines fonts. It works, then looks like the definition for FGU in the wiki isnt correct, or hasnt been implemented yet.

  8. #8
    pindercarl's Avatar
    Join Date
    Jan 2015
    Posts
    925
    Blog Entries
    2
    Quote Originally Posted by lozanoje View Post
    I place spaces because in the wiki there are spaces, I've removed, same message. But you are right, between parentheses should be the font the xml file is referring to.
    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?

  9. #9
    Quote Originally Posted by pindercarl View Post
    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?
    Yes, it is:



    The font is right in the directory fonts of the image.

    I've tried also removing graphics from the path, thinking that maybe it must be _relative_ to the location of the graphics_fonts.xml, but it doesnt work.

  10. #10
    pindercarl's Avatar
    Join Date
    Jan 2015
    Posts
    925
    Blog Entries
    2
    Code:
    <font name="reference-page-header">
    		<ttf file="graphics/fonts/calibri.ttf" name="Calibri" size="18" />
    		<color value="#000000" />
    </font>
    The above should work.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
DICE PACKS BUNDLE

Log in

Log in