-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Comments
This would great, especially while only one font stack is supported. |
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 |
Multiple fontstacks are now supported. |
Is this something that could be possible to implement soon? |
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/ |
@kkaefer can we start with something dumb, ie. the what js is doing when you
? Will it be weird/hard to achieve parity to this on native? |
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. |
word |
yes, unicode regex and upper/lower/title casing is about all Mapnik really needs/uses ICU for. |
It looks like miniutf has lowercase support but no titlecase or uppercase support. |
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. |
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.
|
@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 |
Add support for text-transform (fixes #149)
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
We should allow text transforms (uppercase/lowercase/small caps?) when creating the vector tiles.
The text was updated successfully, but these errors were encountered: