1/*
2 * Copyright © 2018 Google, Inc.
3 *
4 * This is part of HarfBuzz, a text shaping library.
5 *
6 * Permission is hereby granted, without written agreement and without
7 * license or royalty fees, to use, copy, modify, and distribute this
8 * software and its documentation for any purpose, provided that the
9 * above copyright notice and the following two paragraphs appear in
10 * all copies of this software.
11 *
12 * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR
13 * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
14 * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
15 * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
16 * DAMAGE.
17 *
18 * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
19 * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
20 * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
21 * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO
22 * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
23 *
24 * Google Author(s): Behdad Esfahbod
25 */
26
27#ifndef HB_OT_NAME_LANGUAGE_STATIC_HH
28#define HB_OT_NAME_LANGUAGE_STATIC_HH
29
30#include "hb-ot-name-language.hh"
31
32/* Following two tables were generated by joining FreeType, FontConfig,
33 * and OpenType specification language lists, then filled in missing
34 * entries using:
35 * https://docs.microsoft.com/en-us/windows/desktop/intl/language-identifier-constants-and-strings
36 */
37
38struct hb_ot_language_map_t
39{
40 static int cmp (const void *key, const void *item)
41 {
42 unsigned int a = * (unsigned int *) key;
43 unsigned int b = ((const hb_ot_language_map_t *) item)->code;
44 return a < b ? -1 : a > b ? +1 : 0;
45 }
46
47 uint16_t code;
48 char lang[6];
49};
50
51static const hb_ot_language_map_t
52hb_ms_language_map[] =
53{
54 {0x0001, "ar"}, /* ??? */
55 {0x0004, "zh"}, /* ??? */
56 {0x0009, "en"}, /* ??? */
57 {0x0401, "ar"}, /* Arabic (Saudi Arabia) */
58 {0x0402, "bg"}, /* Bulgarian (Bulgaria) */
59 {0x0403, "ca"}, /* Catalan (Catalan) */
60 {0x0404, "zh-tw"}, /* Chinese (Taiwan) */
61 {0x0405, "cs"}, /* Czech (Czech Republic) */
62 {0x0406, "da"}, /* Danish (Denmark) */
63 {0x0407, "de"}, /* German (Germany) */
64 {0x0408, "el"}, /* Greek (Greece) */
65 {0x0409, "en"}, /* English (United States) */
66 {0x040A, "es"}, /* Spanish (Traditional Sort) (Spain) */
67 {0x040B, "fi"}, /* Finnish (Finland) */
68 {0x040C, "fr"}, /* French (France) */
69 {0x040D, "he"}, /* Hebrew (Israel) */
70 {0x040E, "hu"}, /* Hungarian (Hungary) */
71 {0x040F, "is"}, /* Icelandic (Iceland) */
72 {0x0410, "it"}, /* Italian (Italy) */
73 {0x0411, "ja"}, /* Japanese (Japan) */
74 {0x0412, "ko"}, /* Korean (Korea) */
75 {0x0413, "nl"}, /* Dutch (Netherlands) */
76 {0x0414, "no"}, /* Norwegian (Bokmal) (Norway) */
77 {0x0415, "pl"}, /* Polish (Poland) */
78 {0x0416, "pt"}, /* Portuguese (Brazil) */
79 {0x0417, "rm"}, /* Romansh (Switzerland) */
80 {0x0418, "ro"}, /* Romanian (Romania) */
81 {0x0419, "ru"}, /* Russian (Russia) */
82 {0x041A, "hr"}, /* Croatian (Croatia) */
83 {0x041B, "sk"}, /* Slovak (Slovakia) */
84 {0x041C, "sq"}, /* Albanian (Albania) */
85 {0x041D, "sv"}, /* Swedish (Sweden) */
86 {0x041E, "th"}, /* Thai (Thailand) */
87 {0x041F, "tr"}, /* Turkish (Turkey) */
88 {0x0420, "ur"}, /* Urdu (Islamic Republic of Pakistan) */
89 {0x0421, "id"}, /* Indonesian (Indonesia) */
90 {0x0422, "uk"}, /* Ukrainian (Ukraine) */
91 {0x0423, "be"}, /* Belarusian (Belarus) */
92 {0x0424, "sl"}, /* Slovenian (Slovenia) */
93 {0x0425, "et"}, /* Estonian (Estonia) */
94 {0x0426, "lv"}, /* Latvian (Latvia) */
95 {0x0427, "lt"}, /* Lithuanian (Lithuania) */
96 {0x0428, "tg"}, /* Tajik (Cyrillic) (Tajikistan) */
97 {0x0429, "fa"}, /* Persian (Iran) */
98 {0x042A, "vi"}, /* Vietnamese (Vietnam) */
99 {0x042B, "hy"}, /* Armenian (Armenia) */
100 {0x042C, "az"}, /* Azeri (Latin) (Azerbaijan) */
101 {0x042D, "eu"}, /* Basque (Basque) */
102 {0x042E, "hsb"}, /* Upper Sorbian (Germany) */
103 {0x042F, "mk"}, /* Macedonian (FYROM) (Former Yugoslav Republic of Macedonia) */
104 {0x0430, "st"}, /* ??? */
105 {0x0431, "ts"}, /* ??? */
106 {0x0432, "tn"}, /* Setswana (South Africa) */
107 {0x0433, "ven"}, /* ??? */
108 {0x0434, "xh"}, /* isiXhosa (South Africa) */
109 {0x0435, "zu"}, /* isiZulu (South Africa) */
110 {0x0436, "af"}, /* Afrikaans (South Africa) */
111 {0x0437, "ka"}, /* Georgian (Georgia) */
112 {0x0438, "fo"}, /* Faroese (Faroe Islands) */
113 {0x0439, "hi"}, /* Hindi (India) */
114 {0x043A, "mt"}, /* Maltese (Malta) */
115 {0x043B, "se"}, /* Sami (Northern) (Norway) */
116 {0x043C, "ga"}, /* ??? */
117 {0x043D, "yi"}, /* ??? */
118 {0x043E, "ms"}, /* Malay (Malaysia) */
119 {0x043F, "kk"}, /* Kazakh (Kazakhstan) */
120 {0x0440, "ky"}, /* Kyrgyz (Kyrgyzstan) */
121 {0x0441, "sw"}, /* Kiswahili (Kenya) */
122 {0x0442, "tk"}, /* Turkmen (Turkmenistan) */
123 {0x0443, "uz"}, /* Uzbek (Latin) (Uzbekistan) */
124 {0x0444, "tt"}, /* Tatar (Russia) */
125 {0x0445, "bn"}, /* Bengali (India) */
126 {0x0446, "pa"}, /* Punjabi (India) */
127 {0x0447, "gu"}, /* Gujarati (India) */
128 {0x0448, "or"}, /* Odia (formerly Oriya) (India) */
129 {0x0449, "ta"}, /* Tamil (India) */
130 {0x044A, "te"}, /* Telugu (India) */
131 {0x044B, "kn"}, /* Kannada (India) */
132 {0x044C, "ml"}, /* Malayalam (India) */
133 {0x044D, "as"}, /* Assamese (India) */
134 {0x044E, "mr"}, /* Marathi (India) */
135 {0x044F, "sa"}, /* Sanskrit (India) */
136 {0x0450, "mn"}, /* Mongolian (Cyrillic) (Mongolia) */
137 {0x0451, "bo"}, /* Tibetan (PRC) */
138 {0x0452, "cy"}, /* Welsh (United Kingdom) */
139 {0x0453, "km"}, /* Khmer (Cambodia) */
140 {0x0454, "lo"}, /* Lao (Lao P.D.R.) */
141 {0x0455, "my"}, /* ??? */
142 {0x0456, "gl"}, /* Galician (Galician) */
143 {0x0457, "kok"}, /* Konkani (India) */
144 {0x0458, "mni"}, /* ??? */
145 {0x0459, "sd"}, /* ??? */
146 {0x045A, "syr"}, /* Syriac (Syria) */
147 {0x045B, "si"}, /* Sinhala (Sri Lanka) */
148 {0x045C, "chr"}, /* ??? */
149 {0x045D, "iu"}, /* Inuktitut (Canada) */
150 {0x045E, "am"}, /* Amharic (Ethiopia) */
151 {0x0460, "ks"}, /* ??? */
152 {0x0461, "ne"}, /* Nepali (Nepal) */
153 {0x0462, "fy"}, /* Frisian (Netherlands) */
154 {0x0463, "ps"}, /* Pashto (Afghanistan) */
155 {0x0464, "phi"}, /* Filipino (Philippines) */
156 {0x0465, "div"}, /* Divehi (Maldives) */
157 {0x0468, "ha"}, /* Hausa (Latin) (Nigeria) */
158 {0x046A, "yo"}, /* Yoruba (Nigeria) */
159 {0x046B, "quz"}, /* Quechua (Bolivia) */
160 {0x046C, "nso"}, /* Sesotho sa Leboa (South Africa) */
161 {0x046D, "ba"}, /* Bashkir (Russia) */
162 {0x046E, "lb"}, /* Luxembourgish (Luxembourg) */
163 {0x046F, "kl"}, /* Greenlandic (Greenland) */
164 {0x0470, "ibo"}, /* Igbo (Nigeria) */
165 {0x0471, "kau"}, /* ??? */
166 {0x0472, "om"}, /* ??? */
167 {0x0473, "ti"}, /* ??? */
168 {0x0474, "gn"}, /* ??? */
169 {0x0475, "haw"}, /* ??? */
170 {0x0476, "la"}, /* ??? */
171 {0x0477, "so"}, /* ??? */
172 {0x0478, "ii"}, /* Yi (PRC) */
173 {0x0479, "pap"}, /* ??? */
174 {0x047A, "arn"}, /* Mapudungun (Chile) */
175 {0x047C, "moh"}, /* Mohawk (Mohawk) */
176 {0x047E, "br"}, /* Breton (France) */
177 {0x0480, "ug"}, /* Uighur (PRC) */
178 {0x0481, "mi"}, /* Maori (New Zealand) */
179 {0x0482, "oc"}, /* Occitan (France) */
180 {0x0483, "co"}, /* Corsican (France) */
181 {0x0484, "gsw"}, /* Alsatian (France) */
182 {0x0485, "sah"}, /* Yakut (Russia) */
183 {0x0486, "qut"}, /* K'iche (Guatemala) */
184 {0x0487, "rw"}, /* Kinyarwanda (Rwanda) */
185 {0x0488, "wo"}, /* Wolof (Senegal) */
186 {0x048C, "fa"}, /* Dari (Afghanistan) */
187 {0x0801, "ar"}, /* Arabic (Iraq) */
188 {0x0804, "zh-cn"}, /* Chinese (People’s Republic of China) */
189 {0x0807, "de"}, /* German (Switzerland) */
190 {0x0809, "en"}, /* English (United Kingdom) */
191 {0x080A, "es"}, /* Spanish (Mexico) */
192 {0x080C, "fr"}, /* French (Belgium) */
193 {0x0810, "it"}, /* Italian (Switzerland) */
194 {0x0812, "ko"}, /* ??? */
195 {0x0813, "nl"}, /* Dutch (Belgium) */
196 {0x0814, "nn"}, /* Norwegian (Nynorsk) (Norway) */
197 {0x0816, "pt"}, /* Portuguese (Portugal) */
198 {0x0818, "mo"}, /* ??? */
199 {0x0819, "ru"}, /* ??? */
200 {0x081A, "sr"}, /* Serbian (Latin) (Serbia) */
201 {0x081D, "sv"}, /* Sweden (Finland) */
202 {0x0820, "ur"}, /* ??? */
203 {0x0827, "lt"}, /* ??? */
204 {0x082C, "az"}, /* Azeri (Cyrillic) (Azerbaijan) */
205 {0x082E, "dsb"}, /* Lower Sorbian (Germany) */
206//{0x083B, ""}, /* Sami (Northern) (Sweden) */
207 {0x083C, "gd"}, /* Irish (Ireland) */
208 {0x083E, "ms"}, /* Malay (Brunei Darussalam) */
209 {0x0843, "uz"}, /* Uzbek (Cyrillic) (Uzbekistan) */
210 {0x0845, "bn"}, /* Bengali (Bangladesh) */
211 {0x0846, "ar"}, /* ??? */
212 {0x0850, "mn"}, /* Mongolian (Traditional) (People’s Republic of China) */
213 {0x0851, "dz"}, /* ??? */
214 {0x085D, "iu"}, /* Inuktitut (Latin) (Canada) */
215 {0x085F, "tzm"}, /* Tamazight (Latin) (Algeria) */
216 {0x0861, "ne"}, /* ??? */
217//{0x086B, ""}, /* Quechua (Ecuador) */
218 {0x0873, "ti"}, /* ??? */
219 {0x0C01, "ar"}, /* Arabic (Egypt) */
220 {0x0C04, "zh-hk"}, /* Chinese (Hong Kong S.A.R.) */
221 {0x0C07, "de"}, /* German (Austria) */
222 {0x0C09, "en"}, /* English (Australia) */
223 {0x0C0A, "es"}, /* Spanish (Modern Sort) (Spain) */
224 {0x0C0C, "fr"}, /* French (Canada) */
225 {0x0C1A, "sr"}, /* Serbian (Cyrillic) (Serbia) */
226 {0x0C3B, "se"}, /* Sami (Northern) (Finland) */
227//{0x0C6B, ""}, /* Quechua (Peru) */
228 {0x1001, "ar"}, /* Arabic (Libya) */
229 {0x1004, "zh-sg"}, /* Chinese (Singapore) */
230 {0x1007, "de"}, /* German (Luxembourg) */
231 {0x1009, "en"}, /* English (Canada) */
232 {0x100A, "es"}, /* Spanish (Guatemala) */
233 {0x100C, "fr"}, /* French (Switzerland) */
234 {0x101A, "hr"}, /* Croatian (Latin) (Bosnia and Herzegovina) */
235 {0x103B, "smj"}, /* Sami (Lule) (Norway) */
236 {0x1401, "ar"}, /* Arabic (Algeria) */
237//{0x1404, ""}, /* Chinese (Macao S.A.R.) */
238 {0x1407, "de"}, /* German (Liechtenstein) */
239 {0x1409, "en"}, /* English (New Zealand) */
240 {0x140A, "es"}, /* Spanish (Costa Rica) */
241 {0x140C, "fr"}, /* French (Luxembourg) */
242 {0x141A, "bs"}, /* Bosnian (Latin) (Bosnia and Herzegovina) */
243//{0x143B, ""}, /* Sami (Lule) (Sweden) */
244 {0x1801, "ar"}, /* Arabic (Morocco) */
245 {0x1809, "en"}, /* English (Ireland) */
246 {0x180A, "es"}, /* Spanish (Panama) */
247 {0x180C, "fr"}, /* French (Principality of Monaco) */
248//{0x181A, ""}, /* Serbian (Latin) (Bosnia and Herzegovina) */
249 {0x183B, "sma"}, /* Sami (Southern) (Norway) */
250 {0x1C01, "ar"}, /* Arabic (Tunisia) */
251 {0x1C09, "en"}, /* English (South Africa) */
252 {0x1C0A, "es"}, /* Spanish (Dominican Republic) */
253 {0x1C0C, "fr"}, /* ??? */
254//{0x1C1A, ""}, /* Serbian (Cyrillic) (Bosnia and Herzegovina) */
255//{0x1C3B, ""}, /* Sami (Southern) (Sweden) */
256 {0x2001, "ar"}, /* Arabic (Oman) */
257 {0x2009, "en"}, /* English (Jamaica) */
258 {0x200A, "es"}, /* Spanish (Venezuela) */
259 {0x200C, "fr"}, /* ??? */
260 {0x201A, "bs"}, /* Bosnian (Cyrillic) (Bosnia and Herzegovina) */
261 {0x203B, "sms"}, /* Sami (Skolt) (Finland) */
262 {0x2401, "ar"}, /* Arabic (Yemen) */
263 {0x2409, "en"}, /* English (Caribbean) */
264 {0x240A, "es"}, /* Spanish (Colombia) */
265 {0x240C, "fr"}, /* ??? */
266 {0x243B, "smn"}, /* Sami (Inari) (Finland) */
267 {0x2801, "ar"}, /* Arabic (Syria) */
268 {0x2809, "en"}, /* English (Belize) */
269 {0x280A, "es"}, /* Spanish (Peru) */
270 {0x280C, "fr"}, /* ??? */
271 {0x2C01, "ar"}, /* Arabic (Jordan) */
272 {0x2C09, "en"}, /* English (Trinidad and Tobago) */
273 {0x2C0A, "es"}, /* Spanish (Argentina) */
274 {0x2C0C, "fr"}, /* ??? */
275 {0x3001, "ar"}, /* Arabic (Lebanon) */
276 {0x3009, "en"}, /* English (Zimbabwe) */
277 {0x300A, "es"}, /* Spanish (Ecuador) */
278 {0x300C, "fr"}, /* ??? */
279 {0x3401, "ar"}, /* Arabic (Kuwait) */
280 {0x3409, "en"}, /* English (Republic of the Philippines) */
281 {0x340A, "es"}, /* Spanish (Chile) */
282 {0x340C, "fr"}, /* ??? */
283 {0x3801, "ar"}, /* Arabic (U.A.E.) */
284 {0x380A, "es"}, /* Spanish (Uruguay) */
285 {0x380C, "fr"}, /* ??? */
286 {0x3C01, "ar"}, /* Arabic (Bahrain) */
287 {0x3C09, "en"}, /* ??? */
288 {0x3C0A, "es"}, /* Spanish (Paraguay) */
289 {0x3C0C, "fr"}, /* ??? */
290 {0x4001, "ar"}, /* Arabic (Qatar) */
291 {0x4009, "en"}, /* English (India) */
292 {0x400A, "es"}, /* Spanish (Bolivia) */
293 {0x4409, "en"}, /* English (Malaysia) */
294 {0x440A, "es"}, /* Spanish (El Salvador) */
295 {0x4809, "en"}, /* English (Singapore) */
296 {0x480A, "es"}, /* Spanish (Honduras) */
297 {0x4C0A, "es"}, /* Spanish (Nicaragua) */
298 {0x500A, "es"}, /* Spanish (Puerto Rico) */
299 {0x540A, "es"}, /* Spanish (United States) */
300 {0xE40A, "es"}, /* ??? */
301 {0xE40C, "fr"}, /* ??? */
302};
303
304static const hb_ot_language_map_t
305hb_mac_language_map[] =
306{
307 { 0, "en"}, /* English */
308 { 1, "fr"}, /* French */
309 { 2, "de"}, /* German */
310 { 3, "it"}, /* Italian */
311 { 4, "nl"}, /* Dutch */
312 { 5, "sv"}, /* Swedish */
313 { 6, "es"}, /* Spanish */
314 { 7, "da"}, /* Danish */
315 { 8, "pt"}, /* Portuguese */
316 { 9, "no"}, /* Norwegian */
317 { 10, "he"}, /* Hebrew */
318 { 11, "ja"}, /* Japanese */
319 { 12, "ar"}, /* Arabic */
320 { 13, "fi"}, /* Finnish */
321 { 14, "el"}, /* Greek */
322 { 15, "is"}, /* Icelandic */
323 { 16, "mt"}, /* Maltese */
324 { 17, "tr"}, /* Turkish */
325 { 18, "hr"}, /* Croatian */
326 { 19, "zh-tw"}, /* Chinese (Traditional) */
327 { 20, "ur"}, /* Urdu */
328 { 21, "hi"}, /* Hindi */
329 { 22, "th"}, /* Thai */
330 { 23, "ko"}, /* Korean */
331 { 24, "lt"}, /* Lithuanian */
332 { 25, "pl"}, /* Polish */
333 { 26, "hu"}, /* Hungarian */
334 { 27, "et"}, /* Estonian */
335 { 28, "lv"}, /* Latvian */
336//{ 29, ""}, /* Sami */
337 { 30, "fo"}, /* Faroese */
338 { 31, "fa"}, /* Farsi/Persian */
339 { 32, "ru"}, /* Russian */
340 { 33, "zh-cn"}, /* Chinese (Simplified) */
341 { 34, "nl"}, /* Flemish */
342 { 35, "ga"}, /* Irish Gaelic */
343 { 36, "sq"}, /* Albanian */
344 { 37, "ro"}, /* Romanian */
345 { 38, "cs"}, /* Czech */
346 { 39, "sk"}, /* Slovak */
347 { 40, "sl"}, /* Slovenian */
348 { 41, "yi"}, /* Yiddish */
349 { 42, "sr"}, /* Serbian */
350 { 43, "mk"}, /* Macedonian */
351 { 44, "bg"}, /* Bulgarian */
352 { 45, "uk"}, /* Ukrainian */
353 { 46, "be"}, /* Byelorussian */
354 { 47, "uz"}, /* Uzbek */
355 { 48, "kk"}, /* Kazakh */
356 { 49, "az"}, /* Azerbaijani (Cyrillic script) */
357 { 50, "az"}, /* Azerbaijani (Arabic script) */
358 { 51, "hy"}, /* Armenian */
359 { 52, "ka"}, /* Georgian */
360 { 53, "mo"}, /* Moldavian */
361 { 54, "ky"}, /* Kirghiz */
362 { 55, "tg"}, /* Tajiki */
363 { 56, "tk"}, /* Turkmen */
364 { 57, "mn"}, /* Mongolian (Mongolian script) */
365 { 58, "mn"}, /* Mongolian (Cyrillic script) */
366 { 59, "ps"}, /* Pashto */
367 { 60, "ku"}, /* Kurdish */
368 { 61, "ks"}, /* Kashmiri */
369 { 62, "sd"}, /* Sindhi */
370 { 63, "bo"}, /* Tibetan */
371 { 64, "ne"}, /* Nepali */
372 { 65, "sa"}, /* Sanskrit */
373 { 66, "mr"}, /* Marathi */
374 { 67, "bn"}, /* Bengali */
375 { 68, "as"}, /* Assamese */
376 { 69, "gu"}, /* Gujarati */
377 { 70, "pa"}, /* Punjabi */
378 { 71, "or"}, /* Oriya */
379 { 72, "ml"}, /* Malayalam */
380 { 73, "kn"}, /* Kannada */
381 { 74, "ta"}, /* Tamil */
382 { 75, "te"}, /* Telugu */
383 { 76, "si"}, /* Sinhalese */
384 { 77, "my"}, /* Burmese */
385 { 78, "km"}, /* Khmer */
386 { 79, "lo"}, /* Lao */
387 { 80, "vi"}, /* Vietnamese */
388 { 81, "id"}, /* Indonesian */
389 { 82, "tl"}, /* Tagalog */
390 { 83, "ms"}, /* Malay (Roman script) */
391 { 84, "ms"}, /* Malay (Arabic script) */
392 { 85, "am"}, /* Amharic */
393 { 86, "ti"}, /* Tigrinya */
394 { 87, "om"}, /* Galla */
395 { 88, "so"}, /* Somali */
396 { 89, "sw"}, /* Swahili */
397 { 90, "rw"}, /* Kinyarwanda/Ruanda */
398 { 91, "rn"}, /* Rundi */
399 { 92, "ny"}, /* Nyanja/Chewa */
400 { 93, "mg"}, /* Malagasy */
401 { 94, "eo"}, /* Esperanto */
402 {128, "cy"}, /* Welsh */
403 {129, "eu"}, /* Basque */
404 {130, "ca"}, /* Catalan */
405 {131, "la"}, /* Latin */
406 {132, "qu"}, /* Quechua */
407 {133, "gn"}, /* Guarani */
408 {134, "ay"}, /* Aymara */
409 {135, "tt"}, /* Tatar */
410 {136, "ug"}, /* Uighur */
411 {137, "dz"}, /* Dzongkha */
412 {138, "jw"}, /* Javanese (Roman script) */
413 {139, "su"}, /* Sundanese (Roman script) */
414 {140, "gl"}, /* Galician */
415 {141, "af"}, /* Afrikaans */
416 {142, "br"}, /* Breton */
417 {143, "iu"}, /* Inuktitut */
418 {144, "gd"}, /* Scottish Gaelic */
419 {145, "gv"}, /* Manx Gaelic */
420 {146, "ga"}, /* Irish Gaelic (with dot above) */
421 {147, "to"}, /* Tongan */
422 {148, "el"}, /* Greek (polytonic) */
423 {149, "ik"}, /* Greenlandic */
424 {150, "az"}, /* Azerbaijani (Roman script) */
425};
426
427
428static hb_language_t
429_hb_ot_name_language_for (unsigned int code,
430 const hb_ot_language_map_t *array,
431 unsigned int len)
432{
433#ifdef HB_NO_OT_NAME_LANGUAGE
434 return HB_LANGUAGE_INVALID;
435#endif
436 const hb_ot_language_map_t *entry = (const hb_ot_language_map_t *)
437 hb_bsearch (&code,
438 array,
439 len,
440 sizeof (array[0]),
441 hb_ot_language_map_t::cmp);
442
443 if (entry)
444 return hb_language_from_string (entry->lang, -1);
445
446 return HB_LANGUAGE_INVALID;
447}
448
449hb_language_t
450_hb_ot_name_language_for_ms_code (unsigned int code)
451{
452 return _hb_ot_name_language_for (code,
453 hb_ms_language_map,
454 ARRAY_LENGTH (hb_ms_language_map));
455}
456
457hb_language_t
458_hb_ot_name_language_for_mac_code (unsigned int code)
459{
460 return _hb_ot_name_language_for (code,
461 hb_mac_language_map,
462 ARRAY_LENGTH (hb_mac_language_map));
463}
464
465#endif /* HB_OT_NAME_LANGUAGE_STATIC_HH */
466