diff --git a/gpii/node_modules/matchMakerFramework/test/data/os_win7.json b/gpii/node_modules/matchMakerFramework/test/data/os_win7.json index 99ed5c822..1479bcc41 100644 --- a/gpii/node_modules/matchMakerFramework/test/data/os_win7.json +++ b/gpii/node_modules/matchMakerFramework/test/data/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/gpii/node_modules/matchMakerFramework/test/inverseCapabilities/os_win7_expected.json b/gpii/node_modules/matchMakerFramework/test/inverseCapabilities/os_win7_expected.json index 55984b001..6c9c2bb8d 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 2c08eb78d..e0d481216 100644 --- a/testData/deviceReporter/acceptanceTests/win7_builtIn.json +++ b/testData/deviceReporter/acceptanceTests/win7_builtIn.json @@ -45,6 +45,10 @@ { "id": "com.microsoft.windows.typingEnhancement" + }, + + { + "id": "com.microsoft.windows.fontSize" } ] diff --git a/testData/deviceReporter/installedSolutions.json b/testData/deviceReporter/installedSolutions.json index 822af2a2f..14ad73bdb 100644 --- a/testData/deviceReporter/installedSolutions.json +++ b/testData/deviceReporter/installedSolutions.json @@ -55,6 +55,10 @@ "id": "com.microsoft.windows.highContrastTheme" }, + { + "id": "com.microsoft.windows.fontSize" + }, + { "id": "com.microsoft.windows.stickyKeys" }, 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..04f391fb6 --- /dev/null +++ b/testData/solutions/solutionsDescription/com_microsoft_windows_fontSize.md @@ -0,0 +1,41 @@ +# 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. + +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. + +## Limitations + +This doesn't set the size of all text, only those listed above. Some applications may ignore this setting. diff --git a/testData/solutions/win32.json5 b/testData/solutions/win32.json5 index 75d895190..b5e3395b2 100644 --- a/testData/solutions/win32.json5 +++ b/testData/solutions/win32.json5 @@ -2021,6 +2021,195 @@ ] }, + "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. + // 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": {}, + "SmallCaptionFont": {}, + "MenuFont": {}, + "StatusFont": {}, + "MessageFont": {}, + "CaptionHeight": {}, + "SmCaptionHeight": {}, + "MenuHeight": {} + }, + "capabilities": [ + "http://registry\\.gpii\\.net/common/fontSize" + ], + "capabilitiesTransformations": { + "CaptionFont": { + "transform": { + "type": "fluid.transforms.linearScale", + "factor": -1, + "inputPath": "http://registry\\.gpii\\.net/common/fontSize", + "outputPath": "value" + }, + "path": { + "literalValue": "pvParam.lfCaptionFont.lfHeight" + } + }, + "SmallCaptionFont": { + "transform": { + "type": "fluid.transforms.linearScale", + "factor": -1, + "inputPath": "http://registry\\.gpii\\.net/common/fontSize", + "outputPath": "value" + }, + "path": { + "literalValue": "pvParam.lfSmCaptionFont.lfHeight" + } + }, + "MenuFont": { + "transform": { + "type": "fluid.transforms.linearScale", + "factor": -1, + "inputPath": "http://registry\\.gpii\\.net/common/fontSize", + "outputPath": "value" + }, + "path": { + "literalValue": "pvParam.lfMenuFont.lfHeight" + } + }, + "StatusFont": { + "transform": { + "type": "fluid.transforms.linearScale", + "factor": -1, + "inputPath": "http://registry\\.gpii\\.net/common/fontSize", + "outputPath": "value" + }, + "path": { + "literalValue": "pvParam.lfStatusFont.lfHeight" + } + }, + "MessageFont": { + "transform": { + "type": "fluid.transforms.linearScale", + "factor": -1, + "inputPath": "http://registry\\.gpii\\.net/common/fontSize", + "outputPath": "value" + }, + "path": { + "literalValue": "pvParam.lfMessageFont.lfHeight" + } + }, + // 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", + "inputPath": "pvParam.iCaptionHeight", + "outputPath": "value" + }, + "path": { + "literalValue": "pvParam.iCaptionHeight" + } + }, + "SmCaptionHeight": { + "transform": { + "type": "fluid.transforms.literalValue", + "inputPath": "pvParam.iSmCaptionHeight", + "outputPath": "value" + }, + "path": { + "literalValue": "pvParam.iSmCaptionHeight" + } + }, + "MenuHeight": { + "transform": { + "type": "fluid.transforms.literalValue", + "inputPath": "pvParam.iMenuHeight", + "outputPath": "value" + }, + "path": { + "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", + "options": { + "getAction": "SPI_GETICONTITLELOGFONT", + "setAction": "SPI_SETICONTITLELOGFONT", + "uiParam": "struct_size", + "pvParam": { + "type": "struct", + "name": "LOGFONT" + }, + // Because configure.NonClientMetrics is called after this one, fWinIni doesn't need to be set here. + "verifySettings": true + }, + "supportedSettings": { + "IconTitleFont": {} + }, + "capabilities": [ + "http://registry\\.gpii\\.net/common/fontSize" + ], + "capabilitiesTransformations": { + "IconTitleFont": { + "transform": { + "type": "fluid.transforms.linearScale", + "factor": -1, + "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": { 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 } } } diff --git a/tests/platform/windows/windows-builtIn-testSpec.js b/tests/platform/windows/windows-builtIn-testSpec.js index 4db1c6149..070ff62bc 100644 --- a/tests/platform/windows/windows-builtIn-testSpec.js +++ b/tests/platform/windows/windows-builtIn-testSpec.js @@ -176,6 +176,25 @@ gpii.tests.windows.builtIn = [ } } } + ], + "com.microsoft.windows.fontSize": [ + { // 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" + } + } + } ] }, "gpii.windows.registrySettingsHandler": { @@ -710,6 +729,25 @@ gpii.tests.windows.builtIn = [ } } } + ], + "com.microsoft.windows.fontSize": [ + { // 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" + } + } + } ] }, "gpii.windows.registrySettingsHandler": {