Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable letter-spacing for Arabic text #4208

Closed
ChrisLoer opened this issue Feb 3, 2017 · 3 comments
Closed

Disable letter-spacing for Arabic text #4208

ChrisLoer opened this issue Feb 3, 2017 · 3 comments
Assignees

Comments

@ChrisLoer
Copy link
Contributor

Styles that increase letter-spacing don't play nice with languages where the glyphs are meant to be in contact with each other (Arabic now, Hindi and others in the future). For now this is a problem that can always be addressed with a style modification, but it's something we shouldn't make style editors think about.

Not sure if we would need to surface this change in Studio in any explicit way. Once we fix https://github.com/mapbox/studio/issues/8396, the preview should show designers what's happening. It still might be a surprise if increased letter spacing didn't do anything to Arabic text -- not that the designer would expect it to be spaced, but just that they wouldn't think about the difference ahead of time.

@tmcw @1ec5

@ChrisLoer ChrisLoer self-assigned this Feb 3, 2017
@1ec5
Copy link
Contributor

1ec5 commented Feb 5, 2017

@ajashton previously presented and blogged about an approach in CartoCSS that uses word spacing instead of letter spacing in scripts such as Arabic and Bengali. While not as sophisticated as the swashes found in traditional Arabic cartography, this approach is more generalizable and avoids font considerations.

See also:

@nickidlugash
Copy link

Also interesting: W3C documents on letter spacing and typographic character units.

As a first pass, might it be ok to simply disable letter-spacing for Arabic (and other affected scripts)? I think that not having broken text on maps using our platform is an acceptable first goal, and that supporting any alternative formatting (word spacing, swashes, etc) could be done in a separate update.

It still might be a surprise if increased letter spacing didn't do anything to Arabic text

Perhaps – personally, though, I don't think this is a big deal, at least compared to the alternative of inadvertently displaying broken Arabic text. We could perhaps just add a disclaimer to the documentation on this style spec property.

For now this is a problem that can always be addressed with a style modification

While this is true, and internally we've avoided using text-letter-spacing for styling text referencing Arabic or "local" language (e.g. the name field in Mapbox Streets vector tiles), even in our core styles there are occasional instances of broken Arabic because some of our "English" labels still fall back to local language. It would be nice if we could continue using letter spacing in English/latin script maps without breaking the small percentage of Arabic labels, since this type of text formatting provides really helpful context in basemaps.

@ChrisLoer
Copy link
Contributor Author

Fixed with #4727

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

No branches or pull requests

4 participants