AFDKO

适用于 OpenType 的 Adobe 字体开发工具包。(Adobe Font Development Kit for OpenType.)

Github星跟蹤圖

适用于 OpenType 的 Adobe 字体开发工具包(AFDKO)

AFDKO是一组用于从PostScript和TrueType字体数据构建OpenType字体文件的工具。

此存储库包含数据文件,Python脚本和包含AFDKO的命令行程序的源代码。该项目使用了 Apache 2.0 OpenSource许可

请参阅 AFDKO概述 有关包装内容的更详细说明。

有关其他信息,请看 wiki 例如参考资料和相关项目的链接。

安装

警告:2019年6月30日之后,AFDKO将正式启用仅支持Python 3.6或更高版本。请参见 #741 详情。

AFDKO要求 Python 2.7,3.6 或以后。

Python Package上提供了版本 索引 (PyPI)并且可以使用 pip 安装。

安装

选项1(推荐)

  • 创建虚拟环境:
    • Python 3.6 +
      python3 -m venv afdko_env        
    • Python 2.7
      pip install --user virtualenv
      python -m virtualenv afdko_env        
  • 激活虚拟环境:
    • macOS& Linux的
      source afdko_env/bin/activate        
    • Windows
      afdko_env \Scripts\activate.bat
  • 安装 afdko
    pip install afdko    

在虚拟环境中安装 afdko 可防止发生冲突 它的依赖关系和全局安装的其他模块之间。

选项2

在全球范围内安装 afdko

pip install --user afdko

更新

使用 -U (或 - upgrade )选项更新afdko(及其 依赖)到最新的稳定版本:

pip install -U afdko

要获得预发布和正在开发的版本,请使用 -pre 标志:

pip install -U afdko --pre

卸载

要删除afdko包,请使用以下命令:

pip uninstall afdko

从源代码构建

首先,您必须已经为您的平台安装了开发工具。 在Mac上,使用以下命令安装:

xcode-select --install

在Linux上,使用以下命令安装:

apt-get -y install python2.7
apt-get -y install python-pip
apt-get -y install python-dev

在Windows上,您需要Visual Studio 2017。 要从源代码构建 afdko ,请克隆 afdko GitHub 存储库 ,确保 wheel 安装模块( pip install wheel ),然后 cd 到顶层 afdko的目录,然后运行:

pip install
注意

使用可以在可编辑/开发模式下安装afdko是不可能的 pip install -e。;这是因为该工具包包含二进制C可执行文件 但是,setup.py 尝试安装在 bin/(或Scripts/)文件夹中 这个过程只适用于基于文本的脚本(或者 用Python或shell脚本语言编写)。解决这个问题 (r只会影响需要上线的少数核心afdko开发人员 他们修改源文件时的反馈)你可以使用替代方法 导出PYTHONPATH,使用.pth文件或类似的黑客攻击。 有关详细信息,请参阅 此评论

版本2.5.x 的主要更改

  • AFDKO已经过重组,因此可以作为Python安装 包。它现在取决于用户的Python解释器,而不再是 包含自己的Python解释器。
  • 两个程序 IS 和 checkoutlines 被删除,因为它们的来源 代码无法开源。这些工具可在 发布版本中找到 2.5.65322及更早版本
注意
如果您安装旧的AFDKO以及新的PyPI afdko包,那么工具就来自 较新版本将优先于旧版本。这是因为pip 在系统的PATH环境的开头添加afdko的包路径 变量,而旧的安装程序在最后添加它;对PATH的这种修改 卸载程序没有撤消。如果要完全删除路径 较新的版本,您将不得不编辑PATH。在Mac上,这意味着编辑 您的登录文件中的行,用于设置PATH变量。在Windows上,这意味着编辑 系统控制面板中的PATH环境变量。

主要指標

概覽
名稱與所有者adobe-type-tools/afdko
主編程語言C
編程語言Python (語言數: 11)
平台Linux, Mac, Windows
許可證Other
所有者活动
創建於2014-09-19 02:26:06
推送於2025-04-10 20:31:30
最后一次提交2024-11-05 16:19:55
發布數56
最新版本名稱5.0.0b20 (發布於 )
第一版名稱2.5.63209 (發布於 )
用户参与
星數1.1k
關注者數61
派生數169
提交數2.7k
已啟用問題?
問題數782
打開的問題數199
拉請求數867
打開的拉請求數11
關閉的拉請求數100
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?

AFDKO Test Suite

Coverage

PyPI

Join the chat at https://gitter.im/adobe-type-tools/afdko

Adobe Font Development Kit for OpenType (AFDKO)

The AFDKO is a set of tools for building OpenType font files from
PostScript and TrueType font data.

