# github/mona-sans architecture

> Architecture diagram of the GitHub repository github/mona-sans, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-31). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/github/mona-sans
- Repository: https://github.com/github/mona-sans

## Overview

##### Project type and purpose
- This is an open-source font project (“Mona Sans”), not a webapp or service. Its purpose is to store, build, and distribute a variable typeface with multiple weights, widths, italics, stylistic sets, and ligatures.

##### High-level file-structure analysis
- Top-level directories:
– .github → CI/workflow scripts
– fonts → generated font outputs (OTF, TTF, webfonts, variable fonts)
– sources → design source files (Glyphs.app package, glyph definitions, fontinfo.plist, order.plist, config.yaml)
- Scripts and config:
– build.sh → orchestrates the build process
– config.yaml → build configuration (axes, instances, features)
– requirements.txt → Python dependencies (e.g., fontmake, glyphsLib)
- Metadata & docs: README.md, LICENSE, CODE_OF_CONDUCT, SECURITY, etc.

##### README insights
- Describes usage (CSS @font-face, preload), variable-font axes (weight, width, slant), stylistic sets, ligatures

##### Components
a. Source block
– Glyphs source package (sources/MonaSans.glyphspackage/)
– Config files (fontinfo.plist, config.yaml, order.plist)
b. Build pipeline
– build.sh shell script
– Python build engine (fontmake + glyphsLib, invoked in build.sh)
– CI runner (GitHub Actions in .github/) triggering the build script
c. Outputs
– Generated fonts in fonts/otf, fonts/ttf, fonts/variable, fonts/webfonts
– Packaged release artifacts (zip bundles, GitHub Releases)
d. Distribution & integration
– GitHub Releases (artifact hosting)
– Typeface microsite (docs site)
– Consumer integration (web via @font-face CSS, design tools)

##### Relationships and data flow
- Loop from “.github Actions” → triggers “build.sh” on push or tag → publishes artifacts

##### Architectural patterns & design principles
- Pipeline pattern: clear separation of design source vs. generated artifacts
- Single-repository (monorepo) housing sources, build config, outputs, and docs
- Declarative config (config.yaml, order.plist) drives reproducible builds
- CI/CD integration for automated builds and releases

##### Technologies, frameworks, libraries
- Glyphs.app format (.glyphspackage) for design sources
- Python libraries: fontmake, glyphsLib (from requirements.txt)
- Shell scripting (build.sh)
- CI: GitHub Actions workflows (.github/)
- Output formats: OTF, TTF, WOFF2 (variable and static), webfonts

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Sources"
        source_pkg["Glyphs Sources\n(.glyphspackage)"]:::sources
        metadata["fontinfo.plist"]:::sources
        order["order.plist"]:::sources
        config["config.yaml"]:::sources
    end

    subgraph "Build Pipeline"
        ci["GitHub Actions\n(.github)"]:::ci
        buildsh["build.sh"]:::ci
        requirements["requirements.txt"]:::ci
        python["Python Engine\n(fontmake + glyphsLib)"]:::ci
    end

    subgraph "Outputs"
        otf["Static OTF Fonts"]:::outputs
        ttf["Static TTF Fonts"]:::outputs
        varf["Variable Fonts"]:::outputs
        webf["Webfonts (WOFF2, etc)"]:::outputs
    end

    subgraph "Distribution"
        releases["GitHub Releases"]:::dist
        microsite["Microsite (docs)"]:::dist
        users["End Users\n(Web, Print)"]:::dist
    end

    source_pkg -->|includes metadata & order| metadata
    source_pkg -->|includes metadata & order| order
    source_pkg -->|drives build| config
    metadata -->|drives build| buildsh
    order -->|drives build| buildsh
    config -->|drives build| buildsh

    ci -->|triggers| buildsh
    buildsh -->|runs| python
    requirements -->|libraries| python

    python -->|generate| otf
    python -->|generate| ttf
    python -->|generate| varf
    python -->|generate| webf

    otf -->|publish| releases
    ttf -->|publish| releases
    varf -->|publish| releases
    webf -->|publish| releases

    releases -->|host fonts| users
    releases -->|host docs| microsite

    %% Click Events
    click source_pkg "https://github.com/github/mona-sans/tree/main/sources/MonaSans.glyphspackage/"
    click metadata "https://github.com/github/mona-sans/blob/main/sources/MonaSans.glyphspackage/fontinfo.plist"
    click order "https://github.com/github/mona-sans/blob/main/sources/MonaSans.glyphspackage/order.plist"
    click config "https://github.com/github/mona-sans/blob/main/sources/config.yaml"
    click buildsh "https://github.com/github/mona-sans/blob/main/sources/build.sh"
    click requirements "https://github.com/github/mona-sans/blob/main/requirements.txt"
    click ci "https://github.com/github/mona-sans/tree/main/.github/"
    click otf "https://github.com/github/mona-sans/tree/main/fonts/otf/"
    click ttf "https://github.com/github/mona-sans/tree/main/fonts/ttf/"
    click varf "https://github.com/github/mona-sans/tree/main/fonts/variable/"
    click webf "https://github.com/github/mona-sans/tree/main/fonts/webfonts/"

    classDef sources fill:#a8e6a3,stroke:#333,stroke-width:1px
    classDef ci fill:#9ec1f7,stroke:#333,stroke-width:1px
    classDef outputs fill:#f7c986,stroke:#333,stroke-width:1px
    classDef dist fill:#d3d3d3,stroke:#333,stroke-width:1px
```
