Advertisement

Throw exception after launch

Started by September 11, 2019 12:36 PM
6 comments, last by WitchLord 5 years ago

Hello,

recently, -i don't know from when- BMFont crash right after launch.

I figure out why,


void CCharWin::DrawGlyphs(HDC dc, RECT &rc, TEXTMETRIC &tm)
{
   int offset = 0, charEnd = 255;
	if (fontGen->IsUsingUnicode())
	{
		const SSubset *subset = fontGen->GetUnicodeSubset(unicodeSubset);
		offset = subset->charBegin; // <-- throw exception because subset is zero
		charEnd = subset->charEnd;
	}
  ...
}

subset should be -i guess- initialized in CCharwin::Create(width, height, configFile) before Draw();


int WINAPI WinMain(HINSTANCE hInst, 
				   HINSTANCE hPrevInst, 
				   LPSTR     cmdLine, 
				   int       showFlag)
{
	// Turn on memory leak detection
	// Find the memory leak with _CrtSetBreakAlloc(n) where n is the number reported
	_CrtSetDbgFlag(_CRTDBG_LEAK_CHECK_DF|_CRTDBG_ALLOC_MEM_DF);
	_CrtSetReportMode(_CRT_ASSERT,_CRTDBG_MODE_FILE);
	_CrtSetReportFile(_CRT_ASSERT,_CRTDBG_FILE_STDERR);

	Init();

	string configFile;
	int result = 0;
	bool openGui = processCmdLine(cmdLine, configFile, result);

	if( openGui )
	{
		CCharWin *wnd = new CCharWin(512, 512, configFile);
		wnd->Create();
        ....
    }
    ...
}

LRESULT CCharWin::MsgProc(UINT msg, WPARAM wParam, LPARAM lParam)
{
    ...
    switch( msg )
    {
	case WM_PAINT:
		Draw();
		return 0;
    ...
}

But, suddenly execute priority is changed.

It occur both in v1.13 and v1.14 beta.

When, If execute binary(bmfont.exe) in cmd(prompt), run correctly.

Please figure out.

Thanks.

Thanks for letting me know about this.

I'll investigate and have it fixed.

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

I've uploaded a new version of BMFont 1.14 Beta

Let me know if this fixes the problem.

PS. Sorry for taking so long to work on this.

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

Error when start with/without .bmfc file.

Freeze?Crash without GUI. (when run bmfont64.exe from R:\aa\bb\cc\dd\ee\dd\...)

 

Tested on lasted version. (1.65MB, 2019/10/30)

unknow_error.png

Terribly sorry. The update was done in a rush and I didn't test it enough. (my baby boy is not giving me peace ?)

I just uploaded another version. It should be OK now.

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

Thanks for the fast fix. Now it's working.


Another error message when use "add font file" instead "select installed font" from top drop list.
___
"Failed to add font file: 

"X:\FontName\FontName-Black.ttf"

The file is probably not a Windows font. Try another file."
___

But the font is valid and It can install without any error.
Sample ttf
Please take a look.

Advertisement

I haven't been able to reproduce this problem. I was able to add the font file you provided without any problem. 

image.png.8f137185347dc359ebc34dbddbf8b336.png

 

Can you provide more details under what circumstances the problem occurs? Does it happen for all font files? Does it depend on the directory in which the font file is located?

 

 

 

 

 

 

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