-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Support for font size scaling #2429
Comments
I agree; iOS also has system-wide settings that allow increasing the font size, and developers should be able to forward that setting to Mapbox GL. I imagine Android has a similar setting. |
Cool idea, on the platform level this would be simple to hook up. |
👍 |
Should we scale everything instead of only text?
@andreasviglakis @nickidlugash what do you think would be preferable from a design perspective? |
would it have to be all or nothing? i can imagine scenarios where we'd only want fonts and sprites to be enlarged. |
Yes, we can use font scale attribute for that |
It's definitely possible to scale only text/icons |
I'm looking now at Apple Maps on iOS with the largest font option; they basically only scale up text, and it seems pretty good. The label density is very low of course, but I'm not sure it would be possible or even desirable to try to maintain too much density. I'm also not sure scaling up other features will get us much more accessibility than just zooming in/out and/or using the native zoom feature (which on iOS anyway seems to work pretty well even though it decreases resolution). Apple also scales up all icons with text, e.g. highway shields, which would also be necessary for us to do. They don't scale up other icons, but, as @andreasviglakis mentioned, that might be useful too (and maybe even easier? Since our sprites assets are svgs and we can probably just output a larger sprite?) If we need to dynamically adjust any other properties due to the increased font size, would that be an option? I think most (if not all) will be fine, but perhaps something like |
One approach might be to start with OS accessibility settings affecting just text, then see how that plays, then even consider a GL style spec option for specifying other features that could vary this way? |
👍 for text as a start point. However, @andreasviglakis pointed out that some sprites (eg. highway shields) would need to be scaled as well. |
#7030 is another take that would happen entirely at the SDK level (depending on some mbgl changes that have to happen anyways for other features). |
For anyone interested we have open-sourced a "simple" approach to adjusting the fonts to match the user's preferred content size: https://github.com/iosphere/ISHMapboxDynamicFontObserver |
This issue has been automatically detected as stale because it has not had recent activity and will be archived. Thank you for your contributions. |
Mapbox API should have support for font size scaling. This enables applications to better adapt their interfaces for people with visual impairment.
Font size scaling information comes from client side. I propose a
fontScale
getter/setter inmbgl::Map
class that defaults to1.0
(float). This value acts as a multiplier when rendering fonts, with higher values increasing the font sizes specified in the style, and lower values decreasing accordingly.Thoughts?
/cc @mapbox/gl @mapbox/mobile
The text was updated successfully, but these errors were encountered: