ufo-extractor


Nameufo-extractor JSON
Version 0.8.1 PyPI version JSON
download
home_pagehttps://github.com/robotools/extractor
SummaryTools for extracting data from font binaries into UFO objects.
upload_time2024-10-29 16:25:38
maintainerJust van Rossum, Frederik Berlaen, Ben Kiel
docs_urlNone
authorTal Leming
requires_python>=3.8
licenseMIT
keywords
VCS
bugtrack_url
requirements fonttools fontFeatures
Travis-CI No Travis.
coveralls test coverage No coveralls.
            |CI Build Status| |PyPI Version| |Python Versions|


UFO Extractor
=============

Tools for extracting data from font binaries into UFO objects.

Supported input formats
-----------------------

The following font formats are supported:

-  CFF or TrueType-flavored OpenType fonts (``*.otf``, ``*.ttf``)
-  `FontTools <https://github.com/fonttools/fonttools>`__ TTX files
   (``*.ttx``)
-  WOFF 1.0/2.0 (``*.woff``, ``*.woff2``)
-  PostScript Type1 fonts (``*.pfa``, ``*.pfb``, etc.)
-  FontLab files (``*.vfb``, when installed with optional dependency "vfb")

Note however, that what data will (or even could) be exported will depend on
input file format and the file itself.

Python module
-------------

The example below demonstrates how one can import data into
a `ufoLib2 <https://github.com/fonttools/ufoLib2/>`__
or `Defcon <https://github.com/typesupply/defcon>`__ ``Font`` instance:

.. code:: python

   >>> import extractor
   >>> from ufoLib2 import Font    # alternatively: from defcon import Font
   >>> ufo = Font()
   >>> extractor.extractUFO("/path/to/MyFont.ttf", ufo)
   >>> ufo.save("/path/to/MyFont.ufo")

Console script
--------------

A console script for one-off conversion is also provided
(note: see Installation below):

.. code::

   $ extractufo -h
   usage: extractufo [-h] [-m {ufoLib2,defcon}] [-z] FONT_FILE [FONT_FILE ...]

   Extract data from font binaries and build UFO objects from them.

   positional arguments:
     FONT_FILE             Input font path

   options:
     -h, --help            show this help message and exit
     -m {ufoLib2,defcon}, --ufo-module {ufoLib2,defcon}
                           Select the default library for writing UFOs (default: autodetect, prefer ufoLib2)
     -z, --zip             Output UFO ZIP

   Each resulting UFO will be saved as FONT_FILE.ufo(z) in the same directory as the original FONT_FILE.
   If destination file or directory already exists, conversion for that source file will be skipped and the application exit code will indicate an error.

Installation
------------

You can install ``extractor`` with ``pip``:

.. code::

   $ pip install ufo-extractor

To install with support for extracting from vfb files:

.. code::

   $ pip install ufo-extractor[vfb]

