Universal Language Selector/AutonymFont

=Autonym Font=

Upstream: https://github.com/santhoshtr/AutonymFont

When an article on Wikipedia is available in multiple languages, we see the list of the languages in a column on one side of the page. The names on the list are written in the script that the language uses(Also know as language autonym). Which also means that all the appropriate fonts were needed to be present for the autonyms to be displayed. For instance, an article like the one about the Nobel Prize is written in more than 125 languages and needs around 35 fonts to display the names of the the languages.

Initially this was handled by the native fonts available on the reader's device. If a font did not present, the user would see square boxes (known as tofu) instead of the name of a language. To workaround this problem, not just for the language list, but for other section in the content area as well, the Universal Language Selector (ULS)[LINK] provides a set of webfonts that were loaded with the page. While this ensured that more language texts were displayed, a serious problem was also encountered. The presence of the additional fonts added an overload on the page, and users saw pages loading much slower than before. To improve client-side performance, webfonts are not applied to the interlanguage links area..

Not using the webfonts for the lnterlanguage links seemed like the easiest solution, but it also takes us back to the sup-optimal multilingual experience that we were trying to solve in the first place. Articles may be perfectly displayed thanks to web fonts, but If a link is not displayed in the language list, many users will not be able to discover that there is a version of the article in their language. The autonyms were not just required for the Interlanguage links. They were also required for the Language Search and Selection window of the Universal Language Selector, which allows users to find their language if they are on a wiki displaying content in a script unfamiliar to them.

Autonym font tries to solve this. The font contains glyphs and opentype rules for rendering the language autonyms. And it contains only those glyphs for a language. For example, for Thai, the font has glyphs required for rendering ไทย alone.

Using the font
In MediaWiki, add a class 'autonym' to the elements containing language autonyms. The font will be applied automatically from ULS extension.

Example
Following language names are shown using the Autonym font. A span wraps the content and it has class 'autonym'

The output is given below:

