toolsFL.py 文件源码

python
阅读 29 收藏 0 点赞 0 评论 0

项目:inter 作者: rsms 项目源码 文件源码
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
#
#
#
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号