# tonsky/firacode architecture

> Architecture diagram of the GitHub repository tonsky/firacode, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-09). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/tonsky/firacode
- Repository: https://github.com/tonsky/firacode

## Overview

Fira Code is a monospaced programming font whose OpenType features render multi-character code sequences as ligatures while leaving source text unchanged. The repository includes a Glyphs-source font and a Clojure generator: it loads the font, derives ligature sequences, updates feature and glyph data, checks widths, and saves the result. The README also documents stylistic sets, character variants, console and box-drawing coverage, progress-bar glyphs, and broad Unicode support. Generator call paths are visible in main.clj; other capability links are documented in the README.

Main entry points: [`clojure/fira_code/main.clj`](https://github.com/tonsky/firacode/blob/master/clojure/fira_code/main.clj) (Generator entry), [`FiraCode.glyphs`](https://github.com/tonsky/firacode/blob/master/FiraCode.glyphs) (Glyphs source), [`clojure/fira_code/features.clj`](https://github.com/tonsky/firacode/blob/master/clojure/fira_code/features.clj) (Feature assembly), [`clojure/fira_code/glyphs.clj`](https://github.com/tonsky/firacode/blob/master/clojure/fira_code/glyphs.clj) (Glyph parser and writer)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_font["Font design"]
  node_glyph_source["Glyphs source<br/>[FiraCode.glyphs]"]
  node_font_output["Generated font"]
end

subgraph group_generation["Font generation"]
  node_generator["Generator entry<br/>[main.clj]"]
  node_glyph_io["Glyph parser and writer<br/>[glyphs.clj]"]
  node_calt_gen["Ligature generation<br/>[calt.clj]"]
  node_classes["Glyph classes<br/>[classes.clj]"]
  node_feature_gen["Feature assembly<br/>[features.clj]"]
  node_spacers["Spacer glyphs<br/>[spacers.clj]"]
  node_not_space["Non-space data<br/>[not_space.clj]"]
  node_width_checks["Width checks<br/>[checks.clj]"]
end

subgraph group_features["OpenType features"]
  node_feature_assets["Feature definitions"]
  node_calt_assets["Ligature patterns"]
  node_variant_assets["Style variants"]
end

subgraph group_glyphs["Glyph capabilities"]
  node_punctuation["Punctuation tuning<br/>[FiraCode.glyphs]"]
  node_unicode["Unicode coverage<br/>[FiraCode.glyphs]"]
  node_console["Console glyphs<br/>[FiraCode.glyphs]"]
  node_progress["Progress glyphs"]
end

node_designer(("Font maintainer"))

node_designer -->|"runs"| node_generator
node_glyph_source -->|"provides input"| node_generator
node_generator -->|"loads and saves"| node_glyph_io
node_generator -->|"generates ligatures"| node_calt_gen
node_generator -->|"fills classes"| node_classes
node_generator -->|"fills features"| node_feature_gen
node_generator -->|"adds spacers"| node_spacers
node_generator -->|"regenerates data"| node_not_space
node_generator -->|"checks widths"| node_width_checks
node_feature_gen -->|"appends definitions"| node_calt_assets
node_feature_gen -->|"loads definitions"| node_feature_assets
node_feature_assets -->|"includes variants"| node_variant_assets
node_glyph_io -->|"writes font data"| node_font_output
node_glyph_source -->|"contains tuning"| node_punctuation
node_glyph_source -->|"provides coverage"| node_unicode
node_glyph_source -->|"provides glyphs"| node_console
node_glyph_source -->|"provides glyphs"| node_progress

click node_glyph_source "https://github.com/tonsky/firacode/blob/master/FiraCode.glyphs"
click node_generator "https://github.com/tonsky/firacode/blob/master/clojure/fira_code/main.clj"
click node_glyph_io "https://github.com/tonsky/firacode/blob/master/clojure/fira_code/glyphs.clj"
click node_calt_gen "https://github.com/tonsky/firacode/blob/master/clojure/fira_code/calt.clj"
click node_classes "https://github.com/tonsky/firacode/blob/master/clojure/fira_code/classes.clj"
click node_feature_gen "https://github.com/tonsky/firacode/blob/master/clojure/fira_code/features.clj"
click node_spacers "https://github.com/tonsky/firacode/blob/master/clojure/fira_code/spacers.clj"
click node_not_space "https://github.com/tonsky/firacode/blob/master/clojure/fira_code/not_space.clj"
click node_width_checks "https://github.com/tonsky/firacode/blob/master/clojure/fira_code/checks.clj"
click node_feature_assets "https://github.com/tonsky/firacode/tree/master/features"
click node_calt_assets "https://github.com/tonsky/firacode/tree/master/features/calt"
click node_variant_assets "https://github.com/tonsky/firacode/tree/master/features"
click node_punctuation "https://github.com/tonsky/firacode/blob/master/FiraCode.glyphs"
click node_unicode "https://github.com/tonsky/firacode/blob/master/FiraCode.glyphs"
click node_console "https://github.com/tonsky/firacode/blob/master/FiraCode.glyphs"
click node_progress "https://github.com/tonsky/firacode/tree/master/clojure/fira_code"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_glyph_source,node_font_output toneBlue
class node_generator,node_glyph_io,node_calt_gen,node_classes,node_feature_gen,node_spacers,node_not_space,node_width_checks toneAmber
class node_feature_assets,node_calt_assets,node_variant_assets toneMint
class node_punctuation,node_unicode,node_console,node_progress toneRose
class node_designer toneIndigo
```

## Components

### Font design

- [Glyphs source](https://github.com/tonsky/firacode/blob/master/FiraCode.glyphs): `FiraCode.glyphs`
- **Generated font**

### Font generation

- [Generator entry](https://github.com/tonsky/firacode/blob/master/clojure/fira_code/main.clj): `clojure/fira_code/main.clj`
- [Glyph parser and writer](https://github.com/tonsky/firacode/blob/master/clojure/fira_code/glyphs.clj): `clojure/fira_code/glyphs.clj`
- [Ligature generation](https://github.com/tonsky/firacode/blob/master/clojure/fira_code/calt.clj): `clojure/fira_code/calt.clj`
- [Glyph classes](https://github.com/tonsky/firacode/blob/master/clojure/fira_code/classes.clj): `clojure/fira_code/classes.clj`
- [Feature assembly](https://github.com/tonsky/firacode/blob/master/clojure/fira_code/features.clj): `clojure/fira_code/features.clj`
- [Spacer glyphs](https://github.com/tonsky/firacode/blob/master/clojure/fira_code/spacers.clj): `clojure/fira_code/spacers.clj`
- [Non-space data](https://github.com/tonsky/firacode/blob/master/clojure/fira_code/not_space.clj): `clojure/fira_code/not_space.clj`
- [Width checks](https://github.com/tonsky/firacode/blob/master/clojure/fira_code/checks.clj): `clojure/fira_code/checks.clj`

### OpenType features

- [Feature definitions](https://github.com/tonsky/firacode/tree/master/features): `features`
- [Ligature patterns](https://github.com/tonsky/firacode/tree/master/features/calt): `features/calt`
- [Style variants](https://github.com/tonsky/firacode/tree/master/features): `features`

### Glyph capabilities

- [Punctuation tuning](https://github.com/tonsky/firacode/blob/master/FiraCode.glyphs): `FiraCode.glyphs`
- [Unicode coverage](https://github.com/tonsky/firacode/blob/master/FiraCode.glyphs): `FiraCode.glyphs`
- [Console glyphs](https://github.com/tonsky/firacode/blob/master/FiraCode.glyphs): `FiraCode.glyphs`
- [Progress glyphs](https://github.com/tonsky/firacode/tree/master/clojure/fira_code): `clojure/fira_code`

### Other components

- **Font maintainer**

## Connections

- Font maintainer → Generator entry: runs
- Glyphs source → Generator entry: provides input (evidence: `clojure/fira_code/main.clj`)
- Generator entry → Glyph parser and writer: loads and saves (evidence: `clojure/fira_code/main.clj`)
- Generator entry → Ligature generation: generates ligatures (evidence: `clojure/fira_code/main.clj`)
- Generator entry → Glyph classes: fills classes (evidence: `clojure/fira_code/main.clj`)
- Generator entry → Feature assembly: fills features (evidence: `clojure/fira_code/main.clj`)
- Generator entry → Spacer glyphs: adds spacers (evidence: `clojure/fira_code/main.clj`)
- Generator entry → Non-space data: regenerates data (evidence: `clojure/fira_code/main.clj`)
- Generator entry → Width checks: checks widths (evidence: `clojure/fira_code/main.clj`)
- Feature assembly → Ligature patterns: appends definitions (evidence: `clojure/fira_code/features.clj`)
- Feature assembly → Feature definitions: loads definitions (evidence: `clojure/fira_code/features.clj`)
- Feature definitions → Style variants: includes variants (evidence: `README.md`)
- Glyph parser and writer → Generated font: writes font data
- Glyphs source → Punctuation tuning: contains tuning (evidence: `README.md`)
- Glyphs source → Unicode coverage: provides coverage (evidence: `README.md`)
- Glyphs source → Console glyphs: provides glyphs (evidence: `README.md`)
- Glyphs source → Progress glyphs: provides glyphs (evidence: `README.md`)
