Welcome to AFIO
Relevant source files
The following files were used as context for generating this wiki page:
AFIO is a specialized distribution and build system for a custom-configured Iosevka font integrated with Nerd Font icons. It addresses the limitation of standard Nerd Font releases by providing a framework to generate fonts with specific glyph variants, weight tuning, and width control while incorporating over 9000 Nerd Font icons.
The project serves two primary functions: a ready-to-use font release for end-users and a template-based build system for developers to generate their own custom Iosevka Nerd Font variations using GitHub Actions or local Docker environments.
Sources: README.md:1-20
Architecture and Build Pipeline
The AFIO build system orchestrates several stages, moving from raw font generation to icon patching and final packaging. The process is primarily driven by a Docker-based environment to ensure consistency across different platforms.
Build Workflow Logic
- Iosevka Compilation: The system uses
bunto run the Iosevka build process, targeting TTF output based on a specified build plan. - Nerd Font Patching: A Python script iterates through the generated TTF files to inject Nerd Font glyphs using the
font-patcherutility. - Packaging: The patched fonts are compressed into a ZIP archive for distribution.
The diagram shows the transition from configuration to final asset generation.
Sources: build.sh:42-51, src/nerd-patcher.py:44-63
Configuration and Customization
The font's appearance is defined in private-build-plans.toml. This file controls the specific character shapes (variants), weights, and widths used during the Iosevka build phase.
Design Variants
AFIO utilizes a highly specific set of design variants to distinguish its aesthetic from the default Iosevka configuration:
| Character | Variant Name | Description |
|---|---|---|
f | flat-hook-serifless | Flat hook with no serifs |
i | serifed-asymmetric | Asymmetric serifs |
l | serifed-semi-tailed | Semi-tailed with serifs |
0 | dotted | Dotted zero |
* | hex-low | Hexagonal low-set asterisk |
@ | fourfold-solid-inner-tall | Tall solid inner structure |
Sources: README.md:37-45, private-build-plans.toml:8-20
Weight and Width Scaling
AFIO defines four primary weights, mapping internal shape grades to standard CSS weight values.
| Name | Shape Grade | CSS/Menu Weight |
|---|---|---|
| Light | 200 | 300 |
| Regular | 300 | 400 |
| Medium | 400 | 500 |
| Bold | 500 | 700 |
The font uses a term spacing and sans serifs, with a specific glyph shape width of 540.
Sources: private-build-plans.toml:39-57, private-build-plans.toml:79-82
Patching and Glyph Integration
The system integrates thousands of icons by downloading glyph sets and applying them to the compiled Iosevka base.
Glyph Sources
The script nerd/download_glyphs.sh fetches various icon sets including:
- Codicons, Devicons, and Font Awesome
- Material Design Icons
- Octicons, Pomicons, and Powerline Symbols
Sources: nerd/download_glyphs.sh:10-25
Patching Process
The src/nerd-patcher.py script manages the parallel execution of the font-patcher. It uses a process pool to handle multiple font weights simultaneously.
The sequence diagram illustrates how the system parallelizes the patching of different font weights.
Sources: src/nerd-patcher.py:12-40
Distribution and Showcase
Once built, AFIO is distributed via GitHub Releases and accessible through a Homebrew tap for macOS users.
Homebrew Integration
The homebrew/update-tap.sh script automates the update of the Homebrew cask by:
- Downloading the latest release asset.
- Calculating the SHA256 checksum.
- Updating the
font-afio.rbcask definition from a template.
Sources: homebrew/update-tap.sh:15-39, homebrew/font-afio.template.rb:1-13
Showcase Generation
To visualize the font, src/generate_showcase_matrix.py creates SVG and PNG matrixes of code samples. It dynamically injects theme colors (Dark/Light) and font weights into an SVG template, then renders them using librsvg within a Docker container to ensure consistent rendering.
Sources: src/generate_showcase_matrix.py:121-143
Summary
AFIO is a sophisticated build pipeline for creating a highly customized version of Iosevka with Nerd Font icons. By leveraging Docker and automated scripts for patching, showcase generation, and package management, it provides a robust infrastructure for both maintaining the AFIO font and enabling users to fork and generate their own custom typography.