You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Operating systems generally offer a system-wide font-scaling setting for accessibility.
MapLibre should respect this setting and scale fonts with this value, just as it respects the device's display density.
UI.mp4
Use case
When I have bad eyes or generally just a display that displays text too small, I want the accessibility setting to apply to all text in all apps.
Solution I'd like
multiply the resulting font size by the system font-scaling
update documentation
Alternatives I've considered
It is possible to implement this oneself as a developer by iterating through all symbol layers with text and change the font size by multiplying it oneself. But this is awkward and complex especially when the font size is an expression and needs to be done by developers of every app that uses MapLibre, so support for this, at best, would forever be spotty.
Additional context
The Google Maps SDK does correctly scale all text by the system-wide font-scaling setting.
I think it's a good idea to implement this, but we should probably make it opt-in to be backwards compatible.
Note: Please do not use this to hardcode font size equations. The equation for font scaling is now non-linear; this coefficient is no longer used as a direct multiplier to determine font size. It exists for informational purposes only.
There are probably use cases where one would want a particular symbol or other layer to scale with text (for example: rendering text on top of a symbol). And perhaps cases where I want some text (labels) to respect the setting but other text (decorative) to not. So perhaps ["system-font-scale"] should be available to use in expressions? and then a "text-font-scale" parameter in SymbolLayer that is multiplied with "text-size" to determine the scaled text size. It would default to 1 initially and to ["system-font-scale"] after a major version bump.
Unsure how the JS SDK could/should handle these style spec changes.
I think it's a good idea to implement this, but we should probably make it opt-in to be backwards compatible.
Longer term (after a major version bump) I think making it opt-out is preferable, so apps using MapLibre are more accessible by default.
Operating systems generally offer a system-wide font-scaling setting for accessibility.
MapLibre should respect this setting and scale fonts with this value, just as it respects the device's display density.
UI.mp4
Use case
When I have bad eyes or generally just a display that displays text too small, I want the accessibility setting to apply to all text in all apps.
Solution I'd like
Alternatives I've considered
It is possible to implement this oneself as a developer by iterating through all symbol layers with text and change the font size by multiplying it oneself. But this is awkward and complex especially when the font size is an expression and needs to be done by developers of every app that uses MapLibre, so support for this, at best, would forever be spotty.
Additional context
The Google Maps SDK does correctly scale all text by the system-wide font-scaling setting.
The MapBox SDK does not.
For Android, the setting can be found in
Configuration::fontScale
For iOS, the information seems to be in UIFontMetrics.
The text was updated successfully, but these errors were encountered: