MCPcopy Create free account
hub / github.com/PageBot/PageBot / path2FamilyName

Function path2FamilyName

Lib/pagebot/toolbox/transformer.py:675–683  ·  view source on GitHub ↗

Answers the first A-Za-z part of the file name. >>> path2FamilyName('/xxx/yyy/zzz/Agency_FB-Compressed.ufo') 'Agency' >>> path2FamilyName('/xxx/yyy/zzz/Agency##@$$% _FB.TTF') 'Agency'

(path)

Source from the content-addressed store, hash-verified

673familyNameParts = re.compile('([A-Za-z]*)')
674
675def path2FamilyName(path):
676 """Answers the first A-Za-z part of the file name.
677
678 >>> path2FamilyName('/xxx/yyy/zzz/Agency_FB-Compressed.ufo')
679 'Agency'
680 >>> path2FamilyName('/xxx/yyy/zzz/Agency##@$$% _FB.TTF')
681 'Agency'
682 """
683 return familyNameParts.findall(path2Name(path))[0]
684
685path2GlyphIdName = path2FontName
686

Callers 1

getFamilyPathsFunction · 0.90

Calls 1

path2NameFunction · 0.85

Tested by

no test coverage detected