1
1
Fork 0
mirror of https://github.com/QB64-Phoenix-Edition/QB64pe.git synced 2024-09-08 00:40:17 +00:00

Some error handling

- fixed/added custom font error checking on IDE startup and in Options>Display... dialog
- added new settings folder to .gitignore list
This commit is contained in:
Roland Heyder 2024-07-16 23:20:31 +02:00
parent 3d311bd52f
commit 9487cfedf5
3 changed files with 10 additions and 7 deletions

1
.gitignore vendored
View file

@ -17,5 +17,6 @@ mingw32.exe
mingw64.exe
.vscode
.DS_Store
settings
source/qb64pe_start.command
.fake

View file

@ -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

View file

@ -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