跳转到主要内容

ttfautohint的Python封装,ttfautohint是一个免费的TrueType字体自动提示器

项目描述

Github CI Status PyPI Codecov

ttfautohint-py

ttfautohint-py 是一个用于 ttfautohint 的 Python 封装,ttfautohint 是 Werner Lemberg (@lemzwerg) 创建的免费的TrueType字体自动提示器。

它使用 ctypes 来加载 libttfautohint 共享库并调用 TTF_autohint 函数。

二进制“wheel”软件包适用于Linux(manylinux1)、macOS和Windows,支持Python 2.7和Python 3.x,32位和64位架构。它们可以使用 pip 安装程序从Python包索引(PyPI)安装。

$ pip install ttfautohint-py

轮子包括一个预编译的 libttfautohint.so (macOS上的 *.dylib,或Windows上的 *.dll)共享库,除了系统库外没有其他依赖。FreeType 和 HarfBuzz 库作为静态库从源码编译并嵌入到 libttfautohint 中。

要在Windows上从源码编译 libttfautohint.dll,您需要安装 MSYS2 和最新的 MinGW-w64 工具链。这是因为 ttfautohint 构建系统基于 autotools,因此需要类似 Unix 的环境。

使用 Makefile 构建库及其静态依赖项,因此必须将 GNU make 可执行文件放在 $PATH 上,因为这是由 setup.py 脚本调用的。

因为我们从 git 源(作为 git 子模块检查)构建 freetypeharfbuzzttfautohint,因此还需要以下开发工具的一些相对较新版本:autoconfautomakelibtoolflexbisonragel。请查看这些库的相关文档以获取更多信息。

由以下支持