Skip to content
/ fontname Public

Read and decode quirk encoded name records from OpenType fonts.

License

Notifications You must be signed in to change notification settings

Asvel/fontname

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fontname

fontname is a lib for reading and decoding quirk encoded name records from OpenType fonts.

It is adept at dealing with CJK fonts and has been tested on over 10000 fonts.

Installation

pip install fontname

fontname requires Python 3.7 and above.

Usage examples

>>> import fontname
>>> fontname.get_display_names("msyh.ttc")
'微软雅黑 & Microsoft Yahei UI'

>>> from fontTools import ttLib
>>> tt = ttLib.TTFont("MO-UDShinGoSCGb4-Bol.otf")
>>> fontname.decode_name(tt['name'].names[19])
('森泽UD新黑 Gb4 B', <IssueLevel.MARK: 1>, 'x_mac_simp_chinese_ttx')
>>> tt.close()

>>> tt = ttLib.TTFont("恅隋棉埴潠翷.ttf")
>>> fontname.decode_name(tt['name'].names[4])
('文鼎新艺体简', <IssueLevel.DATA: 2>, None)
>>> tt.close()

License

fontname is licensed under the MIT license.

About

Read and decode quirk encoded name records from OpenType fonts.

Topics

Resources

License

Stars

Watchers

Forks

Languages