From 473f392e656007c7e811378d84e6a78091a33bc3 Mon Sep 17 00:00:00 2001 From: gambas Date: Mon, 15 Feb 2021 23:55:13 +0100 Subject: [PATCH 1/2] Compute font height in a way compatible with older versions of Pango. [GB.GTK] * BUG: Compute font height in a way compatible with older versions of Pango. [GB.GTK3] * BUG: Compute font height in a way compatible with older versions of Pango. --- gb.gtk/src/gfont.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/gb.gtk/src/gfont.cpp b/gb.gtk/src/gfont.cpp index 3a278fbe2..dc2c41180 100644 --- a/gb.gtk/src/gfont.cpp +++ b/gb.gtk/src/gfont.cpp @@ -609,7 +609,12 @@ int gFont::height(const char *text, int len) int gFont::height() { if (!_height) - _height = gt_pango_to_pixel(pango_font_metrics_get_height(metrics())); + { + float h1, h2; + textSize("A\nA", 3, NULL, &h1); + textSize("A\nA\nA", 5, NULL, &h2); + _height = gt_pango_to_pixel((h2 - h1) * PANGO_SCALE); + } return _height; } From 6f5e7032d25c91d250e38ab34cab3f22421c0e71 Mon Sep 17 00:00:00 2001 From: gambas Date: Mon, 15 Feb 2021 23:56:34 +0100 Subject: [PATCH 2/2] System information dialog: Add default font name and desktop scale. [DEVELOPMENT ENVIRONMENT] * NEW: System information dialog: Add default font name and desktop scale. --- app/src/gambas3/.project | 2 +- app/src/gambas3/.src/Editor/Form/FMenu.form | 5 ++--- app/src/gambas3/.src/Welcome/FSystemInfo.class | 2 ++ 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/app/src/gambas3/.project b/app/src/gambas3/.project index cb9005a6c..a1a6b9d2c 100644 --- a/app/src/gambas3/.project +++ b/app/src/gambas3/.project @@ -31,7 +31,7 @@ Component=gb.signal Description="Integrated Development Environment for Gambas" Authors="Benoît Minisini\nFabien Bodard\nCharlie Reinl\nJosé Luis Redrejo\nRobert Rowe\nTobias Boege" Arguments=[["-L"],["-t","/home/benoit/gambas/git/master/app/src/gambas3"],["--help"]] -Environment="GB_GUI=gb.qt5\n GTK_DEBUG=interactive" +Environment="GB_GUI=gb.gtk3\n GTK_DEBUG=interactive" TabSize=2 Translate=1 Language=en diff --git a/app/src/gambas3/.src/Editor/Form/FMenu.form b/app/src/gambas3/.src/Editor/Form/FMenu.form index dbf82d0b8..722708702 100644 --- a/app/src/gambas3/.src/Editor/Form/FMenu.form +++ b/app/src/gambas3/.src/Editor/Form/FMenu.form @@ -112,7 +112,7 @@ MoveScaled(34,11,0,21) } { VBox3 VBox - MoveScaled(41,1,64,59) + MoveScaled(41,1,63,59) Spacing = True Margin = True { lblCreate Label @@ -179,9 +179,8 @@ Text = "Shortcut" } { HBox3 HBox - MoveScaled(14,21,42,4) + MoveScaled(14,21,44,4) Expand = True - Spacing = True { chkCtrl CheckBox MoveScaled(0,0,10,4) #Translate = False diff --git a/app/src/gambas3/.src/Welcome/FSystemInfo.class b/app/src/gambas3/.src/Welcome/FSystemInfo.class index fa04e9617..26f323330 100644 --- a/app/src/gambas3/.src/Welcome/FSystemInfo.class +++ b/app/src/gambas3/.src/Welcome/FSystemInfo.class @@ -115,6 +115,8 @@ Static Public Sub GetInfo() As String[] aText.Add("Architecture=" & System.Architecture) aText.Add("Distribution=" & GetDistribution()) aText.Add("Desktop=" & Desktop.Type) + aText.Add("Font=" & Application.Font.ToString()) + aText.Add("Scale=" & Desktop.Scale) aText.Add("Theme=" & Style.Name) aText.Add("Language=" & System.Language)