Read and decode quirk encoded name records from OpenType fonts.
Project description
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
fontname-1.0.0.tar.gz
(4.5 kB
view hashes)
Built Distribution
Close
Hashes for fontname-1.0.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5ae6500da78e2f4904a422867d1d6ca7e3a486f2434cbdeeebe777c4ddd6d5ea |
|
MD5 | 7852c9d8b4d4a85c65a97dae4bcd393b |
|
BLAKE2b-256 | ef6b208d143ec3bcd2201c551143ab9b84b1e1d5d47e61629a104bf457cfd185 |