From c1a05509a99b89a5483b6995aec7010813a91a4a Mon Sep 17 00:00:00 2001 From: FellippeHeitor Date: Sun, 6 May 2018 10:44:13 -0300 Subject: [PATCH] Declutters font list for new forms while still trying to load them all. --- InForm/UiEditorPreview.bas | 22 +++++++++++++++++++++- InForm/UiEditorPreview.frm | 2 +- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/InForm/UiEditorPreview.bas b/InForm/UiEditorPreview.bas index e2393eb..5706b57 100644 --- a/InForm/UiEditorPreview.bas +++ b/InForm/UiEditorPreview.bas @@ -338,6 +338,8 @@ SUB __UI_BeforeUpdateDisplay CLOSE #FileToLoad LoadPreview + LoadDefaultFonts + UndoPointer = 0 TotalUndoImages = 0 SendSignal -7 'New form created @@ -912,7 +914,7 @@ SUB __UI_FormResized END SUB SUB __UI_OnLoad - + LoadDefaultFonts END SUB SUB __UI_KeyPress (id AS LONG) @@ -2049,3 +2051,21 @@ SUB RestoreRedoImage LoadPreview END SUB + +SUB LoadDefaultFonts + IF Control(__UI_FormID).Font = 8 OR Control(__UI_FormID).Font = 16 THEN + Control(__UI_FormID).Font = SetFont("segoeui.ttf", 12) + END IF + IF Control(__UI_FormID).Font = 8 OR Control(__UI_FormID).Font = 16 THEN + Control(__UI_FormID).Font = SetFont("arial.ttf", 12) + END IF + IF Control(__UI_FormID).Font = 8 OR Control(__UI_FormID).Font = 16 THEN + Control(__UI_FormID).Font = SetFont("cour.ttf", 12) + END IF + IF Control(__UI_FormID).Font = 8 OR Control(__UI_FormID).Font = 16 THEN + Control(__UI_FormID).Font = SetFont("/Library/Fonts/Arial.ttf", 12) + END IF + IF Control(__UI_FormID).Font = 8 OR Control(__UI_FormID).Font = 16 THEN + Control(__UI_FormID).Font = SetFont("InForm/resources/NotoMono-Regular.ttf", 12) + END IF +END SUB diff --git a/InForm/UiEditorPreview.frm b/InForm/UiEditorPreview.frm index 48615d7..880eb46 100644 --- a/InForm/UiEditorPreview.frm +++ b/InForm/UiEditorPreview.frm @@ -7,7 +7,7 @@ SUB __UI_LoadForm $RESIZE:ON __UI_NewID = __UI_NewControl(__UI_Type_Form, "Form1", 300, 300, 0, 0,0) - Control(__UI_NewID).Font = SetFont("segoeui.ttf?arial.ttf?/Library/Fonts/Arial.ttf?InForm/resources/NotoMono-Regular.ttf?cour.ttf", 12) + END SUB SUB __UI_AssignIDs