GlyphsInfo-master/ 0000755 0001750 0001750 00000000000 13204234105 015413 5 ustar medicalwei medicalwei GlyphsInfo-master/write simple GlyphData.py 0000644 0001750 0001750 00000004251 13204234105 022231 0 ustar medicalwei medicalwei #MenuTitle: write simple GlyphData
# -*- coding: utf-8 -*-
infos = GSGlyphsInfo.sharedManager().glyphInfos()
# or:
# infos = GSGlyphsInfo.alloc().initWithLocalFile_(NSURL.fileURLWithPath_("path to custom GlyphData.xml file"))
f = open("GlyphData.xml", "w")
fIdeo = open("GlyphData_Ideographs.xml", "w")
def writeHeader(f):
f.write('\n\
\n\
\n\
\n\
]>\n\
\n')
writeHeader(f)
writeHeader(fIdeo)
disabledGlyphs = ["brevecomb_acutecomb",
"brevecomb_gravecomb",
"brevecomb_hookabovecomb",
"brevecomb_tildecomb",
"circumflexcomb_acutecomb",
"circumflexcomb_gravecomb",
"circumflexcomb_hookabovecomb",
"circumflexcomb_tildecomb",
"idotaccent.sc",
"i.sc",
]
forcedGlyphs = ["ringcenter-ar"]
def printInfo(info):
string = ' \n'
return string
count = 0
for info in infos:
if info.script == "han":
fIdeo.write(printInfo(info))
elif (info.name in disabledGlyphs or (info.script == "arabic" and info.unicode is None)) and (info.name not in forcedGlyphs):
continue
else:
f.write(printInfo(info))
count += 1
print "Written %d entries" % count
f.write('\n')
fIdeo.write('\n')
f.close()
fIdeo.close() GlyphsInfo-master/GlyphData_Ideographs.xml 0000644 0001750 0001750 00010506054 13204234105 022172 0 ustar medicalwei medicalwei
]>
GlyphsInfo-master/GlyphData.xml 0000644 0001750 0001750 00017514606 13204234105 020036 0 ustar medicalwei medicalwei
]>
GlyphsInfo-master/README.md 0000644 0001750 0001750 00000005007 13204234105 016674 0 ustar medicalwei medicalwei # GlyphsInfo
This is the basic subset of the glyph info that is used inside Glyphs.app.
## Readable Names
the glyph names are derived from the AGL with some adjustments. For glyphs not in that list a name is invented. It’s mostly based on the unicode description but heavily edited to produce short and readable names. To distinguish different scripts, a hyphen+script tag is appended. For common scripts like Arabic and Cyrillic a short version is used (-ar, -cy). Most other scripts just get the full script name to make it easier for people that are not familiar with those scripts.
## Ideograph Entries
The Ideographs and Han glyphs are in a separate file to make it more manageable.
## Contribution
Please fork the repository and send pull requests for missing scripts, changes and misspellings.
## Todo and known issues
The list does not cover the full Unicode. I add script ranges on request as i like to check/edit the results and that is easier if someone involved in that script is around.
## Notices
### Contains Information for the `Adobe AGL`:
Copyright 2002, 2010, 2015 Adobe Systems Incorporated. All rights reserved.
Redistribution and use in source and binary forms, with or
without modification, are permitted provided that the
following conditions are met:
Redistributions of source code must retain the above
copyright notice, this list of conditions and the following
disclaimer.
Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials
provided with the distribution.
Neither the name of Adobe Systems Incorporated nor the names
of its contributors may be used to endorse or promote
products derived from this software without specific prior
written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
GlyphsInfo-master/Convert to tabbed file.py 0000644 0001750 0001750 00000006062 13204234105 022116 0 ustar medicalwei medicalwei # -*- coding: utf-8 -*-
inputFilePath = "/Path/To/File/GlyphData.txt"
import sys, os
if len(sys.argv) > 1:
inputFilePath = sys.argv[1]
if len(inputFilePath) < 5:
print "Please supply a path to a file. This can be either a GlyphData.xml or a tab separated .txt file"
exit()
if not os.path.isfile(inputFilePath):
print "Could not find file at path:", inputFilePath
exit()
# This list defineds the columns and ordering in the tabbed file.
fields = ["unicode",
"name",
#"unicode2",
"sortName",
"sortNameKeep",
"decompose",
"category",
"subCategory",
"script",
"production",
"altNames",
"description",
"anchors",
"accents"]
def writeTabbedHeader(File):
line = "\t".join(fields)+"\n"
File.write(line)
def writeTabbedContent(inputFilePath, outFile):
import xml.etree.ElementTree
tree = xml.etree.ElementTree.parse(inputFilePath).getroot()
i = 0
for node in tree.iter():
if node.tag != "glyph":
continue
nodeAttribs = dict(node.attrib)
attribs = []
for field in fields:
attrib = nodeAttribs.get(field, "")
if field == "unicode" and len(attrib) > 0:
attrib = "\"%s\"" % attrib # Excel and Number import is as numbers anyway but you got to try
attribs.append(attrib)
try:
nodeAttribs.pop(field)
except:
pass
if len(nodeAttribs) > 0:
print "Attributes not written:", node.attrib["name"], nodeAttribs
line = "\t".join(attribs)+"\n"
outFile.write(line.encode("utf-8"))
def writeDataHeader(File):
File.write('\n\
\n\
\n\
\n\
]>\n\
\n')
def writeDataContent(inputFilePath, outFile):
import codecs
inFile = codecs.open(inputFilePath, "r", "utf-8")
fields = inFile.readline().strip('\n').split("\t")
print "Reading Fields:",", ".join(fields)
for line in inFile:
attribs = line.strip('\n').split("\t")
line = u' 0:
attrib = attrib.strip("\"")
line += u'%s="%s" ' % (field, attrib)
line += '/>\n'
outFile.write(line.encode("utf-8"))
outFile.write('\n')
inFile.close()
if inputFilePath[-4:] == ".xml":
print "To Tabbed", inputFilePath
outputFilePath = inputFilePath[:-4]+".txt"
outputFile = open(outputFilePath, "w")
writeTabbedHeader(outputFile)
writeTabbedContent(inputFilePath, outputFile)
outputFile.close()
elif inputFilePath[-4:] == ".txt":
print "To XML: ", inputFilePath
outputFilePath = inputFilePath[:-4]+"_new.xml"
outputFile = open(outputFilePath, "w")
writeDataHeader(outputFile)
writeDataContent(inputFilePath, outputFile)
outputFile.close()
GlyphsInfo-master/LICENSE 0000644 0001750 0001750 00000002070 13204234105 016417 0 ustar medicalwei medicalwei The MIT License (MIT)
Copyright (c) 2016 Georg Seifert
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.