Advertisement

BMFont: Generating from fontfile does not work

Started by January 18, 2024 01:35 PM
5 comments, last by WitchLord 9 months, 1 week ago

Hello, I am running bmfont64.exe from commandline specified with a *.bmfc file to generate my bitmap fonts.

I don't want to use system fonts, but want to specify a custom fontfile directly that is not installed, so my bmfc file looks like this:

# AngelCode Bitmap Font Generator configuration file
fileVersion=1

# font settings
fontName=
fontFile=c:\temp\customfont.ttf
charSet=0
fontSize=128
aa=1
scaleH=100
useSmoothing=1
isBold=0
isItalic=0
useUnicode=1
disableBoxChars=1
outputInvalidCharGlyph=1
dontIncludeKerningPairs=0
useHinting=0
renderFromOutline=0
useClearType=1

However the generated font texture always falls back to Arial (I think) and never uses the specified glyphs from customfont.ttf

I tried also to specify relative and absolute paths with \ and / and also *.otf font format, but I am always getting the same result. I am using latest 1.14b version.

What am I doing wrong here? Thanks a lot!

You've not informed the name of the font from that font file that you want to use. Even if the font file only includes 1 font you still need to name it, so BMFont can correctly identify it.

I suggest you configure everything you want from the UI, and test it out, then save the configuration from the UI.

Regards,
Andreas

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

Advertisement

Thanks for the explanaition, I didn't know that a font file can contain more than 1 font.

What will happen if the fontName in the fontfile is the same as one font that is installed on the system? I am asking because this is exactly what is my use-case. I have added a certain missing character to a windows font but in the UI and in the our application that parses the .fnt file the character still shows as missing.

But the glyph is definitely in the specified .otf. Checked with the Fontforge tool.

That's a good question. I don't actually know. It depends on how Windows works as I use the Windows SDK to create the fonts used for generating the bitmap fonts.

I would have to try this out to answer that question. Would you be able to share your font files, both the original you have installed and the one modified and loaded into memory just for generating the BMFont?

In any case, since you have the ability to change the font, why not give it a different name as well so it doesn't conflict with the font already installed on Windows? That ought to resolve your issue.

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

In any case, since you have the ability to change the font, why not give it a different name as well so it doesn't conflict with the font already installed on Windows? That ought to resolve your issue.

Hi again and sorry for the late reply! Just wanted to let you know that this suggestion actually worked out!

Thanks a lot and keep up the good work!

Btw, did you ever consider hosting the sourcecode on github?

I have considered it, but SF.net works well for me so I don't really have any reason to move to github.

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

This topic is closed to new replies.

Advertisement