From d4d416f09cec953579e6c6dd18d0116fd86ce938 Mon Sep 17 00:00:00 2001 From: ste Date: Wed, 8 Mar 2017 15:44:32 +0000 Subject: [PATCH 01/11] GPII-1716: Added font-size support, via SPI_SETNONCLIENTMETRICS and SPI_SETICONTITLELOGFONT --- .../deviceReporter/installedSolutions.json | 4 + testData/solutions/win32.json5 | 158 ++++++++++++++++++ 2 files changed, 162 insertions(+) diff --git a/testData/deviceReporter/installedSolutions.json b/testData/deviceReporter/installedSolutions.json index 5323934ce..88a9e61f9 100644 --- a/testData/deviceReporter/installedSolutions.json +++ b/testData/deviceReporter/installedSolutions.json @@ -47,6 +47,10 @@ "id": "com.microsoft.windows.highContrastTheme" }, + { + "id": "com.microsoft.windows.fontSize" + }, + { "id": "com.microsoft.windows.mouseTrailing" }, diff --git a/testData/solutions/win32.json5 b/testData/solutions/win32.json5 index fbcc3d109..fc735c269 100644 --- a/testData/solutions/win32.json5 +++ b/testData/solutions/win32.json5 @@ -1548,6 +1548,164 @@ ] }, + "com.microsoft.windows.fontSize": { + "name": "Windows Font Size", + "contexts": { + "OS": [ + { + "id": "win32", + "version": ">=5.0" + } + ] + }, + "settingsHandlers": { + "configure.NonClientMetrics": { + "type": "gpii.windows.spiSettingsHandler", + "options": { + "getAction": "SPI_GETNONCLIENTMETRICS", + "setAction": "SPI_SETNONCLIENTMETRICS", + "uiParam": "struct_size", + "pvParam": { + "type": "struct", + "name": "NONCLIENTMETRICS" + }, + "fWinIni": "SPIF_UPDATEINIFILE|SPIF_SENDCHANGE", // It won't update if these flags aren't set. + "verifySettings": false // The next GET will be different to the last SET + }, + "supportedSettings": { + "CaptionFont": {}, + "SmallCaptionFont": {}, + "MenuFont": {}, + "StatusFont": {}, + "MessageFont": {}, + "CaptionHeight": {}, + "SmCaptionHeight": {}, + "MenuHeight": {} + }, + "capabilities": [ + "http://registry\\.gpii\\.net/common/fontSize" + ], + "capabilitiesTransformations": { + "CaptionFont": { + "transform": { + "type": "fluid.transforms.value", + "inputPath": "http://registry\\.gpii\\.net/common/fontSize", + "outputPath": "value" + }, + "path": { + "literalValue": "pvParam.lfCaptionFont.lfHeight" + } + }, + "SmallCaptionFont": { + "transform": { + "type": "fluid.transforms.value", + "inputPath": "http://registry\\.gpii\\.net/common/fontSize", + "outputPath": "value" + }, + "path": { + "literalValue": "pvParam.lfSmCaptionFont.lfHeight" + } + }, + "MenuFont": { + "transform": { + "type": "fluid.transforms.value", + "inputPath": "http://registry\\.gpii\\.net/common/fontSize", + "outputPath": "value" + }, + "path": { + "literalValue": "pvParam.lfMenuFont.lfHeight" + } + }, + "StatusFont": { + "transform": { + "type": "fluid.transforms.value", + "inputPath": "http://registry\\.gpii\\.net/common/fontSize", + "outputPath": "value" + }, + "path": { + "literalValue": "pvParam.lfStatusFont.lfHeight" + } + }, + "MessageFont": { + "transform": { + "type": "fluid.transforms.value", + "inputPath": "http://registry\\.gpii\\.net/common/fontSize", + "outputPath": "value" + }, + "path": { + "literalValue": "pvParam.lfMessageFont.lfHeight" + } + }, + /* Set the pixel heights to 0 so they are calculated based on the font height */ + "CaptionHeight": { + "literalValue": { + "path": "pvParam.iCaptionHeight", + "value": 0 + } + }, + "SmCaptionHeight": { + "literalValue": { + "path": "pvParam.iSmCaptionHeight", + "value": 0 + } + }, + "MenuHeight": { + "literalValue": { + "path": "pvParam.iMenuHeight", + "value": 0 + } + } + } + }, + "configure.IconTitle": { + "type": "gpii.windows.spiSettingsHandler", + "options": { + "getAction": "SPI_GETICONTITLELOGFONT", + "setAction": "SPI_SETICONTITLELOGFONT", + "uiParam": "struct_size", + "pvParam": { + "type": "struct", + "name": "LOGFONT" + }, + // If configure.NonClientMetrics is called after this one, then fWinIni doesn't need to be set. + //"fWinIni": "SPIF_UPDATEINIFILE|SPIF_SENDCHANGE", // It won't update if these flags aren't set. + "verifySettings": true + }, + "supportedSettings": { + "IconTitleFont": {}, + }, + "capabilities": [ + "http://registry\\.gpii\\.net/common/fontSize" + ], + "capabilitiesTransformations": { + "IconTitleFont": { + "transform": { + "type": "fluid.transforms.value", + "inputPath": "http://registry\\.gpii\\.net/common/fontSize", + "outputPath": "value" + }, + "path": { + "literalValue": "pvParam.lfHeight" + } + } + } + } + }, + "configure": [ + "settings.configure.IconTitle", + "settings.configure.NonClientMetrics" + ], + "restore": [ + "settings.configure.IconTitle", + "settings.configure.NonClientMetrics" + ], + "isInstalled": [ + { + "type": "gpii.deviceReporter.alwaysInstalled" + } + ] + }, + "com.microsoft.windows.stickyKeys": { "name": "Windows StickyKeys", "contexts": { From 34e40f225a2b4fd56df17362d5cba7b9c3a0bea9 Mon Sep 17 00:00:00 2001 From: ste Date: Thu, 9 Mar 2017 13:29:44 +0000 Subject: [PATCH 02/11] GPII-1716: Using the appropriate value for the font-size. --- testData/solutions/win32.json5 | 55 +++++++++++++++++++++++----------- 1 file changed, 37 insertions(+), 18 deletions(-) diff --git a/testData/solutions/win32.json5 b/testData/solutions/win32.json5 index fc735c269..25c962ef3 100644 --- a/testData/solutions/win32.json5 +++ b/testData/solutions/win32.json5 @@ -1570,7 +1570,7 @@ "name": "NONCLIENTMETRICS" }, "fWinIni": "SPIF_UPDATEINIFILE|SPIF_SENDCHANGE", // It won't update if these flags aren't set. - "verifySettings": false // The next GET will be different to the last SET + "verifySettings": false // The next GET will be different to the last SET. }, "supportedSettings": { "CaptionFont": {}, @@ -1588,7 +1588,8 @@ "capabilitiesTransformations": { "CaptionFont": { "transform": { - "type": "fluid.transforms.value", + "type": "fluid.transforms.linearScale", + "factor": -1, "inputPath": "http://registry\\.gpii\\.net/common/fontSize", "outputPath": "value" }, @@ -1598,7 +1599,8 @@ }, "SmallCaptionFont": { "transform": { - "type": "fluid.transforms.value", + "type": "fluid.transforms.linearScale", + "factor": -1, "inputPath": "http://registry\\.gpii\\.net/common/fontSize", "outputPath": "value" }, @@ -1608,7 +1610,8 @@ }, "MenuFont": { "transform": { - "type": "fluid.transforms.value", + "type": "fluid.transforms.linearScale", + "factor": -1, "inputPath": "http://registry\\.gpii\\.net/common/fontSize", "outputPath": "value" }, @@ -1618,7 +1621,8 @@ }, "StatusFont": { "transform": { - "type": "fluid.transforms.value", + "type": "fluid.transforms.linearScale", + "factor": -1, "inputPath": "http://registry\\.gpii\\.net/common/fontSize", "outputPath": "value" }, @@ -1628,7 +1632,8 @@ }, "MessageFont": { "transform": { - "type": "fluid.transforms.value", + "type": "fluid.transforms.linearScale", + "factor": -1, "inputPath": "http://registry\\.gpii\\.net/common/fontSize", "outputPath": "value" }, @@ -1636,23 +1641,36 @@ "literalValue": "pvParam.lfMessageFont.lfHeight" } }, - /* Set the pixel heights to 0 so they are calculated based on the font height */ + // The pixel heights will grow, but will not shrink back, so set the value to something so it will + // be restored. "CaptionHeight": { - "literalValue": { - "path": "pvParam.iCaptionHeight", - "value": 0 + "transform": { + "type": "fluid.transforms.literalValue", + "inputPath": "pvParam.iCaptionHeight", + "outputPath": "value" + }, + "path": { + "literalValue": "pvParam.iCaptionHeight" } }, "SmCaptionHeight": { - "literalValue": { - "path": "pvParam.iSmCaptionHeight", - "value": 0 + "transform": { + "type": "fluid.transforms.literalValue", + "inputPath": "pvParam.iSmCaptionHeight", + "outputPath": "value" + }, + "path": { + "literalValue": "pvParam.iSmCaptionHeight" } }, "MenuHeight": { - "literalValue": { - "path": "pvParam.iMenuHeight", - "value": 0 + "transform": { + "type": "fluid.transforms.literalValue", + "inputPath": "pvParam.iMenuHeight", + "outputPath": "value" + }, + "path": { + "literalValue": "pvParam.iMenuHeight" } } } @@ -1672,7 +1690,7 @@ "verifySettings": true }, "supportedSettings": { - "IconTitleFont": {}, + "IconTitleFont": {} }, "capabilities": [ "http://registry\\.gpii\\.net/common/fontSize" @@ -1680,7 +1698,8 @@ "capabilitiesTransformations": { "IconTitleFont": { "transform": { - "type": "fluid.transforms.value", + "type": "fluid.transforms.linearScale", + "factor": -1, "inputPath": "http://registry\\.gpii\\.net/common/fontSize", "outputPath": "value" }, From 74a7630342d543263724781b5a7838170d480770 Mon Sep 17 00:00:00 2001 From: ste Date: Fri, 23 Jun 2017 09:26:26 +0100 Subject: [PATCH 03/11] GPII-1716: Improved comments. --- testData/solutions/win32.json5 | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/testData/solutions/win32.json5 b/testData/solutions/win32.json5 index 60efd5a8d..8867280a8 100644 --- a/testData/solutions/win32.json5 +++ b/testData/solutions/win32.json5 @@ -1570,7 +1570,9 @@ "name": "NONCLIENTMETRICS" }, "fWinIni": "SPIF_UPDATEINIFILE|SPIF_SENDCHANGE", // It won't update if these flags aren't set. - "verifySettings": false // The next GET will be different to the last SET. + // The next GET will be different to the last SET, because the value of lfHeight sets the character + // height (negated), but receives it as the cell height. + "verifySettings": false }, "supportedSettings": { "CaptionFont": {}, @@ -1685,8 +1687,7 @@ "type": "struct", "name": "LOGFONT" }, - // If configure.NonClientMetrics is called after this one, then fWinIni doesn't need to be set. - //"fWinIni": "SPIF_UPDATEINIFILE|SPIF_SENDCHANGE", // It won't update if these flags aren't set. + // Because configure.NonClientMetrics is called after this one, fWinIni doesn't need to be set here. "verifySettings": true }, "supportedSettings": { From 0f960703aae120ddd3642cd126ee6f80f46ac5e4 Mon Sep 17 00:00:00 2001 From: ste Date: Tue, 20 Feb 2018 10:29:57 +0000 Subject: [PATCH 04/11] GPII-1716: Added solution description --- .../com_microsoft_windows_fontSize.md | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 testData/solutions/solutionsDescription/com_microsoft_windows_fontSize.md diff --git a/testData/solutions/solutionsDescription/com_microsoft_windows_fontSize.md b/testData/solutions/solutionsDescription/com_microsoft_windows_fontSize.md new file mode 100644 index 000000000..44acd6b35 --- /dev/null +++ b/testData/solutions/solutionsDescription/com_microsoft_windows_fontSize.md @@ -0,0 +1,38 @@ +# Windows Screen Scaling + +## Details + +* __Name__: Windows Font Size +* __Id__: com.microsoft.windows.fontSize +* __Platform__: Windows +* __Contact__: Steve Grundell + +## Description + +This solution enables the resizing of the font in certain Windows components, without effecting the resolution or DPI setting. + +The text of the following elements are re-sized, where the native component is used: +* Window title bar. +* Menus. +* Status bars. +* Icon labels. +* Tooltips. +* Message boxes. + +See also: + +* [GPII-1716](https://issues.gpii.net/browse/GPII-1716) +* [NONCLIENTMETRICS structure](https://msdn.microsoft.com/library/ff729175) +* [screenDPI solution](com_microsoft_windows_screenDPI.md), to resize all fonts. + +## Integration + +SystemParametersInfo is called, with SPI_SETNONCLIENTMETRICS. The unit is the approximate height of the font in pixels. + +## Testing + +The user [gert](../../preferences/gert.json) can be used to test this solution. The font-size should increase. + +## Limitations + +This doesn't set the size of all text, only those listed above. Some applications may ignore this setting. From 1ef6bab8ed51e462ce4522a985ad6055dcb5cac6 Mon Sep 17 00:00:00 2001 From: ste Date: Wed, 4 Apr 2018 11:24:50 +0100 Subject: [PATCH 05/11] GPII-1716: Improved comment for strange action. --- testData/solutions/win32.json5 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/testData/solutions/win32.json5 b/testData/solutions/win32.json5 index ddedc3de1..d57b80313 100644 --- a/testData/solutions/win32.json5 +++ b/testData/solutions/win32.json5 @@ -2201,8 +2201,9 @@ "literalValue": "pvParam.lfMessageFont.lfHeight" } }, - // The pixel heights will grow, but will not shrink back, so set the value to something so it will - // be restored. + // The following three values are no-ops, which set the value to the same value. The reason behind + // them is that these heights will grow with a larger font, but will not shrink back with a smaller + // one. They're set here so GPII will restore them. "CaptionHeight": { "transform": { "type": "fluid.transforms.literalValue", From 50ff3f0835d38c30eb6c5b7adbb5ff8281632b53 Mon Sep 17 00:00:00 2001 From: ste Date: Thu, 5 Apr 2018 15:14:51 +0100 Subject: [PATCH 06/11] GPII-1716: Added fontsize test. --- .../platform/windows/windows-builtIn-testSpec.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/platform/windows/windows-builtIn-testSpec.js b/tests/platform/windows/windows-builtIn-testSpec.js index de5b6b43f..0153d54a9 100644 --- a/tests/platform/windows/windows-builtIn-testSpec.js +++ b/tests/platform/windows/windows-builtIn-testSpec.js @@ -125,6 +125,22 @@ gpii.tests.windows.builtIn = [ "name": "HIGHCONTRAST" } } + }, { // font size settings + "settings": { + "CaptionFont": { + "path": "pvParam.lfCaptionFont.lfHeight", + "value": -12 + } + }, + "options": { + "getAction": "SPI_GETNONCLIENTMETRICS", + "setAction": "SPI_SETNONCLIENTMETRICS", + "uiParam": "struct_size", + "pvParam": { + "type": "struct", + "name": "NONCLIENTMETRICS" + } + } } ] }, From 542ba7a66b642057d383b65c3e0aaa410bb7c410 Mon Sep 17 00:00:00 2001 From: ste Date: Thu, 5 Apr 2018 15:24:22 +0100 Subject: [PATCH 07/11] GPII-1716: Added note about the height hack for font size. --- .../solutionsDescription/com_microsoft_windows_fontSize.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/testData/solutions/solutionsDescription/com_microsoft_windows_fontSize.md b/testData/solutions/solutionsDescription/com_microsoft_windows_fontSize.md index 44acd6b35..04f391fb6 100644 --- a/testData/solutions/solutionsDescription/com_microsoft_windows_fontSize.md +++ b/testData/solutions/solutionsDescription/com_microsoft_windows_fontSize.md @@ -29,6 +29,9 @@ See also: SystemParametersInfo is called, with SPI_SETNONCLIENTMETRICS. The unit is the approximate height of the font in pixels. +This solution also sets the pixel height of each display element to the its current value. This is because increasing +the font size causes the heights to grow, but decreasing the font (when restoring) leaves the enlarged sizes. + ## Testing The user [gert](../../preferences/gert.json) can be used to test this solution. The font-size should increase. From eeac4eb2faedfca9a0ea6e951d37880005b84fbe Mon Sep 17 00:00:00 2001 From: ste Date: Thu, 12 Apr 2018 15:55:09 +0100 Subject: [PATCH 08/11] GPII-1716: Acceptance tests that work. --- .../inverseCapabilities/os_win7_expected.json | 3 +++ .../acceptanceTests/win7_builtIn.json | 4 ++++ .../preferences/acceptanceTests/os_win7.json | 6 ++++++ testData/solutions/win32.json5 | 10 ++++++++++ .../windows/windows-builtIn-testSpec.js | 18 +++++++++++++++++- 5 files changed, 40 insertions(+), 1 deletion(-) diff --git a/gpii/node_modules/matchMakerFramework/test/inverseCapabilities/os_win7_expected.json b/gpii/node_modules/matchMakerFramework/test/inverseCapabilities/os_win7_expected.json index 46256f3f6..43cc78358 100644 --- a/gpii/node_modules/matchMakerFramework/test/inverseCapabilities/os_win7_expected.json +++ b/gpii/node_modules/matchMakerFramework/test/inverseCapabilities/os_win7_expected.json @@ -30,6 +30,9 @@ "http://registry.gpii.net/common/debounceInterval": 1 }, "com.microsoft.windows.screenResolution": {}, + "com.microsoft.windows.fontSize": { + "http://registry.gpii.net/common/fontSize": 9 + }, "com.microsoft.windows.screenDPI": { "http://registry.gpii.net/common/DPIScale": 1 }, diff --git a/testData/deviceReporter/acceptanceTests/win7_builtIn.json b/testData/deviceReporter/acceptanceTests/win7_builtIn.json index b67014811..a623c6cb5 100644 --- a/testData/deviceReporter/acceptanceTests/win7_builtIn.json +++ b/testData/deviceReporter/acceptanceTests/win7_builtIn.json @@ -41,6 +41,10 @@ { "id": "com.microsoft.windows.narrator" + }, + + { + "id": "com.microsoft.windows.fontSize" } ] diff --git a/testData/preferences/acceptanceTests/os_win7.json b/testData/preferences/acceptanceTests/os_win7.json index afd2e6fda..a77a7cf57 100644 --- a/testData/preferences/acceptanceTests/os_win7.json +++ b/testData/preferences/acceptanceTests/os_win7.json @@ -49,6 +49,12 @@ "value": true } }, + "http://registry.gpii.net/applications/com.microsoft.windows.fontSize": { + "CaptionFont": { + "path": "pvParam.lfCaptionFont.lfHeight", + "value": -9 + } + }, "http://registry.gpii.net/applications/com.microsoft.windows.cursors": { "No": "%SystemRoot%\\cursors\\aero_unavail_xl.cur", "Hand": "%SystemRoot%\\cursors\\aero_link_xl.cur", diff --git a/testData/solutions/win32.json5 b/testData/solutions/win32.json5 index d57b80313..b49648d49 100644 --- a/testData/solutions/win32.json5 +++ b/testData/solutions/win32.json5 @@ -2234,7 +2234,17 @@ "literalValue": "pvParam.iMenuHeight" } } + }, + "inverseCapabilitiesTransformations": { + "http://registry\\.gpii\\.net/common/fontSize": { + "transform": { + "type": "fluid.transforms.linearScale", + "factor": -1, + "inputPath": "CaptionFont.value" + } + } } + }, "configure.IconTitle": { "type": "gpii.windows.spiSettingsHandler", diff --git a/tests/platform/windows/windows-builtIn-testSpec.js b/tests/platform/windows/windows-builtIn-testSpec.js index 0153d54a9..70c304c3a 100644 --- a/tests/platform/windows/windows-builtIn-testSpec.js +++ b/tests/platform/windows/windows-builtIn-testSpec.js @@ -129,7 +129,7 @@ gpii.tests.windows.builtIn = [ "settings": { "CaptionFont": { "path": "pvParam.lfCaptionFont.lfHeight", - "value": -12 + "value": -9 } }, "options": { @@ -337,6 +337,22 @@ gpii.tests.windows.builtIn = [ "name": "HIGHCONTRAST" } } + }, { // font size settings + "settings": { + "CaptionFont": { + "path": "pvParam.lfCaptionFont.lfHeight", + "value": -9 + } + }, + "options": { + "getAction": "SPI_GETNONCLIENTMETRICS", + "setAction": "SPI_SETNONCLIENTMETRICS", + "uiParam": "struct_size", + "pvParam": { + "type": "struct", + "name": "NONCLIENTMETRICS" + } + } } ] }, From bba86ec6cc4e0e1e13b9c224c7d40cd129760219 Mon Sep 17 00:00:00 2001 From: ste Date: Thu, 21 Jun 2018 16:56:38 +0100 Subject: [PATCH 09/11] GPII-1716: Fixed test fault --- tests/platform/windows/windows-builtIn-testSpec.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/platform/windows/windows-builtIn-testSpec.js b/tests/platform/windows/windows-builtIn-testSpec.js index b3891413f..85f41220b 100644 --- a/tests/platform/windows/windows-builtIn-testSpec.js +++ b/tests/platform/windows/windows-builtIn-testSpec.js @@ -725,7 +725,10 @@ gpii.tests.windows.builtIn = [ "name": "HIGHCONTRAST" } } - }, { // font size settings + } + ], + "com.microsoft.windows.fontSize": [ + { // font size settings "settings": { "CaptionFont": { "path": "pvParam.lfCaptionFont.lfHeight", From 81da090767c79802ce701e29eae63f9c73877a41 Mon Sep 17 00:00:00 2001 From: ste Date: Thu, 21 Jun 2018 20:21:29 +0100 Subject: [PATCH 10/11] GPII-1716: Fixed test fault again --- tests/platform/windows/windows-builtIn-testSpec.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/platform/windows/windows-builtIn-testSpec.js b/tests/platform/windows/windows-builtIn-testSpec.js index 85f41220b..070ff62bc 100644 --- a/tests/platform/windows/windows-builtIn-testSpec.js +++ b/tests/platform/windows/windows-builtIn-testSpec.js @@ -175,7 +175,10 @@ gpii.tests.windows.builtIn = [ "name": "HIGHCONTRAST" } } - }, { // font size settings + } + ], + "com.microsoft.windows.fontSize": [ + { // font size settings "settings": { "CaptionFont": { "path": "pvParam.lfCaptionFont.lfHeight", From 44308d3e7b91d680027f06a739ec08172ccd742f Mon Sep 17 00:00:00 2001 From: ste Date: Thu, 21 Jun 2018 22:40:17 +0100 Subject: [PATCH 11/11] GPII-1716: Fixed test fault again --- tests/data/preferences/os_win7.json5 | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/data/preferences/os_win7.json5 b/tests/data/preferences/os_win7.json5 index 99ed5c822..45be83e8c 100644 --- a/tests/data/preferences/os_win7.json5 +++ b/tests/data/preferences/os_win7.json5 @@ -49,6 +49,12 @@ "value": true } }, + "http://registry.gpii.net/applications/com.microsoft.windows.fontSize": { + "CaptionFont": { + "path": "pvParam.lfCaptionFont.lfHeight", + "value": -9 + }, + }, "http://registry.gpii.net/applications/com.microsoft.windows.cursors": { "No": "%SystemRoot%\\cursors\\aero_unavail_xl.cur", "Hand": "%SystemRoot%\\cursors\\aero_link_xl.cur", @@ -100,7 +106,7 @@ "EnableAutoShiftEngage": 1, "EnableShiftLock": 1, "EnableCompatibilityKeyboard": 1, - "EnableDesktopModeAutoInvoke": 1 + "EnableDesktopModeAutoInvoke": 1 } } }