mirror of
https://github.com/skishore/makemeahanzi.git
synced 2025-11-01 20:27:44 +08:00
Switch to canonical glyph naming scheme
This commit is contained in:
@ -46,11 +46,11 @@ if __name__ == '__main__':
|
|||||||
if start < 0 or end < 0:
|
if start < 0 or end < 0:
|
||||||
print >> sys.stderr, '{0}: malformed {1}'.format(options.font, codepoint)
|
print >> sys.stderr, '{0}: malformed {1}'.format(options.font, codepoint)
|
||||||
continue
|
continue
|
||||||
glyphs.append(data[start:end + len(right)])
|
glyphs.append((codepoint, data[start:end + len(right)]))
|
||||||
# Print data for each of the extracted glyphs in JSON format.
|
# Print data for each of the extracted glyphs in JSON format.
|
||||||
result = []
|
result = []
|
||||||
for glyph in glyphs:
|
for (codepoint, glyph) in glyphs:
|
||||||
name = get_html_attribute(glyph, 'glyph-name')
|
name = "U{0}".format(codepoint.upper())
|
||||||
d = get_html_attribute(glyph, 'd')
|
d = get_html_attribute(glyph, 'd')
|
||||||
assert name and d, 'Missing glyph-name or d for glyph:\n{0}'.format(glyph)
|
assert name and d, 'Missing glyph-name or d for glyph:\n{0}'.format(glyph)
|
||||||
extractor = stroke_extractor.StrokeExtractor(name, d)
|
extractor = stroke_extractor.StrokeExtractor(name, d)
|
||||||
|
|||||||
Reference in New Issue
Block a user