Yes, you can cancel the effects of a system-font-size change in your app.
Public access As Accessibility
Public systemFontScale As Float = access.GetUserFontScale
...
somebutton.TextSize = somebutton.TextSize / systemFontScale
Basically, we get the system's font scaling (e.g. 1.5 for a larger-than-normal font), then we divide a widget's textSize by that same factor, canceling the system's font-size change.
In general, we should respect the user's choice of bigger (or smaller) font size, but it also can make it very hard for developers to present a tidy and consistent UI at the same time. So I've compromised with this hybrid approach:
- Text that is tight for space (e.g. title bars, checkbox text that might wrap, etc.) gets "de-scaled" as shown above, so that it's the size I designed.
- All other text (e.g. text-input fields, multi-line labels and fields, etc.) follows the user's desired scaling (by not canceling it).
- I give the user an explicit way to control the size of layouts (e.g. small/normal/large), so I can scale not only the text size but also the spacing of list items, etc.).
This takes some code, but it's not hard and it results in an app that offers smaller/larger layouts as desired, without making the app looks messy at really big system-font sizes.
Hope this helps!