Saturday, September 3, 2022
HomeGame DevelopmentMonogame "Couldn't discover font file" when working

Monogame “Couldn’t discover font file” when working


I am making an attempt to study the fundamentals of Monogame, and I’ve efficiently found out tips on how to use the Monogame Content material Pipeline to load and show photos on the display screen. When I attempt to do the identical with fonts, by loading a font known as galleryFont.spritefont into the Monogame Content material Pipeline every part is ok.

enter image description here

Nonetheless, the issue happens after I run the undertaking. I get an error that appears like this:

enter image description here

As you’ll be able to see as effectively, the file is loaded, however what I observed what was unusual was that the monogame content material pipeline didn’t save the file as an .xnb file within the Content material/bin folder.

enter image description here

Or for the reason that error stated, “Couldn’t discover Arial font file,” does this imply I have to by some means obtain the Arial font.ttf and hyperlink it by some means in my .spritefont file? Right here is the .spritefont file if anybody is .

<?xml model="1.0" encoding="utf-8"?>
<!--
This file comprises an xml description of a font, and might be learn by the XNA
Framework Content material Pipeline. Observe the feedback to customise the looks
of the font in your recreation, and to vary the characters which can be found to attract
with.
-->
<XnaContent xmlns:Graphics="Microsoft.Xna.Framework.Content material.Pipeline.Graphics">
  <Asset Kind="Graphics:FontDescription">

    <!--
    Modify this string to vary the font that might be imported.
    -->
    <FontName>Arial</FontName>
    <Dimension>24</Dimension>
    <Spacing>0</Spacing>
    <UseKerning>true</UseKerning>
    <Fashion>Common</Fashion>

    <!--
    In the event you uncomment this line, the default character might be substituted should you draw
    or measure textual content that comprises characters which weren't included within the font.
    -->
    <!-- <DefaultCharacter>*</DefaultCharacter> -->
    <CharacterRegions>
      <CharacterRegion>
        <Begin>&#32;</Begin>
        <Finish>&#126;</Finish>
      </CharacterRegion>
    </CharacterRegions>
  </Asset>
</XnaContent>

Thanks for any assist.

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments