Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Support for font size scaling #2429

Closed
brunoabinader opened this issue Sep 28, 2015 · 13 comments
Closed

Support for font size scaling #2429

brunoabinader opened this issue Sep 28, 2015 · 13 comments
Assignees
Labels
accessibility Integration with screen readers and other assistive technology archived Archived because of inactivity Core The cross-platform C++ core, aka mbgl feature MapKit parity For feature parity with MapKit on iOS or macOS

Comments

@brunoabinader
Copy link
Member

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 in mbgl::Map class that defaults to 1.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

@brunoabinader brunoabinader self-assigned this Sep 28, 2015
@kkaefer
Copy link
Contributor

kkaefer commented Sep 28, 2015

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.

@friedbunny
Copy link
Contributor

Cool idea, on the platform level this would be simple to hook up.

@mikemorris
Copy link
Contributor

👍

@ansis
Copy link
Contributor

ansis commented Sep 28, 2015

Should we scale everything instead of only text?

  • it could be useful to have non-text things like roads be more visible too
  • scaling only text could mess up proportions/density and make designing more complicated

@andreasviglakis @nickidlugash what do you think would be preferable from a design perspective?

@andreasviglakis
Copy link

would it have to be all or nothing? i can imagine scenarios where we'd only want fonts and sprites to be enlarged.

@tobrun
Copy link
Member

tobrun commented Sep 28, 2015

I imagine Android has a similar setting.

Yes, we can use font scale attribute for that

@ansis
Copy link
Contributor

ansis commented Sep 28, 2015

would it have to be all or nothing? i can imagine scenarios where we'd only want fonts and sprites to be enlarged.

It's definitely possible to scale only text/icons

@nickidlugash
Copy link
Contributor

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 symbol-spacing might need to be adjusted.

@incanus
Copy link
Contributor

incanus commented Sep 28, 2015

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?

@brunoabinader
Copy link
Member Author

One approach might be to start with OS accessibility settings affecting just text

👍 for text as a start point. However, @andreasviglakis pointed out that some sprites (eg. highway shields) would need to be scaled as well.

@1ec5
Copy link
Contributor

1ec5 commented Nov 11, 2016

#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).

@1ec5 1ec5 added the accessibility Integration with screen readers and other assistive technology label Dec 7, 2016
@kkaefer kkaefer added the Core The cross-platform C++ core, aka mbgl label May 30, 2017
@felixLam
Copy link

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

@stale stale bot added the archived Archived because of inactivity label Nov 5, 2018
@stale
Copy link

stale bot commented Dec 1, 2018

This issue has been automatically detected as stale because it has not had recent activity and will be archived. Thank you for your contributions.

@stale stale bot closed this as completed Dec 1, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
accessibility Integration with screen readers and other assistive technology archived Archived because of inactivity Core The cross-platform C++ core, aka mbgl feature MapKit parity For feature parity with MapKit on iOS or macOS
Projects
None yet
Development

No branches or pull requests