Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

BMFont to GameMaker converter

Converts BMFont fonts into GM:S/GMS2 project resources. · By YellowAfterlife

Gamemaker 2.3+ Support

A topic by Atemly Games created Jan 26, 2021 Views: 806 Replies: 8
Viewing posts 1 to 4

Hello! I use this converter for a lot of my text, and it was working great before 2.3. I tried to update a font design but the instructions for pre-2.3 don't seem to work anymore (or there's a chance they might need to be adjusted?)

Here are the steps I used just in case there is user error:

  • Create & export a one-page font in BMFont
  • Drag the resulting .fnt file onto the BmFontToYY.exe
  • A YY is generated

Import Attempt 1:

  • Import into Gamemaker Studio 2
  • Error: Could not find a project for the resource file at "mylocation/myfont.yy"

Import Attempt 2:

  • Create a new folder within myProject/fonts for the new font.
  • Copy paste the png and yy file there.
  • Open my project
  • Error: Gamemaker Studio 2 stopped working
  • Ignore the error
  • After load it says the resource failed to load and it crashes
Developer (1 edit)

I have now uploaded a new version that adds a “BmFontToYY23” converter for 2.3 - as you might imagine, drastic project format changes in GMS2.3 broke basically every tool that deals with project/resource files, and many of mine aren’t exactly popular,

so it can be hard to find a few hours per tool to update them for 2.3 compatibility.

Thanks a lot for the quick fix and no worries!

Hey Yellow, I followed all the steps, but I'm still getting the 

-Error: Could not find a project for the resource file with the file created by BmFontToYY23

Developer

You would be using it on an empty font that is already added to a project - GameMaker won’t let you “add existing” resources that aren’t in a project anymore.

Thank you for your help Yellow!  Very much appreciated, I'm excited about it.
So I followed the steps of the tutorial, dragged the fnt file to BmFontToYY23 and got a .yy file. 
First I tried dragging the yy file into the project and got the error
Error: Could not find a project for the resource file with the file created by BmFontToYY23
Then reading your response I created a font with the same name and replaced the files inside with the ones generated.

It came out garbled sadly.

  • Yes, I'm in the same situation as Game Saute
Developer

Try clearing cache and checking if the files in font directory are differently named (have suffixes/etc.).

I'm using this tool again and wanted to provide a solution for the garbled text for 2.3. I'm currently using Gamemaker v.2.3.2.420 of the runtime, IDE v2.3.2.556.

Importing Fonts
  1. Use BMFont and the converter tool to get your YY file for Gamemaker 2.3 as expected
  2. Create a new font in your Gamemaker project with the same name
  3. Close Gamemaker
  4. Replace the files
Garbled Font

There appears to be a number of errors in the generation of the YY file, which causes Gamemaker to try and repair the file. When it does, it breaks the font at runtime. So basically the PNG is the new font, the YY is the old font. If using GIT or other source control I strongly recommend staging your changes before making the following changes. Gamemaker will complain about each of the issues below when you clean so it's mostly a matter of fixing it as you go.

  1. Open Gamemaker and clean the asset cache
  2. The YY will have the size set to "null.0" change this to a valid number, like "12.0"
  3. Each glyph entry has an offset set to "null". Change this to "0"
  4. I noticed a duplicate key for "kerningPairs" was entered with "ranges" as a child, instead of a sibling. Delete the duplicate key.

After making these changes it worked as expected.