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

Support text transforms #149

Closed
kkaefer opened this issue Oct 24, 2013 · 13 comments
Closed

Support text transforms #149

kkaefer opened this issue Oct 24, 2013 · 13 comments
Assignees

Comments

@kkaefer
Copy link
Member

kkaefer commented Oct 24, 2013

We should allow text transforms (uppercase/lowercase/small caps?) when creating the vector tiles.

@nickidlugash
Copy link

This would great, especially while only one font stack is supported.

@mikemorris mikemorris self-assigned this Apr 22, 2014
@nickidlugash
Copy link

This could be useful for the Outdoors style. Since it is unlikely that multiple font stacks will be supported in time for WWDC, this would allow for more differentiation between similar sized/colored labels.

Tracking for Outdoors: https://github.com/mapbox/gl-ported-maps/issues/2

@mikemorris
Copy link
Contributor

Multiple fontstacks are now supported.

@nickidlugash
Copy link

Is this something that could be possible to implement soon?

@kkaefer
Copy link
Member Author

kkaefer commented Jun 11, 2014

Hrm, text transformation is another can of worms, e.g. in German, you translate the lowercase "ß" to "SS". For small caps, we need a font that supports small caps and replace the code points with different glyphs (i.e. no 1:1 mapping between unicode points and glyphs).

The Unicode consortium helpfully has a list of case conversions: http://www.unicode.org/charts/case/

@yhahn
Copy link
Member

yhahn commented Jun 11, 2014

@kkaefer can we start with something dumb, ie. the what js is doing when you

> ('Hello World').toUpperCase();
'HELLO WORLD'
> ('Hello World').toLowerCase();
'hello world'

? Will it be weird/hard to achieve parity to this on native?

@kkaefer
Copy link
Member Author

kkaefer commented Jun 11, 2014

ICU's C++ libraries have code for handling that. We're currently using boost-unicode on systems that don't have unicode support in stdlib. I know @springmeyer wants to switch to https://github.com/dropbox/miniutf, but this library doesn't seem to have support for uppercasing/lowercasing/titlecasing. We could contribute the code though. Using ICU is not something I'd like to do, since it is quite a large dependency.

@yhahn
Copy link
Member

yhahn commented Jun 11, 2014

word

@springmeyer
Copy link
Contributor

yes, unicode regex and upper/lower/title casing is about all Mapnik really needs/uses ICU for.

@kkaefer
Copy link
Member Author

kkaefer commented Jun 11, 2014

It looks like miniutf has lowercase support but no titlecase or uppercase support.

@mikemorris
Copy link
Contributor

With http://www.unicode.org/charts/case/ it doesn't look like it would be too hard to add uppercase/titlecase support to miniutf, either in a fork or PR.

@mikemorris
Copy link
Contributor

miniutf implements http://www.unicode.org/Public/6.3.0/ucd/UnicodeData.txt directly at https://raw.githubusercontent.com/dropbox/miniutf/master/data-6.3.0/UnicodeData.txt, which does already contain support for titlecase and uppercase mapping, we would just need to add a method to use that data. We may want to add http://www.unicode.org/Public/6.3.0/ucd/SpecialCasing.txt too if necessary.

0061;LATIN SMALL LETTER A;Ll;0;L;;;;;N;;;0041;;0041

@kkaefer
Copy link
Member Author

kkaefer commented Jun 18, 2014

@mikemorris Yeah, the data is in the text file, but it's currently not in the cpp files that get compiled. The preprocess script does that, but it's currently commented out: https://github.com/dropbox/miniutf/blob/73b871ff1e6f5e716f9da90f64bd9c19fea18dcc/preprocess.py#L340

Also see dropbox/miniutf#2

ansis added a commit that referenced this issue Jun 20, 2014
Add support for text-transform (fixes #149)
bensleveritt pushed a commit to bensleveritt/mapbox-gl-js that referenced this issue Oct 24, 2016
Common Interface for sub controls and one store - fixes mapbox#148, fixes mapbox#149, fixes mapbox#137, fixes mapbox#133, fixes mapbox#104, fixes mapbox#94, fixes mapbox#89, fixes mapbox#144
lucaswoj pushed a commit that referenced this issue Jan 11, 2017
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

6 participants