If you want to use the console script and have neither `ufoLib2` nor `defcon`
installed (or aren't sure), running the following will install `ufoLib2` as well
to ensure that the script works:

.. code::

   $ pip install ufo-extractor[script]

The options may also be combined:

.. code::

   $ pip install ufo-extractor[vfb][script]

Note that, for historical reasons, the package is listed on the
`Python Package Index <https://travis-ci.org/typesupply/extractor>`__ under the name
``ufo-extractor``, to disambiguate it from another package also called "extractor".
However, the import name for the package remains ``extractor``, without prefix.


.. |CI Build Status| image:: https://github.com/robotools/extractor/workflows/Tests/badge.svg
   :target: https://github.com/robotools/extractor/actions?query=workflow%3ATests
.. |PyPI Version| image:: https://img.shields.io/pypi/v/ufo-extractor.svg
   :target: https://pypi.org/project/ufo-extractor/
.. |Python Versions| image:: https://img.shields.io/badge/python-3.8%2C%203.9%2C%203.10%2C%203.11%2C%203.12-blue.svg

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/robotools/extractor",
    "name": "ufo-extractor",
    "maintainer": "Just van Rossum, Frederik Berlaen, Ben Kiel",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "justvanrossum@gmail.com",
    "keywords": null,
    "author": "Tal Leming",
    "author_email": "tal@typesupply.com",
    "download_url": "https://files.pythonhosted.org/packages/2d/3b/22225ded69f50bc61840d88c9bcaa852eb8a27a4be8a3a41c9d58a7cad42/ufo_extractor-0.8.1.zip",
    "platform": null,
    "description": "|CI Build Status| |PyPI Version| |Python Versions|\n\n\nUFO Extractor\n=============\n\nTools for extracting data from font binaries into UFO objects.\n\nSupported input formats\n-----------------------\n\nThe following font formats are supported:\n\n-  CFF or TrueType-flavored OpenType fonts (``*.otf``, ``*.ttf``)\n-  `FontTools <https://github.com/fonttools/fonttools>`__ TTX files\n   (``*.ttx``)\n-  WOFF 1.0/2.0 (``*.woff``, ``*.woff2``)\n-  PostScript Type1 fonts (``*.pfa``, ``*.pfb``, etc.)\n-  FontLab files (``*.vfb``, when installed with optional dependency \"vfb\")\n\nNote however, that what data will (or even could) be exported will depend on\ninput file format and the file itself.\n\nPython module\n-------------\n\nThe example below demonstrates how one can import data into\na `ufoLib2 <https://github.com/fonttools/ufoLib2/>`__\nor `Defcon <https://github.com/typesupply/defcon>`__ ``Font`` instance:\n\n.. code:: python\n\n   >>> import extractor\n   >>> from ufoLib2 import Font    # alternatively: from defcon import Font\n   >>> ufo = Font()\n   >>> extractor.extractUFO(\"/path/to/MyFont.ttf\", ufo)\n   >>> ufo.save(\"/path/to/MyFont.ufo\")\n\nConsole script\n--------------\n\nA console script for one-off conversion is also provided\n(note: see Installation below):\n\n.. code::\n\n   $ extractufo -h\n   usage: extractufo [-h] [-m {ufoLib2,defcon}] [-z] FONT_FILE [FONT_FILE ...]\n\n   Extract data from font binaries and build UFO objects from them.\n\n   positional arguments:\n     FONT_FILE             Input font path\n\n   options:\n     -h, --help            show this help message and exit\n     -m {ufoLib2,defcon}, --ufo-module {ufoLib2,defcon}\n                           Select the default library for writing UFOs (default: autodetect, prefer ufoLib2)\n     -z, --zip             Output UFO ZIP\n\n   Each resulting UFO will be saved as FONT_FILE.ufo(z) in the same directory as the original FONT_FILE.\n   If destination file or directory already exists, conversion for that source file will be skipped and the application exit code will indicate an error.\n\nInstallation\n------------\n\nYou can install ``extractor`` with ``pip``:\n\n.. code::\n\n   $ pip install ufo-extractor\n\nTo install with support for extracting from vfb files:\n\n.. code::\n\n   $ pip install ufo-extractor[vfb]\n\nIf you want to use the console script and have neither `ufoLib2` nor `defcon`\ninstalled (or aren't sure), running the following will install `ufoLib2` as well\nto ensure that the script works:\n\n.. code::\n\n   $ pip install ufo-extractor[script]\n\nThe options may also be combined:\n\n.. code::\n\n   $ pip install ufo-extractor[vfb][script]\n\nNote that, for historical reasons, the package is listed on the\n`Python Package Index <https://travis-ci.org/typesupply/extractor>`__ under the name\n``ufo-extractor``, to disambiguate it from another package also called \"extractor\".\nHowever, the import name for the package remains ``extractor``, without prefix.\n\n\n.. |CI Build Status| image:: https://github.com/robotools/extractor/workflows/Tests/badge.svg\n   :target: https://github.com/robotools/extractor/actions?query=workflow%3ATests\n.. |PyPI Version| image:: https://img.shields.io/pypi/v/ufo-extractor.svg\n   :target: https://pypi.org/project/ufo-extractor/\n.. |Python Versions| image:: https://img.shields.io/badge/python-3.8%2C%203.9%2C%203.10%2C%203.11%2C%203.12-blue.svg\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Tools for extracting data from font binaries into UFO objects.",
    "version": "0.8.1",
    "project_urls": {
        "Homepage": "https://github.com/robotools/extractor"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "cdcf34b74c79439ac47ee16e129b709b1fe61ef20211175ac358a252ae50dd3b",
                "md5": "36dd2e7050262b9d85d8cab5936c5a3d",
                "sha256": "8b3b0bb2d81f7802203e940851b07ce4559b67d627ef33034e8bbd8fad66d5a7"
            },
            "downloads": -1,
            "filename": "ufo_extractor-0.8.1-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "36dd2e7050262b9d85d8cab5936c5a3d",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": ">=3.8",
            "size": 24912,
            "upload_time": "2024-10-29T16:25:34",
            "upload_time_iso_8601": "2024-10-29T16:25:34.658035Z",
            "url": "https://files.pythonhosted.org/packages/cd/cf/34b74c79439ac47ee16e129b709b1fe61ef20211175ac358a252ae50dd3b/ufo_extractor-0.8.1-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "2d3b22225ded69f50bc61840d88c9bcaa852eb8a27a4be8a3a41c9d58a7cad42",
                "md5": "b5c9dafba24393405aabd7e4e17cdaa1",
                "sha256": "e4c2ba3458dcc0ee203a3a16d886f3736e50c36b5a4e906b97e5dcc486e1863d"
            },
            "downloads": -1,
            "filename": "ufo_extractor-0.8.1.zip",
            "has_sig": false,
            "md5_digest": "b5c9dafba24393405aabd7e4e17cdaa1",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 3112684,
            "upload_time": "2024-10-29T16:25:38",
            "upload_time_iso_8601": "2024-10-29T16:25:38.870648Z",
            "url": "https://files.pythonhosted.org/packages/2d/3b/22225ded69f50bc61840d88c9bcaa852eb8a27a4be8a3a41c9d58a7cad42/ufo_extractor-0.8.1.zip",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-10-29 16:25:38",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "robotools",
    "github_project": "extractor",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "fonttools",
            "specs": []
        },
        {
            "name": "fontFeatures",
            "specs": []
        }
    ],
    "tox": true,
    "lcname": "ufo-extractor"
}
        
Elapsed time: 0.56954s