Metadata-Version: 2.4
Name: fontname
Version: 1.0.0
Summary: Read and decode quirk encoded name records from OpenType fonts.
Author-email: Asvel <fe.asvel@gmail.com>
Requires-Python: ~=3.7
Description-Content-Type: text/x-rst
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Text Processing :: Fonts
License-File: LICENSE.txt
Requires-Dist: fonttools >=4
Project-URL: Home, https://github.com/Asvel/fontname

========
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
--------------

.. code:: python

    >>> 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.

