From eb69e628271e2477c24f6c1cb9880a1ef743ef09 Mon Sep 17 00:00:00 2001 From: SMcNeill Date: Wed, 5 Aug 2015 04:56:49 -0400 Subject: [PATCH] Fix to custom font error-checking routine which used an invalid variable name and always failed. Made use of _SCREENHIDE function so we don't update the IDE position when the screen is hidden. --- internal/c/libqb.cpp | 5 +++++ source/global/IDEsettings.bas | 2 +- source/ide/ide_methods.bas | 2 ++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/internal/c/libqb.cpp b/internal/c/libqb.cpp index 54912bdf5..f28e385a7 100644 --- a/internal/c/libqb.cpp +++ b/internal/c/libqb.cpp @@ -20788,6 +20788,11 @@ int32 func__printwidth(qbs* text, int32 screenhandle, int32 passed){ static int32 fh,result; static int64 bytes; fh=gfs_open(f,1,0,0); + + #ifdef QB64_WINDOWS //rather than just immediately tossing an error, let's try looking in the default OS folder for the font first in case the use left off the filepath. + if (fh<0) {fh=gfs_open(qbs_add(qbs_new_txt_len("C:/Windows/Fonts/",17),f),1,0,0);} + #endif + if (fh<0) return -1; bytes=gfs_lof(fh); static uint8* content; diff --git a/source/global/IDEsettings.bas b/source/global/IDEsettings.bas index 21efeea5a..f6c211e08 100644 --- a/source/global/IDEsettings.bas +++ b/source/global/IDEsettings.bas @@ -200,7 +200,7 @@ IF LoadedIDESettings = 0 THEN result = ReadConfigSetting("IDE_CustomFont$", value$) idecustomfontfile$ = value$ - if result = 0 OR idecustomfont$ = "" then + if result = 0 OR idecustomfontfile$ = "" then WriteConfigSetting "'[IDE DISPLAY SETTINGS]", "IDE_CustomFont$", "c:\windows\fonts\lucon.ttf" idecustomfontfile$ = "c:\windows\fonts\lucon.ttf" end if diff --git a/source/ide/ide_methods.bas b/source/ide/ide_methods.bas index 04289653d..c65b6a160 100644 --- a/source/ide/ide_methods.bas +++ b/source/ide/ide_methods.bas @@ -626,11 +626,13 @@ DO idedeltxt 'removes temporary strings (typically created by guibox commands) by setting an index to 0 STATIC ForceResize if IDE_AutoPosition then + if _SCreenhide = 0 then IF IDE_TopPosition <> _SCREENY OR IDE_LeftPosition <> _SCREENX THEN WriteConfigSetting "'[IDE DISPLAY SETTINGS]", "IDE_TopPosition" , str$(_SCREENY) WriteConfigSetting "'[IDE DISPLAY SETTINGS]", "IDE_LeftPosition" , str$(_SCREENX) IDE_TopPosition = _SCREENY: IDE_LeftPosition = _SCREENX END IF + end if end if IF _RESIZE or ForceResize THEN