diff --git a/.gitignore b/.gitignore index 5d481d6b1..c3b8ca788 100644 --- a/.gitignore +++ b/.gitignore @@ -17,5 +17,6 @@ mingw32.exe mingw64.exe .vscode .DS_Store +settings source/qb64pe_start.command .fake diff --git a/source/ide/ide_methods.bas b/source/ide/ide_methods.bas index fe913e8b4..17a6d8093 100644 --- a/source/ide/ide_methods.bas +++ b/source/ide/ide_methods.bas @@ -195,9 +195,12 @@ FUNCTION ide2 (ignore) IF idecustomfont THEN idecustomfonthandle = _LOADFONT(idecustomfontfile$, idecustomfontheight, "MONOSPACE") - IF idecustomfonthandle = -1 THEN - 'failed! - revert to default settings + IF idecustomfonthandle < 1 THEN + retval = idemessagebox("Custom font not found!", "Your desired font was not found at the specified location, or is\nof unsupported format. Reverting back to default built-in font.", "#OK") idecustomfont = 0: idecustomfontfile$ = "C:\Windows\Fonts\lucon.ttf": idecustomfontheight = 21 + WriteConfigSetting displaySettingsSection$, "IDE_CustomFont", BoolToTFString$(idecustomfont) + WriteConfigSetting displaySettingsSection$, "IDE_CustomFont$", idecustomfontfile$ + WriteConfigSetting displaySettingsSection$, "IDE_CustomFontSize", STR$(idecustomfontheight) ELSE _FONT idecustomfonthandle END IF @@ -16384,7 +16387,7 @@ FUNCTION idedisplaybox IF o(7).sel <> idecustomfont THEN IF o(7).sel = 0 THEN IF IDE_UseFont8 THEN _FONT 8 ELSE _FONT 16 - _FREEFONT idecustomfonthandle + IF idecustomfonthandle > 0 THEN _FREEFONT idecustomfonthandle ELSE x = 1 END IF @@ -16397,9 +16400,8 @@ FUNCTION idedisplaybox oldhandle = idecustomfonthandle idecustomfonthandle = _LOADFONT(v$, v%, "MONOSPACE") IF idecustomfonthandle < 1 THEN - 'failed! - revert to default settings - _MessageBox "Font not found!", "ERROR: Font not found, or is invalid format, at specified location. Reverting back to existing font.", "error" - o(7).sel = 0: idetxt(o(8).txt) = "C:\Windows\Fonts\lucon.ttf": idetxt(o(9).txt) = "21": IF IDE_UseFont8 THEN _FONT 8 ELSE _FONT 16 + retval = idemessagebox("Custom font not found!", "Your desired font was not found at the specified location,\nor is of unsupported format. Please check your inputs.", "#OK") + PCOPY 2, 1: _CONTINUE ELSE _FONT idecustomfonthandle END IF diff --git a/source/subs_functions/subs_functions.bas b/source/subs_functions/subs_functions.bas index 42dae573e..080f9367f 100644 --- a/source/subs_functions/subs_functions.bas +++ b/source/subs_functions/subs_functions.bas @@ -1385,7 +1385,7 @@ id.args = 4 id.arg = MKL$(STRINGTYPE - ISPOINTER) + MKL$(LONGTYPE - ISPOINTER) + MKL$(STRINGTYPE - ISPOINTER) + MKL$(LONGTYPE - ISPOINTER) id.specialformat = "?,?[,[?][,[?]]]" id.ret = LONGTYPE - ISPOINTER -id.hr_syntax = "_LOADFONT(fileName$, size&[, " + CHR$(34) + "{MONOSPACE|, UNICODE|, DONTBLEND|, MEMORY}" + CHR$(34) + "][, fontIndex])" +id.hr_syntax = "_LOADFONT(fileName$, size&[, " + CHR$(34) + "{MONOSPACE|, UNICODE|, DONTBLEND|, MEMORY|, AUTOMONO}" + CHR$(34) + "][, fontIndex])" regid clearid