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

Locale-aware Typography #2608

Closed
Artoria2e5 opened this issue Apr 11, 2017 · 3 comments
Closed

Locale-aware Typography #2608

Artoria2e5 opened this issue Apr 11, 2017 · 3 comments

Comments

@Artoria2e5
Copy link

Artoria2e5 commented Apr 11, 2017

Quite a few Unified CJK Ideographs ("Chinese Characters") are written in different ways in different countries/languages. Such difference is why Adobe and Google has released a bunch of local variants for their Source Han Sans/Noto Sans CJK fonts. In Mapnik for example, at https://www.openstreetmap.org/way/25097203, the "门" (door, gate) character (the last char on its own line) happens to be presented in the Japanese form with a vertical stroke over its rectangular body:

image

Since these locations are found in China, a Chinese form is expected for these characters. Such form is shown below, from a screenshot of, well, this issue:
image

(There are quite a few other "门"s to the north.)

I understand that OSM's current rendering, generally only taking the name part without a language label attached, cannot reliably infer the language used for the string and therefore the locl value to use for font rendering (as well as just the language value to feed into stuff like fontconfig). But with a crude heuristic based on national/regional borders, OSM should be able to get most of the cases right.

A Latin-script (Romanian) example of such a locl feature is available at https://en.wikipedia.org/wiki/Pango#Support_for_OpenType_features. Also try pasting "关门吃草逛街" into the four previews at https://typekit.com/lists/source-han-sans.

(moved from mapnik/mapnik#3655)

@nebulon42 nebulon42 added the text label Apr 11, 2017
@nebulon42 nebulon42 added this to the Bugs and improvements milestone Apr 11, 2017
@nebulon42
Copy link
Contributor

Thanks for the comprehensive description of the issue. Just a few remarks. That this style is referred to as "Mapnik" is a left-over from previous days where there was a "Mapnik" and "Osmarender" rendering. Today it is often less confusing to refer to this style as openstreetmap-carto or osm-carto.

We tend to avoid country-specific renderings as it is complex and leads to all sorts of problems and wishes. Would there be another way to determine from the OSM data what font to use apart from evaluating boundaries? Would Mapnik (the software) understand this locl or language setting? How odd does this Japanese char look to a Chinese reader? Mildly odd, very odd, outrageous?

@Artoria2e5
Copy link
Author

Artoria2e5 commented Apr 11, 2017

Would there be another way to determine from the OSM data what font to use apart from evaluating boundaries?

Perhaps this can be done by equivalence checks between name and language-specified name:<lang> keys. Many nodes only have a un-languaged name still...

Would Mapnik (the software) understand this locl or language setting?

Not sure, to be honest. It seems to use some harfbuzz which does do the OpenType part right.

How odd does this Japanese char look to a Chinese reader? Mildly odd, very odd, outrageous?

Pretty odd I would say. I do recall seeing a lot of people being unhappy with what they got after installing the Japanese version of Source Han Sans... 门's difference is probably one of the most obvious in all differences seen between jp/cn variants of a Chinese character. Unfortunately both cultures have a lot of gates to deal with.

@pnorman
Copy link
Collaborator

pnorman commented Apr 11, 2017

Duplicate of #2208

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

3 participants