Linux command
fonttools 命令
文件
复制后可按需替换文件名、目录或参数。
常用示例
Subset
fonttools subset [path/to/font.ttf] --unicodes=U+0000-007F
Example
fonttools --help
说明
fonttools is a Python library and command-line toolkit for manipulating font files. It provides tools for converting, subsetting, merging, and inspecting TrueType (TTF), OpenType (OTF), and other font formats. The most common use cases include subsetting fonts for web optimization (reducing file size by including only needed glyphs), converting between binary and XML representations for inspection or editing, and merging font families. Requires Python 3.10 or later. Install via pip with pip install fonttools.
参数
- subset
- Subset font files to include only specific glyphs or Unicode ranges
- ttx
- Convert font binaries to/from XML format
- merge
- Merge multiple font files into one
- help
- Display help for fonttools or a specific subcommand
- --unicodes=_RANGE_
- Specify Unicode ranges to include (e.g., U+0000-007F)
- --output-file=_FILE_
- Specify output file path
- --help
- Display help message
FAQ
What is the fonttools command used for?
fonttools is a Python library and command-line toolkit for manipulating font files. It provides tools for converting, subsetting, merging, and inspecting TrueType (TTF), OpenType (OTF), and other font formats. The most common use cases include subsetting fonts for web optimization (reducing file size by including only needed glyphs), converting between binary and XML representations for inspection or editing, and merging font families. Requires Python 3.10 or later. Install via pip with pip install fonttools.
How do I run a basic fonttools example?
Run `fonttools subset [path/to/font.ttf] --unicodes=U+0000-007F` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does subset do in fonttools?
Subset font files to include only specific glyphs or Unicode ranges