Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GPII-1716: Windows font-size #506

Open
wants to merge 20 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
d4d416f
GPII-1716: Added font-size support, via SPI_SETNONCLIENTMETRICS and S…
stegru Mar 8, 2017
34e40f2
GPII-1716: Using the appropriate value for the font-size.
stegru Mar 9, 2017
6f77671
Merge remote-tracking branch 'upstream/master' into GPII-1716
stegru Jun 21, 2017
74a7630
GPII-1716: Improved comments.
stegru Jun 23, 2017
02f9c4f
Merge remote-tracking branch 'upstream/master' into GPII-1716
stegru Aug 2, 2017
f54ebf7
Merge remote-tracking branch 'upstream/master' into GPII-1716
stegru Aug 7, 2017
bd67cb1
Merge remote-tracking branch 'upstream/master' into GPII-1716
stegru Sep 8, 2017
e261f54
Merge remote-tracking branch 'upstream/master' into GPII-1716
stegru Oct 10, 2017
52f0a12
Merge remote-tracking branch 'upstream/master' into GPII-1716
stegru Feb 19, 2018
0f96070
GPII-1716: Added solution description
stegru Feb 20, 2018
9f67b19
Merge remote-tracking branch 'upstream/master' into GPII-1716
stegru Apr 3, 2018
1ef6bab
GPII-1716: Improved comment for strange action.
stegru Apr 4, 2018
50ff3f0
GPII-1716: Added fontsize test.
stegru Apr 5, 2018
542ba7a
GPII-1716: Added note about the height hack for font size.
stegru Apr 5, 2018
eeac4eb
GPII-1716: Acceptance tests that work.
stegru Apr 12, 2018
05ad1e7
Merge remote-tracking branch 'upstream/master' into GPII-1716
stegru May 7, 2018
79fe482
Merge remote-tracking branch 'upstream/master' into GPII-1716
stegru Jun 20, 2018
bba86ec
GPII-1716: Fixed test fault
stegru Jun 21, 2018
81da090
GPII-1716: Fixed test fault again
stegru Jun 21, 2018
44308d3
GPII-1716: Fixed test fault again
stegru Jun 21, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions testData/deviceReporter/installedSolutions.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@
"id": "com.microsoft.windows.highContrastTheme"
},

{
"id": "com.microsoft.windows.fontSize"
},

{
"id": "com.microsoft.windows.stickyKeys"
},
Expand Down
178 changes: 178 additions & 0 deletions testData/solutions/win32.json5
Original file line number Diff line number Diff line change
Expand Up @@ -1876,6 +1876,184 @@
]
},

"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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank God we now have comments!

// 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 pixel heights will grow, but will not shrink back, so set the value to something so it will
// be restored.
"CaptionHeight": {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why all these last transformations don't have mappings to common terms?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These values set the height of the element - they're listed here so they are set back to the same value.

Without them, a larger font will make the height grow, but restoring a smaller font doesn't make the height shrink back down.

"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"
}
}
}
},
"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": {
Expand Down