Closed claysmalley closed 7 years ago
Cc @russdeffner in case he has any insight.
Did this label used to render correctly on older versions of the style?
I suspect we can't do anything about this issue within the scope of this project.
Looks like it was just much worse some time ago:
http://bl.ocks.org/math1985/raw/7d2b0538a8b64b9d31e2/#12.00/43.6657/111.9717
fwiw, chromium on my ubuntu laptop renders it as a bunch of boxes.
The traditional writing is effectively vertical (top to bottom, then rows left to right), but there's a modern usage allowing the script to be written horizontaly (left to right, then rows top to bottom) with traditional glyphs rotated 90 degrees anticlockwise (this occurs typically in multilingual documents, and notably in China where the script coexists with Hanzi, and in Mongolia where it coexists with the Cyrillic script, most often used for the modern Mongolian language).
Fonts for the script generally contain glyphs turned for the left-to-right direction. The vertical rendering has to be enabled explicitly. Note also that there's also another modern horizontal variant (with a "square" style) whose glyphs are not turned, i.e. in the same orientation as the traditional top-to-bottom direction.
I don't think the rendering is bad, given OSM displays today's modern usage, on a map which is already multilingual and mixing scripts.
Mongolian OpenType fonts may be tuned to turn select alternate turned glyphs with specific features, provided the feature is supported by the renderer (e.g. in a web browser using advanced CSS properties, or in a wordprocessor, or in an advanced graphic editor). Two advanced CSS properties control the vertical top-to-bottom direction and the rotation of glyphs (fonts may also contain features to select alternate glyphs for the vertical direction, or set different metrics, or to disable the rotation.
It is interesting to look at the specific technical annexe to the Unicode standard related to scripts with vertical renderings (this also includes Hanzi/Kanji, Katakana, Hiragana, Bopomofo, and even Latin and Cyrillic, which require adapting the metrics, variable advance heights, horizontal offsets for centering non rotated letters on a vertical line, alternate sets of kerning pairs, alternate sets of ligatures...). But this is still a recent specification and most renderers still do not support all what is needed, except advanced word processors, and advanced graphic editors. Support in CSS is still far behind in terms of standardization, and very experimental, so it is most often not supported in web browsers.
There are other styles for the script with successive adaptations made to coexist with Hanzi (in China) or with Cyrillic (most common script used today for the Mongolian language in Mongolia), and different conventions about the alphabet (with letters added or dropped, or marked with additional diacritics to solve ambiguities).
Additionally many early fonts for the scripts are ful of bugs. The first usable fonts (requiring the newest versions of renderers for supporting the advanced features) start appearing only at end of 2012, even if the script itself was encoded in Unicode 3.0 (published in 1999).
Now that Mongolia has been liberalized and converted to the market economy (following both China and Russia), and that technologies allow supporting more precise typography, there's a strong desire to restore the traditional script and its beauty. But technical resources to develop this support and tune/test fonts for the script are still rare, when Cyrillic is predominating in Mongolia, and Hanzi predominating in China (which itself prefers educating people to the Latin or Cyrillic script as an alternate script rather than older scripts with lower demand on the worldwide and domestic markets). This largely explains the very late development.
Vertical writing is much more developed for Chinese and Japanese as there's a strong domestic demand texts in classical books and for arts, but still, even for Chinese and Japanese the most common usage today is horizontal and both Chinese and Japanese are rendered horizontally in international/multilingual contexts.
As far as I understand @verdy-p, this is rather complicated cultural matter which may not be even called a bug. As the technical side of rendering it is probably not developed enough, I guess we should close it as WONTFIX for now.
Note that vertical writing also applies to Han sinograms, Japanese Kanas, Chinese Bopomofo, Korean Hangul/Jamos, and the derived CJK square clusters of Latin/Gree/Cyrillic letters.
Vertical writing mode in these 3 common langues is much more complex than what you expect: it is not just changing the baseline from horizontal to vertical, it changes the relative positioning of glyphs, some characters are rotated, while others are not rotated, and even if a rotation occurs, they are also offset (the Unicode standard includes an annex about these complex effects)
All what was said about CJK will then also apply equally to the Mongolian script (and also the Yi syllabary script) with the same complications.
Note also that we also have similar complications for the vertical writing mode of Latin (which also exists!)
But for modern use, the Mongolian script is correctly rendered horizontally, along with other Han, Latin, Cyrillic, or Yi characters. Supporting the vertical writing mode is basically only for artistic works, and paleography (just like they are today in Chinese, Korean, Japanese for Han characters, and as well as in Latin where it is used in exceptionnal circumstances)
But unlike Han, Hangul and Latin (where the vertical writing mode generally does not rotate the glyphs, but may still reposition them to center them on the new baseline), the Mongolian script is much simpler: all glyphs are rotated (withe the exception of punctuation that still require some adjustment).
For our map I don't think we will ever need this vertical writing mode, but if we do, it will be for Asian maps and we'll need to also consistantly use the complex vertical writing mode for Latin and Cyrillic (this mode is implemented in several drawing tools, or layout engines to be used for book publication or in word processsors, or tools creating presentations diaporamas, or for special titling and advertizing.
If someone wants to implement it on a map, it will require huge work, but I don't think it will be meaningful to mix both horizontal and vertical writing modes on the same map depending on the script used (notably when scripts will be frequently mixed in Asia) !
But it is much more important to support the Bidi algorithm (that applies to both the horizontal and vertical writing modes, but with additional complication for the application of "mirroring" and its effect on glyphs that are repositioned by the vertical writing mode). An alternative for the vertical writing mode is to not apply any Bidi reordering and force the direction to only top-to-bottom: Latin glyphs are not rotated but slightly recentered on the new baseline, but Arabic will be simply rotated 90 degrees clockwise, in order to preserve their joining, and Devanagari would be rotated 90 degrees but anticlockwise: Arabic and Devanagary would not use exactly the same baseline --- both the Arabic top-to-bottom baseline and Devanagari top-to-bottom baseline would be to the right of the vertical centerline for Latin, while in horizontal mode, Arabic and Latin share the same baseline and Devanagari baseline is above.
Summary: vertical writing mode should be treated only as a specific style (applicable to all scripts in fact), but it is complex to implement correctly, and if it is used on the map, it should be applied for all scripts simultaneously, and coherently (and depending on the vertical direction you choose, top-to-bottom or bottom-to-top, the rotations and repositionings will be different, Bidi will apply or not, and some glyphs may be substituded by others or not, and the effect on other styles (notably italic and shadows) will have to be adapted, it is not just a simple global rotation of the horizontal writing mode.
Eh, unlike CJK languages where the text being written vertically are optional nowadays, for Mongolian (as well as Manchu) this is mandatory. There are indeed some Mongolian text being rendered horizontally across the internet, but they usually only happens when the platform do not have sufficient support and thus compromises need to be made, and I don't think they can be considered acceptable for Mongolian rendering. It is also the default when no dedicated support on the text are given consideration of, like the situation in OSM nowadays.
On places like English and Chinese Wikipedia where support can be provided for Mongolian text, they are always written vertically. And the lack of vertical writing support on other computer applications is also a reason why there are a number of software company dedicated in developing an entire set of Mongolian software, including everything from office suite to instant message app, because they can support the inputting and displaying of Mongolian text in the way they are supposed to unlike many other popular applications around the world.
As such, it can be said that without proper support for Mongolian to be written vertically, Mongolian users will not be able to use the product appropriately.
As the Republic of Mongolia is now adopting the Mongolian script back https://min.news/en/news/cf1a73f0dd10a4717addd8655cd1e4c5.html , and some objects in the country in OSM including the country itself is now tagged with Mongolian script in their name, aka https://www.openstreetmap.org/relation/161033 which is an admin_level=2 feature that's rendering very prominently, and more and more places are probably going to be tagged with Mongolian text name, it become really obvious and unnatural to look at these text. Hope OSM Carto can fix the rendering problem and display the text correctly, else OSM Carto being the most common map style representing OSM as a whole be hard to be adopted by Mongolian user, and that wouldn't be goof for OSM adaption worldwide.
As for script mixing, as have been mentioned before, you can look at how text in Mongolian script are rendered vertically in-line on Wikipedia of other languages.
I suspect we can't do anything about this issue within the scope of this project.
This would be a Mapnik limitation, right?
Example: http://www.openstreetmap.org/#map=9/43.6013/111.9974
The Mongolian script is written vertically. Mapnik is rendering it sideways.