Qafár af Аҧсшәа Acèh Адыгэбзэ Adygabze زَوُن Afrikaans अहिराणी Akan Albaamo innaaɬiilka Gegë አማርኛ aragonés Ænglisc अङ्गिका العربية ܐܪܡܝܐ mapudungun Araona Dziri Maġribi مصرى অসমীয়া American sign language asturianu авар Kotava Aymar aru azərbaycanca آذربايجانجا азәрбајҹанҹа آذربايجانجا башҡортса Boarisch žemaitėška 3 Batak Toba بلوچی مکرانی Bikol Central беларуская (тарашкевіца) беларуская Bahasa Betawi படகா български भोजपुरी Bislama Bahasa Banjar bamanankan বাংলা བོད་ཡིག বিষ্ণুপ্রিয়া মণিপুরী بختياري brezhoneg Bráhuí बड़ो bosanski Iriga Bicolano ᨅᨔ ᨕᨘᨁᨗ буряад català Chavacano de Zamboanga Mìng-dĕ̤ng-ngṳ̄ нохчийн Cebuano Chamoru Choctaw ᏣᎳᎩ Tsetsêhestâhese کوردی corsu Capiceño ᓀᐦᐃᔭᐍᐏᐣ Nēhiyawēwin qırımtatarca къырымтатарджа qırımtatarca česky kaszëbsczi словѣ́ньскъ / ⰔⰎⰑⰂⰡⰐⰠⰔⰍⰟ Чӑвашла Cymraeg dansk Österreichisches Deutsch Schweizer Hochdeutsch Deutsch (Sie-Form) Deutsch Zazaki dolnoserbski Dusun Bundu-liwan ދިވެހިބަސް ཇོང་ཁ eʋegbe Emiliàn Ελληνικά emiliàn e rumagnòl Canadian English British English English Esperanto español de America Latina español (formal) español Yup'ik eesti euskara estremeñu فارسی Fulfulde suomi Tagalog meänkieli Võro Na Vosa Vakaviti føroyskt français français cadien arpetan Nordfriisk furlan Frysk Gaeilge Gagauz Alekano 赣语（简体 贛語 Dari Guadeloupean Creole French Gàidhlig galego گیلکی Avañe'ẽ कोंकणी Konknni 𐌲𐌿𐍄𐌹𐍃𐌺 Ἀρχαία ἑλληνικὴ Alemannisch ગુજરાતી Wayúu Gurenɛ Gaelg هَوُسَ Hausa Hak-kâ-fa Hawai`i עברית हिन्दी Fiji Hindi फ़ीजी हिन्दी Fiji Hindi Ilonggo छत्तीसगढ़ी Hiri Motu hrvatski hornjoserbsce 湘语 Kreyòl ayisyen Magyar (magázó) magyar Հայերեն Otsiherero interlingua Bahasa Indonesia Interlingue Igbo ꆇꉙ Iñupiak ᐃᓄᒃᑎᑐᑦ inuktitut Ilokano ГӀалгӀай Ido íslenska italiano ᐃᓄᒃᑎᑐᑦ 日本語 Patois Lojban jysk Basa Jawa ꦧꦱꦗꦮ ქართული Qaraqalpaqsha Taqbaylit Адыгэбзэ Qabardjajəbza Адыгэбзэ Kabuverdianu Kongo Kaingáng کھوار Gĩkũyũ Kırmancki Kwanyama қазақша قازاقشا (تٴوتە) қазақша qazaqşa kalaallisut ភាសាខ្មែរ ಕನ್ನಡ 한국어 (조선) 한국어 Перем Коми Kanuri къарачай-малкъар Krio Kinaray-a Karjala کٲشُر कॉशुर کٲشُر Bafia Ripoarisch Kurdî كوردي Kurdî коми kernowek Кыргызча Latina Ladino לאדינו Lëtzebuergesch лакку лезги Lingua Franca Nova Luganda Limburgs Ligure Līvõ kēļ Ladin lumbaart lingála ລາວ Silozi lietuvių latgaļu Mizo ţawng latviešu 文言 Lazuri मैथिली Basa Banyumasan мокшень Morisyen Malagasy Ebon олык марий Māori Mi'kmaq Baso Minangkabau македонски മലയാളം монгол ᠮᠠᠨᠵᡠ ᡤᡳᠰᡠᠨ মেইতেই লোন্ ဘာသာ မန် молдовеняскэ मराठी кырык мары Bahasa Melayu Malti Musi Mvskoke Mirandés Behase Mentawei မြန်မာဘာသာ эрзянь مازِرونی Dorerin Naoero Nāhuatl Bân-lâm-gú Nnapulitano norsk (bokmål) Nedersaksisch Plattdüütsch नेपाली नेपाल भाषा Oshiwambo ko e vagahau Niuē Ao Nederlands (informeel) Nederlands norsk (nynorsk) norsk Novial ߒߞߏ Nouormand Sesotho sa Leboa Diné bizaad Chi-Chewa occitan Oromoo ଓଡ଼ିଆ Ирон ਪੰਜਾਬੀ Pangasinan Kapampangan Papiamentu Picard Deitsch Plautdietsch Pälzisch पालि Norfuk / Pitkern Pijin Pökoot polski Piemontèis پنجابی Ποντιακά Nawat Prūsiskan پښتو português do Brasil português Runa Simi Runa shimi arero rapa nui Rumagnôl Tarifit ရခိုင် rumantsch Romani Kirundi română Armãneashce tarandíne Faeag Rotuma русский русиньскый Armãneashce Влахесте Megleno-Romanian (Greek script) Vlăheşte Kinyarwanda ʔucināguci संस्कृतम् саха тыла Santali ꢱꣃꢬꢵꢯ꣄ꢡ꣄ꢬꢵ sardu sicilianu Scots سنڌي Sassaresu sámegiella Cmique Itom Sängö žemaitėška srpskohrvatski Tašlḥiyt ⵜⴰⵛⵍⵃⵉⵜ Tašlḥiyt လိၵ်ႈတႆး සිංහල Simple English slovenčina slovenščina Schläsch Salırça Bahasa Selayar ܣܘܪܝܝܐ Gagana Samoa åarjelsaemien julevsámegiella anarâškielâ sää´mǩiõll chiShona Soomaaliga shqip 3 српски srpski Sranantongo SiSwati Sesotho Seeltersk Basa Sunda svenska Kiswahili Shikomoro Säggssch ślůnski தமிழ் ತುಳು తెలుగు tetun тоҷикӣ tojikī тоҷикӣ ไทย ትግርኛ Türkmençe ЦӀаьхна миз Tagalog толышә зывон Setswana lea faka-Tonga Toki Pona Tok Pisin Türkçe Kokborok (Tripuri) Ṫuroyo Xitsonga Τσακωνικά татарча tatarça Tati chiTumbuka Twi Tweants Reo Mā`ohi тыва дыл ⵜⴰⵎⴰⵣⵉⵖⵜ удмурт ئۇيغۇرچە uyghurche уйғурчә українська اردو oʻzbekcha Tshivenda vèneto vepsän kel’ Tiếng Việt West-Vlams Mainfränkisch Volapük Vaďďa Võro walon Winaray Faka'uvea Wolof 吴语 хальмг isiXhosa მარგალური Eastern Yiddish ייִדיש Yorùbá Ненэцяʼ вада ñe'engatú Maaya T'aan 粵語 Vahcuengh Zeêuws 中文 文言 中文（中国大陆） 中文（简体） 中文（繁體） 中文（香港） Bân-lâm-gú 中文（澳門） 中文（马来西亚） 中文（新加坡） 中文（台灣） 粵語 isiZulu Alemannisch

Other examples:


 * Language cloud at Translatewiki.net
 * Autonym font applied to a language dropdown and list