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

Support for font size scaling #2429

Closed
Closed

Description

@brunoabinader

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

Activity

  1. kkaefer commented on Sep 28, 2015

    @kkaefer
    Member

    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.

  2. friedbunny commented on Sep 28, 2015

    @friedbunny
    Contributor

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

  3. mikemorris commented on Sep 28, 2015

    @mikemorris
    Contributor

    👍

  4. ansis commented on Sep 28, 2015

    @ansis
    Contributor

    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?

  5. andreasviglakis commented on Sep 28, 2015

    @andreasviglakis

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

  6. tobrun commented on Sep 28, 2015

    @tobrun
    Member

    I imagine Android has a similar setting.

    Yes, we can use font scale attribute for that

  7. ansis commented on Sep 28, 2015

    @ansis
    Contributor

    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

  8. nickidlugash commented on Sep 28, 2015

    @nickidlugash
    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.

  9. incanus commented on Sep 28, 2015

    @incanus
    Contributor

    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?

  10. brunoabinader commented on Sep 28, 2015

    @brunoabinader
    ContributorAuthor

    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.

  11. added
    MapKit parity
    on Aug 22, 2016
  12. 1ec5 commented on Nov 11, 2016

    @1ec5
    Contributor

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

  13. added
    accessibility
    on Dec 7, 2016
  14. added
    Core
    on May 30, 2017
  15. felixLam commented on Aug 18, 2017

    @felixLam

    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

  16. added
    archived
    on Nov 5, 2018
  17. stale commented on Dec 1, 2018

    @stale

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

CoreMapKit parityaccessibilityarchivedfeature

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions