1 // Copyright 2012 Google Inc. All Rights Reserved. 2 3 package com.google.typography.font.sfntly.table.opentype; 4 5 import com.google.typography.font.sfntly.Tag; 6 7 /** 8 * @author dougfelt@google.com (Doug Felt) 9 */ 10 public enum ScriptTag { 11 arab("Arabic"), 12 armn("Armenian"), 13 avst("Avestan"), 14 bali("Balinese"), 15 bamu("Bamum"), 16 batk("Batak"), 17 beng("Bengali"), 18 bng2("Bengali v.2"), 19 bopo("Bopomofo"), 20 brai("Braille"), 21 brah("Brahmi"), 22 bugi("Buginese"), 23 buhd("Buhid"), 24 byzm("Byzantine Music"), 25 cans("Canadian Syllabics"), 26 cari("Carian"), 27 cakm("Chakma"), 28 cham("Cham"), 29 cher("Cherokee"), 30 hani("CJK Ideographic"), 31 copt("Coptic"), 32 cprt("Cypriot Syllabary"), 33 cyrl("Cyrillic"), 34 DFLT("Default"), 35 dsrt("Deseret"), 36 deva("Devanagari"), 37 dev2("Devanagari v.2"), 38 egyp("Egyptian heiroglyphs"), 39 ethi("Ethiopic"), 40 geor("Georgian"), 41 glag("Glagolitic"), 42 goth("Gothic"), 43 grek("Greek"), 44 gujr("Gujarati"), 45 gjr2("Gujarati v.2"), 46 guru("Gurmukhi"), 47 gur2("Gurmukhi v.2"), 48 hang("Hangul"), 49 jamo("Hangul Jamo"), 50 hano("Hanunoo"), 51 hebr("Hebrew"), 52 kana("Hiragana or Katakana"), 53 armi("Imperial Aramaic"), 54 phli("Inscriptional Pahlavi"), 55 prti("Inscriptional Parthian"), 56 java("Javanese"), 57 kthi("Kaithi"), 58 knda("Kannada"), 59 knd2("Kannada v.2"), 60 kali("Kayah Li"), 61 khar("Kharosthi"), 62 khmr("Khmer"), 63 lao("Lao"), 64 latn("Latin"), 65 lepc("Lepcha"), 66 limb("Limbu"), 67 linb("Linear B"), 68 lisu("Lisu (Fraser)"), 69 lyci("Lycian"), 70 lydi("Lydian"), 71 mlym("Malayalam"), 72 mlm2("Malayalam v.2"), 73 mly2("Malayalam v.2 alt"), 74 mand("Mandaic, Mandaean"), 75 math("Mathematical Alphanumeric Symbols"), 76 mtei("Meitei Mayek (Meithei, Meetei)"), 77 merc("Meroitic Cursive"), 78 mero("Meroitic Hieroglyphs"), 79 mong("Mongolian"), 80 musc("Musical Symbols"), 81 musi("Musical Symbols Alt"), 82 mymr("Myanmar"), 83 mym2("Myanmar v.2"), 84 talu("New Tai Lue"), 85 nko("N'Ko"), 86 ogam("Ogham"), 87 olck("Ol Chiki"), 88 ital("Old Italic"), 89 xpeo("Old Persian Cuneiform"), 90 sarb("Old South Arabian"), 91 orkh("Old Turkic, Orkhon Runic"), 92 orya("Odia (formerly Oriya)"), 93 ory2("Odia v.2 (formerly Oriya v.2)"), 94 osma("Osmanya"), 95 phag("Phags-pa"), 96 phnx("Phoenician"), 97 rjng("Rejang"), 98 runr("Runic"), 99 samr("Samaritan"), 100 saur("Saurashtra"), 101 shrd("Sharada"), 102 shaw("Shavian"), 103 sinh("Sinhala"), 104 sora("Sora Sompeng"), 105 xsux("Sumero-Akkadian Cuneiform"), 106 sund("Sundanese"), 107 sylo("Syloti Nagri"), 108 syrc("Syriac"), 109 tglg("Tagalog"), 110 tagb("Tagbanwa"), 111 tale("Tai Le"), 112 lana("Tai Tham (Lanna)"), 113 tavt("Tai Viet"), 114 takr("Takri"), 115 taml("Tamil"), 116 tml2("Tamil v.2"), 117 telu("Telugu"), 118 tel2("Telugu v.2"), 119 thaa("Thaana"), 120 thai("Thai"), 121 tibt("Tibetan"), 122 tfng("Tifinagh"), 123 ugar("Ugaritic Cuneiform"), 124 vai("Vai"), 125 yi("Yi"); 126 ScriptTag(String description)127 private ScriptTag(String description) { 128 String tag = name(); 129 while (tag.length() < 4) { 130 tag = tag + ' '; 131 } 132 this.tag = Tag.intValue(tag); 133 this.description = description; 134 } 135 tag()136 public int tag() { 137 return tag; 138 } 139 description()140 public String description() { 141 return description; 142 } 143 144 private final int tag; 145 private final String description; 146 fromTag(int tag)147 static ScriptTag fromTag(int tag) { 148 for (ScriptTag script : ScriptTag.values()) { 149 if (script.tag == tag) { 150 return script; 151 } 152 } 153 throw new IllegalArgumentException(Tag.stringValue(tag)); 154 } 155 }