This repository contains the data files, Python scripts, and sources for
the command line programs that comprise the AFDKO. The project uses the
Apache 2.0 Open Source license.
Please note that the AFDKO makes use of several dependencies, listed in the
requirements.txt file, which will automatically be installed if you install
AFDKO with pip. Most of these dependencies are BSD or MIT license, with
the exception of tqdm, which is MPL 2.0.

Please refer to the
AFDKO Overview
for a more detailed description of what is included in the package.

Please see the
wiki
for additional information, such as links to reference materials and related
projects.

📣 Recent News

The Python port of psautohint was (re)integrated into the AFDKO repository as "otfautohint"

More information can be found in docs/otfautohint_Notes.md

Installation

The AFDKO requires Python 3.8
or later. It should work with any Python > 3.8, but occasionally
tool-chain components and dependencies don't keep pace with major
Python releases, so there might be some lag time while they catch up.

Releases are available on the Python Package
Index
(PyPI) and can be installed
with pip.

Note for macOS users: we recommend that you do not use the system
Python. Among other reasons, some versions of macOS ship with Python 2
and the latest version of the AFDKO is only available for Python 3. You
can find instructions for using Brew to install Python 3 on macOS here:
Installing Python 3 on Mac OS X.
Also: pyenv is a great tool for
installing and managing multiple Python versions on macOS.

Note for all users: we STRONGLY recommend the use of a Python virtual
environment (venv)
and the use of python -m pip install <package> to install all packages
(not just AFDKO). Calling pip install directly can result in the
wrong pip being called, and the package landing in the wrong location.
The combination of using a venv + python -m pip install helps to ensure
that pip-managed packages land in the right place.

Note for Linux users (and users of other platforms that are not macOS or Windows): When there is not a pre-built "wheel" for your platform pip will attempt to build the C and C++ portions of the package from source. This process will only succeed if both the C and C++ development tools and libuuid are installed. See build from source below.

Installing

Option 1 (Recommended)

  • Create a virtual environment:

      python -m venv afdko_env
    
  • Activate the virtual environment:

    • macOS & Linux

        source afdko_env/bin/activate
      
    • Windows

        afdko_env\Scripts\activate.bat
      
  • Install afdko:

      python -m pip install afdko
    

Installing the afdko inside a virtual environment prevents conflicts
between its dependencies and other modules installed globally.

Option 2 (not recommended unless there is a global conflict)

Local user installation afdko (info):

python -m pip install --user afdko

Updating

Use the -U (or --upgrade) option to update the afdko (and its
dependencies) to the newest stable release:

python -m pip install -U afdko

To get pre-release and in-development versions, use the --pre flag:

python -m pip install -U afdko --pre

Uninstalling

To remove the afdko package use the command:

python -m pip uninstall afdko

Build from source

First you must have installed the development tools for your platform.

On macOS, install these with:

xcode-select --install

On Linux (Ubuntu 17.10 LTS or later), install these with:

apt-get -y install python3.8
apt-get -y install python-pip
apt-get -y install python-dev
apt-get -y install uuid-dev

On other POSIX-like operating systems, libuuid and its header files
may be in a package named libuuid-devel or util-linux-libs. The
source code for libuuid is maintained in the
util-linux repository.

On Windows, you need Visual Studio 2017 or later.

To build the afdko from source, clone the afdko GitHub
repository
, ensure the wheel
module is installed (python -m pip install wheel), then cd to the top-level
directory of the afdko, and run:

python -m pip install .

Developing

If you'd like to develop & debug AFDKO using Xcode, run:

CMake -G Xcode .

For further information on building from source see
docs/FDK_Build_Notes.md.

Note

It's not possible to install the afdko in editable/develop mode using
python -m pip install -e . ; this is because the toolkit includes binary C executables
which setup.py tries to install in the bin/ (or Scripts/) folder, however
this process was only meant to be used with text-based scripts (either
written in Python or a shell scripting language). To work around this problem
(which really only impacts the few core afdko developers who need to get live
feedback as they modify the source files) you can use alternative methods like
exporting a PYTHONPATH, using a .pth file or similar hacks.
For further details read this comment.

Major changes from version 2.5.x

  • The AFDKO has been restructured so that it can be installed as a Python
    package. It now depends on the user's Python interpreter, and no longer
    contains its own Python interpreter.

  • Two programs, IS and checkoutlines were dropped because their source
    code could not be open-sourced. These tools are available in release version
    2.5.65322 and older
    .

Note

If you install the old AFDKO as well as the new PyPI afdko package, the tools from
the newer version will take precedence over the older. This happens because pip
adds the afdko's package path at the beginning of the system's PATH environment
variable, whereas the old installer adds it at the end; this modification to PATH
is not undone by the uninstaller. If you want to completely remove the path to the
newer version, you will have to edit the PATH. On the Mac, this means editing the
line in your login file that sets the PATH variable. On Windows, this means editing
the PATH environment variable in the system's Control Panel.