def makePSFontName(name):
"""Create a postscript filename out of a regular postscript fontname,
using the old fashioned macintosh 5:3:3 convention.
"""
import string
parts = []
current = []
final = []
notAllowed = '-_+=,-'
index = 0
for c in name:
if c in notAllowed:
continue
if c in string.uppercase or index == 0:
c = string.upper(c)
if current:
parts.append("".join(current))
current = [c]
else:
current.append(c)
index = index + 1
if current:
parts.append("".join(current))
final.append(parts[0][:5])
for p in parts[1:]:
final.append(p[:3])
return "".join(final)
#
#
#
# stuff for glyphs
#
#
#
评论列表
文章目录