TrueType TTC Bundler with Glyph Sharing
raw JSON →otfcc-ttcize is a command-line utility designed to bundle multiple TrueType (TTF) font files into a single TrueType Collection (TTC) file, with a focus on optimizing file size through glyph sharing. It is currently at version 0.10.2 and appears to be actively maintained as part of the broader otfcc toolchain, though specific release cadences are not explicitly stated. A key differentiator is its glyph sharing mechanism, which significantly reduces the final TTC file size by consolidating common glyphs across the bundled fonts. However, it's crucial to note that this glyph sharing functionality is *not* applicable to CFF (Compact Font Format) fonts, for which users are advised to consider `otf2otc` instead. The tool relies on external `otfcc` executables for its underlying font processing operations.
Common errors
error Error: Command failed: otfccdump ... ↓
otfcc tools are installed and their executables are in your system's PATH, or use --otfccdump-command=<path> and --otfccbuild-command=<path> to specify their locations. error No input files specified. ↓
.ttf files as arguments before the output option: otfcc-ttcize -o output.ttc font1.ttf font2.ttf. error Error: 'output.ttc' already exists. Use --overwrite to force. ↓
--overwrite option to explicitly allow overwriting the existing file. Warnings
gotcha Glyph sharing, a core feature for size reduction, is explicitly stated not to work for CFF (Compact Font Format) fonts. Attempting to process CFF fonts may result in unexpected behavior or lack of optimization. ↓
breaking Using the 'gap mode' (`-x` option) to support more than 65,535 glyph data in one TTC may cause compatibility issues with legacy software. This mode modifies how glyph data is stored. ↓
gotcha The hint wrapping feature (`-h` option) is automatically disabled when 'gap mode' (`-x`) is enabled. This means you cannot have both optimizations simultaneously. ↓
gotcha The tool relies on external `otfccdump` and `otfccbuild` executables. If these are not found in the system's PATH, or if the specified paths are incorrect, `otfcc-ttcize` will fail to execute. ↓
Install
npm install otfcc-ttcize yarn add otfcc-ttcize pnpm add otfcc-ttcize Quickstart
# First, ensure otfcc tools (otfccdump, otfccbuild) are installed and in your PATH.
# For example, install otfcc via npm globally if it's a wrapper, or directly from source.
# npm install -g otfcc # (If otfcc has a CLI npm package)
# Example: Bundle two TrueType fonts into a single TTC file.
# The output TTC will have shared glyph data where possible.
otfcc-ttcize -o output.ttc input1.ttf input2.ttf input3.ttf
# Example with gap mode for larger glyph sets and custom otfcc paths.
# Note: Gap mode (-x) disables hint wrapping (-h).
otfcc-ttcize \
-x \
--otfccdump-command="/opt/local/bin/otfccdump" \
--otfccbuild-command="/opt/local/bin/otfccbuild" \
-o large_output.ttc fontA.ttf fontB.ttf