📄 glnames.py
字号:
#!/usr/bin/env python### FreeType 2 glyph name builder## Copyright 1996-2000, 2003, 2005 by# David Turner, Robert Wilhelm, and Werner Lemberg.## This file is part of the FreeType project, and may only be used, modified,# and distributed under the terms of the FreeType project license,# LICENSE.TXT. By continuing to use, modify, or distribute this file you# indicate that you have read the license and understand and accept it# fully."""\usage: %s <output-file> This python script generates the glyph names tables defined in the PSNames module. Its single argument is the name of the header file to be created."""import sys, string, struct, re, os.path# This table lists the glyphs according to the Macintosh specification.# It is used by the TrueType Postscript names table.## See## http://fonts.apple.com/TTRefMan/RM06/Chap6post.html## for the official list.#mac_standard_names = \[ # 0 ".notdef", ".null", "nonmarkingreturn", "space", "exclam", "quotedbl", "numbersign", "dollar", "percent", "ampersand", # 10 "quotesingle", "parenleft", "parenright", "asterisk", "plus", "comma", "hyphen", "period", "slash", "zero", # 20 "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "colon", # 30 "semicolon", "less", "equal", "greater", "question", "at", "A", "B", "C", "D", # 40 "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", # 50 "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", # 60 "Y", "Z", "bracketleft", "backslash", "bracketright", "asciicircum", "underscore", "grave", "a", "b", # 70 "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", # 80 "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", # 90 "w", "x", "y", "z", "braceleft", "bar", "braceright", "asciitilde", "Adieresis", "Aring", # 100 "Ccedilla", "Eacute", "Ntilde", "Odieresis", "Udieresis", "aacute", "agrave", "acircumflex", "adieresis", "atilde", # 110 "aring", "ccedilla", "eacute", "egrave", "ecircumflex", "edieresis", "iacute", "igrave", "icircumflex", "idieresis", # 120 "ntilde", "oacute", "ograve", "ocircumflex", "odieresis", "otilde", "uacute", "ugrave", "ucircumflex", "udieresis", # 130 "dagger", "degree", "cent", "sterling", "section", "bullet", "paragraph", "germandbls", "registered", "copyright", # 140 "trademark", "acute", "dieresis", "notequal", "AE", "Oslash", "infinity", "plusminus", "lessequal", "greaterequal", # 150 "yen", "mu", "partialdiff", "summation", "product", "pi", "integral", "ordfeminine", "ordmasculine", "Omega", # 160 "ae", "oslash", "questiondown", "exclamdown", "logicalnot", "radical", "florin", "approxequal", "Delta", "guillemotleft", # 170 "guillemotright", "ellipsis", "nonbreakingspace", "Agrave", "Atilde", "Otilde", "OE", "oe", "endash", "emdash", # 180 "quotedblleft", "quotedblright", "quoteleft", "quoteright", "divide", "lozenge", "ydieresis", "Ydieresis", "fraction", "currency", # 190 "guilsinglleft", "guilsinglright", "fi", "fl", "daggerdbl", "periodcentered", "quotesinglbase", "quotedblbase", "perthousand", "Acircumflex", # 200 "Ecircumflex", "Aacute", "Edieresis", "Egrave", "Iacute", "Icircumflex", "Idieresis", "Igrave", "Oacute", "Ocircumflex", # 210 "apple", "Ograve", "Uacute", "Ucircumflex", "Ugrave", "dotlessi", "circumflex", "tilde", "macron", "breve", # 220 "dotaccent", "ring", "cedilla", "hungarumlaut", "ogonek", "caron", "Lslash", "lslash", "Scaron", "scaron", # 230 "Zcaron", "zcaron", "brokenbar", "Eth", "eth", "Yacute", "yacute", "Thorn", "thorn", "minus", # 240 "multiply", "onesuperior", "twosuperior", "threesuperior", "onehalf", "onequarter", "threequarters", "franc", "Gbreve", "gbreve", # 250 "Idotaccent", "Scedilla", "scedilla", "Cacute", "cacute", "Ccaron", "ccaron", "dcroat"]# The list of standard `SID' glyph names. For the official list,# see Annex A of document at## http://partners.adobe.com/asn/developer/pdfs/tn/5176.CFF.pdf.#sid_standard_names = \[ # 0 ".notdef", "space", "exclam", "quotedbl", "numbersign", "dollar", "percent", "ampersand", "quoteright", "parenleft", # 10 "parenright", "asterisk", "plus", "comma", "hyphen", "period", "slash", "zero", "one", "two", # 20 "three", "four", "five", "six", "seven", "eight", "nine", "colon", "semicolon", "less", # 30 "equal", "greater", "question", "at", "A", "B", "C", "D", "E", "F", # 40 "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", # 50 "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", # 60 "bracketleft", "backslash", "bracketright", "asciicircum", "underscore", "quoteleft", "a", "b", "c", "d", # 70 "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", # 80 "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", # 90 "y", "z", "braceleft", "bar", "braceright", "asciitilde", "exclamdown", "cent", "sterling", "fraction", # 100 "yen", "florin", "section", "currency", "quotesingle", "quotedblleft", "guillemotleft", "guilsinglleft", "guilsinglright", "fi", # 110 "fl", "endash", "dagger", "daggerdbl", "periodcentered", "paragraph", "bullet", "quotesinglbase", "quotedblbase", "quotedblright", # 120 "guillemotright", "ellipsis", "perthousand", "questiondown", "grave", "acute", "circumflex", "tilde", "macron", "breve", # 130 "dotaccent", "dieresis", "ring", "cedilla", "hungarumlaut", "ogonek", "caron", "emdash", "AE", "ordfeminine", # 140 "Lslash", "Oslash", "OE", "ordmasculine", "ae", "dotlessi", "lslash", "oslash", "oe", "germandbls", # 150 "onesuperior", "logicalnot", "mu", "trademark", "Eth", "onehalf", "plusminus", "Thorn", "onequarter", "divide", # 160 "brokenbar", "degree", "thorn", "threequarters", "twosuperior", "registered", "minus", "eth", "multiply", "threesuperior", # 170 "copyright", "Aacute", "Acircumflex", "Adieresis", "Agrave", "Aring", "Atilde", "Ccedilla", "Eacute", "Ecircumflex", # 180 "Edieresis", "Egrave", "Iacute", "Icircumflex", "Idieresis", "Igrave", "Ntilde", "Oacute", "Ocircumflex", "Odieresis", # 190 "Ograve", "Otilde", "Scaron", "Uacute", "Ucircumflex", "Udieresis", "Ugrave", "Yacute", "Ydieresis", "Zcaron", # 200 "aacute", "acircumflex", "adieresis", "agrave", "aring", "atilde", "ccedilla", "eacute", "ecircumflex", "edieresis", # 210 "egrave", "iacute", "icircumflex", "idieresis", "igrave", "ntilde", "oacute", "ocircumflex", "odieresis", "ograve", # 220 "otilde", "scaron", "uacute", "ucircumflex", "udieresis", "ugrave", "yacute", "ydieresis", "zcaron", "exclamsmall", # 230 "Hungarumlautsmall", "dollaroldstyle", "dollarsuperior", "ampersandsmall", "Acutesmall", "parenleftsuperior", "parenrightsuperior", "twodotenleader", "onedotenleader", "zerooldstyle", # 240 "oneoldstyle", "twooldstyle", "threeoldstyle", "fouroldstyle", "fiveoldstyle", "sixoldstyle", "sevenoldstyle", "eightoldstyle", "nineoldstyle", "commasuperior", # 250 "threequartersemdash", "periodsuperior", "questionsmall", "asuperior", "bsuperior", "centsuperior", "dsuperior", "esuperior", "isuperior", "lsuperior", # 260 "msuperior", "nsuperior", "osuperior", "rsuperior", "ssuperior", "tsuperior", "ff", "ffi", "ffl", "parenleftinferior", # 270 "parenrightinferior", "Circumflexsmall", "hyphensuperior", "Gravesmall", "Asmall", "Bsmall", "Csmall", "Dsmall", "Esmall", "Fsmall", # 280 "Gsmall", "Hsmall", "Ismall", "Jsmall", "Ksmall", "Lsmall", "Msmall", "Nsmall", "Osmall", "Psmall", # 290 "Qsmall", "Rsmall", "Ssmall", "Tsmall", "Usmall", "Vsmall", "Wsmall", "Xsmall", "Ysmall", "Zsmall", # 300 "colonmonetary", "onefitted", "rupiah", "Tildesmall", "exclamdownsmall", "centoldstyle", "Lslashsmall", "Scaronsmall", "Zcaronsmall", "Dieresissmall", # 310 "Brevesmall", "Caronsmall", "Dotaccentsmall", "Macronsmall", "figuredash", "hypheninferior", "Ogoneksmall", "Ringsmall", "Cedillasmall", "questiondownsmall", # 320 "oneeighth", "threeeighths", "fiveeighths", "seveneighths", "onethird", "twothirds", "zerosuperior", "foursuperior", "fivesuperior", "sixsuperior", # 330 "sevensuperior", "eightsuperior", "ninesuperior", "zeroinferior", "oneinferior", "twoinferior", "threeinferior", "fourinferior", "fiveinferior", "sixinferior", # 340 "seveninferior", "eightinferior", "nineinferior", "centinferior", "dollarinferior", "periodinferior", "commainferior", "Agravesmall", "Aacutesmall", "Acircumflexsmall", # 350 "Atildesmall", "Adieresissmall", "Aringsmall", "AEsmall", "Ccedillasmall", "Egravesmall", "Eacutesmall", "Ecircumflexsmall", "Edieresissmall", "Igravesmall", # 360 "Iacutesmall", "Icircumflexsmall", "Idieresissmall", "Ethsmall", "Ntildesmall", "Ogravesmall", "Oacutesmall", "Ocircumflexsmall", "Otildesmall", "Odieresissmall", # 370 "OEsmall", "Oslashsmall", "Ugravesmall", "Uacutesmall", "Ucircumflexsmall", "Udieresissmall", "Yacutesmall", "Thornsmall", "Ydieresissmall", "001.000", # 380 "001.001", "001.002", "001.003", "Black", "Bold", "Book", "Light", "Medium", "Regular", "Roman", # 390 "Semibold"]# This table maps character codes of the Adobe Standard Type 1# encoding to glyph indices in the sid_standard_names table.#t1_standard_encoding = \[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 0, 111, 112, 113, 114, 0, 115, 116, 117, 118, 119, 120, 121, 122, 0, 123, 0, 124, 125, 126, 127, 128, 129, 130, 131, 0, 132, 133, 0, 134, 135, 136, 137, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 138, 0, 139, 0, 0, 0, 0, 140, 141, 142, 143, 0, 0, 0, 0, 0, 144, 0, 0, 0, 145, 0, 0, 146, 147, 148, 149, 0, 0, 0, 0]# This table maps character codes of the Adobe Expert Type 1# encoding to glyph indices in the sid_standard_names table.#t1_expert_encoding = \[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 229, 230, 0, 231, 232, 233, 234, 235, 236, 237, 238, 13, 14, 15, 99, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 27, 28, 249, 250, 251, 252, 0, 253, 254, 255, 256, 257, 0, 0, 0, 258, 0, 0, 259, 260, 261, 262, 0, 0, 263, 264, 265, 0, 266, 109, 110, 267, 268, 269, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 304, 305, 306, 0, 0, 307, 308, 309, 310, 311, 0, 312, 0, 0, 313, 0, 0, 314, 315, 0, 0, 316, 317, 318, 0, 0, 0, 158, 155, 163, 319, 320, 321, 322, 323, 324, 325, 0, 0, 326, 150, 164, 169, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378]# This data has been taken literally from the file `glyphlist.txt',# version 2.0, 22 Sept 2002. It is available from## http://partners.adobe.com/asn/developer/typeforum/unicodegn.html# http://partners.adobe.com/public/developer/en/opentype/glyphlist.txt#adobe_glyph_list = """\A;0041AE;00C6AEacute;01FCAEmacron;01E2AEsmall;F7E6Aacute;00C1Aacutesmall;F7E1Abreve;0102Abreveacute;1EAEAbrevecyrillic;04D0Abrevedotbelow;1EB6Abrevegrave;1EB0Abrevehookabove;1EB2Abrevetilde;1EB4Acaron;01CDAcircle;24B6Acircumflex;00C2Acircumflexacute;1EA4Acircumflexdotbelow;1EACAcircumflexgrave;1EA6Acircumflexhookabove;1EA8Acircumflexsmall;F7E2Acircumflextilde;1EAAAcute;F6C9Acutesmall;F7B4Acyrillic;0410Adblgrave;0200Adieresis;00C4Adieresiscyrillic;04D2Adieresismacron;01DEAdieresissmall;F7E4Adotbelow;1EA0Adotmacron;01E0Agrave;00C0Agravesmall;F7E0Ahookabove;1EA2Aiecyrillic;04D4Ainvertedbreve;0202Alpha;0391Alphatonos;0386Amacron;0100Amonospace;FF21Aogonek;0104Aring;00C5Aringacute;01FAAringbelow;1E00Aringsmall;F7E5Asmall;F761Atilde;00C3Atildesmall;F7E3Aybarmenian;0531B;0042Bcircle;24B7Bdotaccent;1E02Bdotbelow;1E04Becyrillic;0411Benarmenian;0532Beta;0392Bhook;0181Blinebelow;1E06Bmonospace;FF22Brevesmall;F6F4Bsmall;F762Btopbar;0182C;0043Caarmenian;053ECacute;0106Caron;F6CACaronsmall;F6F5Ccaron;010CCcedilla;00C7Ccedillaacute;1E08Ccedillasmall;F7E7Ccircle;24B8Ccircumflex;0108Cdot;010ACdotaccent;010ACedillasmall;F7B8Chaarmenian;0549Cheabkhasiancyrillic;04BCChecyrillic;0427Chedescenderabkhasiancyrillic;04BEChedescendercyrillic;04B6Chedieresiscyrillic;04F4Cheharmenian;0543Chekhakassiancyrillic;04CBCheverticalstrokecyrillic;04B8Chi;03A7Chook;0187Circumflexsmall;F6F6Cmonospace;FF23Coarmenian;0551Csmall;F763D;0044DZ;01F1DZcaron;01C4Daarmenian;0534Dafrican;0189Dcaron;010EDcedilla;1E10Dcircle;24B9Dcircumflexbelow;1E12Dcroat;0110Ddotaccent;1E0ADdotbelow;1E0CDecyrillic;0414Deicoptic;03EEDelta;2206Deltagreek;0394Dhook;018ADieresis;F6CBDieresisAcute;F6CCDieresisGrave;F6CDDieresissmall;F7A8Digammagreek;03DCDjecyrillic;0402Dlinebelow;1E0EDmonospace;FF24Dotaccentsmall;F6F7Dslash;0110Dsmall;F764Dtopbar;018BDz;01F2Dzcaron;01C5Dzeabkhasiancyrillic;04E0Dzecyrillic;0405Dzhecyrillic;040FE;0045Eacute;00C9Eacutesmall;F7E9Ebreve;0114Ecaron;011AEcedillabreve;1E1CEcharmenian;0535Ecircle;24BAEcircumflex;00CAEcircumflexacute;1EBEEcircumflexbelow;1E18Ecircumflexdotbelow;1EC6Ecircumflexgrave;1EC0Ecircumflexhookabove;1EC2Ecircumflexsmall;F7EAEcircumflextilde;1EC4Ecyrillic;0404Edblgrave;0204Edieresis;00CBEdieresissmall;F7EBEdot;0116Edotaccent;0116Edotbelow;1EB8Efcyrillic;0424Egrave;00C8Egravesmall;F7E8Eharmenian;0537Ehookabove;1EBAEightroman;2167Einvertedbreve;0206Eiotifiedcyrillic;0464Elcyrillic;041BElevenroman;216AEmacron;0112Emacronacute;1E16Emacrongrave;1E14Emcyrillic;041CEmonospace;FF25Encyrillic;041DEndescendercyrillic;04A2Eng;014AEnghecyrillic;04A4Enhookcyrillic;04C7Eogonek;0118Eopen;0190Epsilon;0395Epsilontonos;0388Ercyrillic;0420Ereversed;018EEreversedcyrillic;042DEscyrillic;0421Esdescendercyrillic;04AAEsh;01A9Esmall;F765Eta;0397Etarmenian;0538Etatonos;0389Eth;00D0Ethsmall;F7F0Etilde;1EBCEtildebelow;1E1AEuro;20ACEzh;01B7Ezhcaron;01EEEzhreversed;01B8F;0046Fcircle;24BBFdotaccent;1E1EFeharmenian;0556Feicoptic;03E4Fhook;0191Fitacyrillic;0472Fiveroman;2164Fmonospace;FF26Fourroman;2163Fsmall;F766G;0047GBsquare;3387Gacute;01F4Gamma;0393Gammaafrican;0194Gangiacoptic;03EAGbreve;011EGcaron;01E6Gcedilla;0122Gcircle;24BCGcircumflex;011CGcommaaccent;0122Gdot;0120Gdotaccent;0120Gecyrillic;0413Ghadarmenian;0542Ghemiddlehookcyrillic;0494Ghestrokecyrillic;0492Gheupturncyrillic;0490Ghook;0193Gimarmenian;0533Gjecyrillic;0403Gmacron;1E20Gmonospace;FF27Grave;F6CEGravesmall;F760Gsmall;F767Gsmallhook;029BGstroke;01E4H;0048H18533;25CFH18543;25AAH18551;25ABH22073;25A1HPsquare;33CBHaabkhasiancyrillic;04A8Hadescendercyrillic;04B2Hardsigncyrillic;042AHbar;0126Hbrevebelow;1E2AHcedilla;1E28Hcircle;24BDHcircumflex;0124Hdieresis;1E26Hdotaccent;1E22Hdotbelow;1E24Hmonospace;FF28Hoarmenian;0540Horicoptic;03E8Hsmall;F768Hungarumlaut;F6CFHungarumlautsmall;F6F8Hzsquare;3390I;0049IAcyrillic;042FIJ;0132IUcyrillic;042EIacute;00CDIacutesmall;F7EDIbreve;012CIcaron;01CFIcircle;24BEIcircumflex;00CEIcircumflexsmall;F7EEIcyrillic;0406Idblgrave;0208Idieresis;00CFIdieresisacute;1E2EIdieresiscyrillic;04E4
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -