📄 glnames.py
字号:
208D;parenleftinferior;SUBSCRIPT LEFT PARENTHESIS207D;parenleftsuperior;SUPERSCRIPT LEFT PARENTHESISF8EB;parenlefttp;LEFT PAREN TOP0029;parenright;RIGHT PARENTHESISF8F8;parenrightbt;RIGHT PAREN BOTTOMF8F7;parenrightex;RIGHT PAREN EXTENDER208E;parenrightinferior;SUBSCRIPT RIGHT PARENTHESIS207E;parenrightsuperior;SUPERSCRIPT RIGHT PARENTHESISF8F6;parenrighttp;RIGHT PAREN TOP2202;partialdiff;PARTIAL DIFFERENTIAL0025;percent;PERCENT SIGN002E;period;FULL STOP00B7;periodcentered;MIDDLE DOT2219;periodcentered;BULLET OPERATOR;DuplicateF6E7;periodinferior;SUBSCRIPT FULL STOPF6E8;periodsuperior;SUPERSCRIPT FULL STOP22A5;perpendicular;UP TACK2030;perthousand;PER MILLE SIGN20A7;peseta;PESETA SIGN03C6;phi;GREEK SMALL LETTER PHI03D5;phi1;GREEK PHI SYMBOL03C0;pi;GREEK SMALL LETTER PI002B;plus;PLUS SIGN00B1;plusminus;PLUS-MINUS SIGN211E;prescription;PRESCRIPTION TAKE220F;product;N-ARY PRODUCT2282;propersubset;SUBSET OF2283;propersuperset;SUPERSET OF221D;proportional;PROPORTIONAL TO03C8;psi;GREEK SMALL LETTER PSI0071;q;LATIN SMALL LETTER Q003F;question;QUESTION MARK00BF;questiondown;INVERTED QUESTION MARKF7BF;questiondownsmall;SMALL CAPITAL INVERTED QUESTION MARKF73F;questionsmall;SMALL CAPITAL QUESTION MARK0022;quotedbl;QUOTATION MARK201E;quotedblbase;DOUBLE LOW-9 QUOTATION MARK201C;quotedblleft;LEFT DOUBLE QUOTATION MARK201D;quotedblright;RIGHT DOUBLE QUOTATION MARK2018;quoteleft;LEFT SINGLE QUOTATION MARK201B;quotereversed;SINGLE HIGH-REVERSED-9 QUOTATION MARK2019;quoteright;RIGHT SINGLE QUOTATION MARK201A;quotesinglbase;SINGLE LOW-9 QUOTATION MARK0027;quotesingle;APOSTROPHE0072;r;LATIN SMALL LETTER R0155;racute;LATIN SMALL LETTER R WITH ACUTE221A;radical;SQUARE ROOTF8E5;radicalex;RADICAL EXTENDER0159;rcaron;LATIN SMALL LETTER R WITH CARON0157;rcommaaccent;LATIN SMALL LETTER R WITH CEDILLA2286;reflexsubset;SUBSET OF OR EQUAL TO2287;reflexsuperset;SUPERSET OF OR EQUAL TO00AE;registered;REGISTERED SIGNF8E8;registersans;REGISTERED SIGN SANS SERIFF6DA;registerserif;REGISTERED SIGN SERIF2310;revlogicalnot;REVERSED NOT SIGN03C1;rho;GREEK SMALL LETTER RHO02DA;ring;RING ABOVEF6F1;rsuperior;SUPERSCRIPT LATIN SMALL LETTER R2590;rtblock;RIGHT HALF BLOCKF6DD;rupiah;RUPIAH SIGN0073;s;LATIN SMALL LETTER S015B;sacute;LATIN SMALL LETTER S WITH ACUTE0161;scaron;LATIN SMALL LETTER S WITH CARON015F;scedilla;LATIN SMALL LETTER S WITH CEDILLAF6C2;scedilla;LATIN SMALL LETTER S WITH CEDILLA;Duplicate015D;scircumflex;LATIN SMALL LETTER S WITH CIRCUMFLEX0219;scommaaccent;LATIN SMALL LETTER S WITH COMMA BELOW2033;second;DOUBLE PRIME00A7;section;SECTION SIGN003B;semicolon;SEMICOLON0037;seven;DIGIT SEVEN215E;seveneighths;VULGAR FRACTION SEVEN EIGHTHS2087;seveninferior;SUBSCRIPT SEVENF737;sevenoldstyle;OLDSTYLE DIGIT SEVEN2077;sevensuperior;SUPERSCRIPT SEVEN2592;shade;MEDIUM SHADE03C3;sigma;GREEK SMALL LETTER SIGMA03C2;sigma1;GREEK SMALL LETTER FINAL SIGMA223C;similar;TILDE OPERATOR0036;six;DIGIT SIX2086;sixinferior;SUBSCRIPT SIXF736;sixoldstyle;OLDSTYLE DIGIT SIX2076;sixsuperior;SUPERSCRIPT SIX002F;slash;SOLIDUS263A;smileface;WHITE SMILING FACE0020;space;SPACE00A0;space;NO-BREAK SPACE;Duplicate2660;spade;BLACK SPADE SUITF6F2;ssuperior;SUPERSCRIPT LATIN SMALL LETTER S00A3;sterling;POUND SIGN220B;suchthat;CONTAINS AS MEMBER2211;summation;N-ARY SUMMATION263C;sun;WHITE SUN WITH RAYS0074;t;LATIN SMALL LETTER T03C4;tau;GREEK SMALL LETTER TAU0167;tbar;LATIN SMALL LETTER T WITH STROKE0165;tcaron;LATIN SMALL LETTER T WITH CARON0163;tcommaaccent;LATIN SMALL LETTER T WITH CEDILLA021B;tcommaaccent;LATIN SMALL LETTER T WITH COMMA BELOW;Duplicate2234;therefore;THEREFORE03B8;theta;GREEK SMALL LETTER THETA03D1;theta1;GREEK THETA SYMBOL00FE;thorn;LATIN SMALL LETTER THORN0033;three;DIGIT THREE215C;threeeighths;VULGAR FRACTION THREE EIGHTHS2083;threeinferior;SUBSCRIPT THREEF733;threeoldstyle;OLDSTYLE DIGIT THREE00BE;threequarters;VULGAR FRACTION THREE QUARTERSF6DE;threequartersemdash;THREE QUARTERS EM DASH00B3;threesuperior;SUPERSCRIPT THREE02DC;tilde;SMALL TILDE0303;tildecomb;COMBINING TILDE0384;tonos;GREEK TONOS2122;trademark;TRADE MARK SIGNF8EA;trademarksans;TRADE MARK SIGN SANS SERIFF6DB;trademarkserif;TRADE MARK SIGN SERIF25BC;triagdn;BLACK DOWN-POINTING TRIANGLE25C4;triaglf;BLACK LEFT-POINTING POINTER25BA;triagrt;BLACK RIGHT-POINTING POINTER25B2;triagup;BLACK UP-POINTING TRIANGLEF6F3;tsuperior;SUPERSCRIPT LATIN SMALL LETTER T0032;two;DIGIT TWO2025;twodotenleader;TWO DOT LEADER2082;twoinferior;SUBSCRIPT TWOF732;twooldstyle;OLDSTYLE DIGIT TWO00B2;twosuperior;SUPERSCRIPT TWO2154;twothirds;VULGAR FRACTION TWO THIRDS0075;u;LATIN SMALL LETTER U00FA;uacute;LATIN SMALL LETTER U WITH ACUTE016D;ubreve;LATIN SMALL LETTER U WITH BREVE00FB;ucircumflex;LATIN SMALL LETTER U WITH CIRCUMFLEX00FC;udieresis;LATIN SMALL LETTER U WITH DIAERESIS00F9;ugrave;LATIN SMALL LETTER U WITH GRAVE01B0;uhorn;LATIN SMALL LETTER U WITH HORN0171;uhungarumlaut;LATIN SMALL LETTER U WITH DOUBLE ACUTE016B;umacron;LATIN SMALL LETTER U WITH MACRON005F;underscore;LOW LINE2017;underscoredbl;DOUBLE LOW LINE222A;union;UNION2200;universal;FOR ALL0173;uogonek;LATIN SMALL LETTER U WITH OGONEK2580;upblock;UPPER HALF BLOCK03C5;upsilon;GREEK SMALL LETTER UPSILON03CB;upsilondieresis;GREEK SMALL LETTER UPSILON WITH DIALYTIKA03B0;upsilondieresistonos;GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND TONOS03CD;upsilontonos;GREEK SMALL LETTER UPSILON WITH TONOS016F;uring;LATIN SMALL LETTER U WITH RING ABOVE0169;utilde;LATIN SMALL LETTER U WITH TILDE0076;v;LATIN SMALL LETTER V0077;w;LATIN SMALL LETTER W1E83;wacute;LATIN SMALL LETTER W WITH ACUTE0175;wcircumflex;LATIN SMALL LETTER W WITH CIRCUMFLEX1E85;wdieresis;LATIN SMALL LETTER W WITH DIAERESIS2118;weierstrass;SCRIPT CAPITAL P1E81;wgrave;LATIN SMALL LETTER W WITH GRAVE0078;x;LATIN SMALL LETTER X03BE;xi;GREEK SMALL LETTER XI0079;y;LATIN SMALL LETTER Y00FD;yacute;LATIN SMALL LETTER Y WITH ACUTE0177;ycircumflex;LATIN SMALL LETTER Y WITH CIRCUMFLEX00FF;ydieresis;LATIN SMALL LETTER Y WITH DIAERESIS00A5;yen;YEN SIGN1EF3;ygrave;LATIN SMALL LETTER Y WITH GRAVE007A;z;LATIN SMALL LETTER Z017A;zacute;LATIN SMALL LETTER Z WITH ACUTE017E;zcaron;LATIN SMALL LETTER Z WITH CARON017C;zdotaccent;LATIN SMALL LETTER Z WITH DOT ABOVE0030;zero;DIGIT ZERO2080;zeroinferior;SUBSCRIPT ZEROF730;zerooldstyle;OLDSTYLE DIGIT ZERO2070;zerosuperior;SUPERSCRIPT ZERO03B6;zeta;GREEK SMALL LETTER ZETA"""t1_bias = 0glyph_list = []def the_adobe_glyph_list(): """return the list of glyph names in the adobe list""" lines = string.split( adobe_glyph_list, '\n' ) glyphs = [] for line in lines: if line: fields = string.split( line, ';' )# print fields[0] + ' - ' + fields[1] glyphs.append( fields[1] ) return glyphsdef the_adobe_glyphs(): """return the list of unicode values""" lines = string.split( adobe_glyph_list, '\n' ) glyphs = [] values = [] for line in lines: if line: fields = string.split( line, ';' )# print fields[0] + ' - ' + fields[1] glyphs.append( fields[1] ) values.append( fields[0] ) return glyphs, valuesdef count_extra_glyphs( alist, filter ): """count the number of extra glyphs""" count = 0 extras = [] for name in alist: try: filtered_index = filter.index( name ) except: extras.append( name ) return extrasdef dump_mac_indices( file, t1_bias ): write = file.write write( " static const unsigned short mac_standard_names[" + \ repr( len( mac_standard_names ) + 1 ) + "] =\n" ) write( " {\n" ) count = 0 for name in mac_standard_names: try: t1_index = t1_standard_strings.index( name ) write( " " + repr( t1_bias + t1_index ) + ",\n" ) except: write( " " + repr( count ) + ",\n" ) count = count + 1 write( " 0\n" ) write( " };\n" ) write( "\n" ) write( "\n" )def dump_glyph_list( file, glyph_list, adobe_extra ): write = file.write name_list = [] write( " static const char* standard_glyph_names[] =\n" ) write( " {\n" ) for name in glyph_list: write( ' "' + name + '",\n' ) name_list.append( name ) write( "\n" ) write( "#ifdef FT_CONFIG_OPTION_ADOBE_GLYPH_LIST\n" ) write( "\n" ) for name in adobe_extra: write( ' "' + name + '",\n' ) name_list.append( name ) write( "\n" ) write( "#endif /* FT_CONFIG_OPTION_ADOBE_GLYPH_LIST */\n" ) write( "\n" ) write( " 0\n" ) write( " };\n" ) write( "\n" ) write( "\n" ) return name_listdef dump_unicode_values( file, base_list, adobe_list ): """build the glyph names to unicode values table""" write = file.write adobe_glyphs, uni_values = the_adobe_glyphs() write( "\n" ) write( " static const unsigned short names_to_unicode[" + \ repr( len( base_list ) + len( adobe_list ) + 1 ) + "] =\n" ) write( " {\n" ) for name in base_list: try: index = adobe_glyphs.index( name ) write( " 0x" + uni_values[index] + ",\n" ) except: write( " 0,\n" ) write( "\n" ) write( "#ifdef FT_CONFIG_OPTION_ADOBE_GLYPH_LIST\n" ) write( "\n" ) for name in adobe_list: try: index = adobe_glyphs.index( name ) write( " 0x" + uni_values[index] + ",\n" ) except: write( " 0,\n" ) write( "\n" ) write( "#endif /* FT_CONFIG_OPTION_ADOBE_GLYPH_LIST */\n" ) write( " 0\n" ) write( " };\n" ) write( "\n" ) write( "\n" ) write( "\n" )def dump_encoding( file, encoding_name, encoding_list ): """dumps a given encoding""" write = file.write write( " static const unsigned short " + encoding_name + "[" + \ repr( len( encoding_list ) + 1 ) + "] =\n" ) write( " {\n" ) for value in encoding_list: write( " " + repr( value ) + ",\n" ) write( " 0\n" ) write( " };\n" ) write( "\n" ) write( "\n" )def main(): """main program body""" if len( sys.argv ) != 2: print __doc__ % sys.argv[0] sys.exit( 1 ) file = open( sys.argv[1], "w\n" ) write = file.write count_sid = len( t1_standard_strings ) # build mac index table & supplemental glyph names mac_list = count_extra_glyphs( mac_standard_names, t1_standard_strings ) count_mac = len( mac_list ) t1_bias = count_mac base_list = mac_list + t1_standard_strings # build adobe unicode index table & supplemental glyph names adobe_list = the_adobe_glyph_list() adobe_list = count_extra_glyphs( adobe_list, base_list ) count_adobe = len( adobe_list ) write( "/***************************************************************************/\n" ) write( "/* */\n" ) write( "/* %-71s*/\n" % sys.argv[1] ) write( "/* */\n" ) write( "/* PostScript glyph names (specification only). */\n" ) write( "/* */\n" ) write( "/* Copyright 2000 by */\n" ) write( "/* David Turner, Robert Wilhelm, and Werner Lemberg. */\n" ) write( "/* */\n" ) write( "/* This file is part of the FreeType project, and may only be used, */\n" ) write( "/* modified, and distributed under the terms of the FreeType project */\n" ) write( "/* license, LICENSE.TXT. By continuing to use, modify, or distribute */\n" ) write( "/* this file you indicate that you have read the license and */\n" ) write( "/* understand and accept it fully. */\n" ) write( "/* */\n" ) write( "/***************************************************************************/\n" ) write( "\n" ) write( "\n" ) write( " /* this file has been generated automatically -- do not edit! */\n" ) write( "\n" ) write( "\n" ) # dump glyph list name_list = dump_glyph_list( file, base_list, adobe_list ) # dump t1_standard_list write( " static const char** t1_standard_glyphs = " \ + "standard_glyph_names + " + repr( t1_bias ) + ";\n" ) write( "\n" ) write( "\n" ) write( "#define NUM_STD_GLYPHS " + repr( len( t1_standard_strings ) ) + "\n" ) write( "\n" ) write( "#ifdef FT_CONFIG_OPTION_ADOBE_GLYPH_LIST\n" ) write( "#define NUM_ADOBE_GLYPHS " + \ repr( len( base_list ) + len( adobe_list ) - t1_bias ) + "\n" ) write( "#else\n" ) write( "#define NUM_ADOBE_GLYPHS " + \ repr( len( base_list ) - t1_bias ) + "\n" ) write( "#endif\n" ) write( "\n" ) write( "\n" ) # dump mac indices table dump_mac_indices( file, t1_bias ) # discard mac names from base list base_list = base_list[t1_bias:] # dump unicode values table dump_unicode_values( file, base_list, adobe_list ) dump_encoding( file, "t1_standard_encoding", t1_standard_encoding ) dump_encoding( file, "t1_expert_encoding", t1_expert_encoding ) write( "/* END */\n" )# Now run the main routine#main()# END
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -