# rizafulislam/fourier-name-drawing architecture

> Architecture diagram of the GitHub repository rizafulislam/fourier-name-drawing, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-04). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/rizafulislam/fourier-name-drawing
- Repository: https://github.com/rizafulislam/fourier-name-drawing

## Overview

fourier-name-drawing turns Bangla or English text into an animated epicycle drawing, with a Python API and CLI as entry points. The core workflow selects fonts, shapes glyphs into joined contours, computes a Fourier series, then renders frames for preview or encoded video/GIF output. The graph also preserves font acquisition and the notebook/demo-facing usage described in the README. Relationships are based on the shown source and README; no unsampled implementation links are asserted.

Main entry points: [`fourier_name/__init__.py`](https://github.com/rizafulislam/fourier-name-drawing/blob/main/fourier_name/__init__.py) (Python API), [`fourier_name/cli.py`](https://github.com/rizafulislam/fourier-name-drawing/blob/main/fourier_name/cli.py) (CLI), [`fourier_name/render.py`](https://github.com/rizafulislam/fourier-name-drawing/blob/main/fourier_name/render.py) (Video/GIF encoder), [`fourier_name/outlines.py`](https://github.com/rizafulislam/fourier-name-drawing/blob/main/fourier_name/outlines.py) (Text layout)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["User entry points"]
  node_cli["CLI<br/>[cli.py]"]
  node_api["Python API<br/>[__init__.py]"]
end

subgraph group_geometry["Text geometry"]
  node_shaping["Glyph shaping<br/>[outlines.py]"]
  node_layout["Text layout<br/>[outlines.py]"]
  node_contours["Contour joining<br/>[outlines.py]"]
end

subgraph group_signal["Fourier representation"]
  node_seriesbuild["Series construction<br/>[__init__.py]"]
  node_sampling["Path resampling<br/>[fourier.py]"]
  node_coefficients["FFT coefficients<br/>[fourier.py]"]
  node_series["Fourier series<br/>[fourier.py]"]
end

subgraph group_output["Rendering output"]
  node_renderer["Epicycle renderer<br/>[render.py]"]
  node_preview["PNG preview<br/>[cli.py]"]
  node_encoding["Video/GIF encoder<br/>[render.py]"]
end

subgraph group_assets["Font resources"]
  node_fontselect["Font selection<br/>[fonts.py]"]
  node_fontdownload["Font download/cache<br/>[fonts.py]"]
end

node_user(("Name author"))
node_ffmpeg["ffmpeg"]
node_result["Drawing output"]

node_user -->|"provides text"| node_cli
node_user -->|"provides text"| node_api
node_cli -->|"builds series"| node_api
node_api -->|"selects font"| node_fontselect
node_fontselect -->|"downloads fallback"| node_fontdownload
node_api -->|"lays out text"| node_layout
node_layout -->|"shapes glyphs"| node_shaping
node_layout -->|"joins contours"| node_contours
node_api -->|"constructs series"| node_seriesbuild
node_seriesbuild -->|"resamples path"| node_sampling
node_sampling -->|"feeds samples"| node_coefficients
node_coefficients -->|"creates series"| node_series
node_api -->|"creates renderer"| node_renderer
node_cli -->|"creates renderer"| node_renderer
node_renderer -->|"evaluates series"| node_series
node_cli -->|"saves final frame"| node_preview
node_api -->|"encodes animation"| node_encoding
node_cli -->|"encodes animation"| node_encoding
node_encoding -->|"streams frames"| node_ffmpeg
node_encoding -->|"writes MP4/GIF"| node_result
node_preview -->|"writes PNG"| node_result

click node_cli "https://github.com/rizafulislam/fourier-name-drawing/blob/main/fourier_name/cli.py"
click node_api "https://github.com/rizafulislam/fourier-name-drawing/blob/main/fourier_name/__init__.py"
click node_fontselect "https://github.com/rizafulislam/fourier-name-drawing/blob/main/fourier_name/fonts.py"
click node_fontdownload "https://github.com/rizafulislam/fourier-name-drawing/blob/main/fourier_name/fonts.py"
click node_shaping "https://github.com/rizafulislam/fourier-name-drawing/blob/main/fourier_name/outlines.py"
click node_layout "https://github.com/rizafulislam/fourier-name-drawing/blob/main/fourier_name/outlines.py"
click node_contours "https://github.com/rizafulislam/fourier-name-drawing/blob/main/fourier_name/outlines.py"
click node_seriesbuild "https://github.com/rizafulislam/fourier-name-drawing/blob/main/fourier_name/__init__.py"
click node_sampling "https://github.com/rizafulislam/fourier-name-drawing/blob/main/fourier_name/fourier.py"
click node_coefficients "https://github.com/rizafulislam/fourier-name-drawing/blob/main/fourier_name/fourier.py"
click node_series "https://github.com/rizafulislam/fourier-name-drawing/blob/main/fourier_name/fourier.py"
click node_renderer "https://github.com/rizafulislam/fourier-name-drawing/blob/main/fourier_name/render.py"
click node_preview "https://github.com/rizafulislam/fourier-name-drawing/blob/main/fourier_name/cli.py"
click node_encoding "https://github.com/rizafulislam/fourier-name-drawing/blob/main/fourier_name/render.py"

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_cli,node_api toneBlue
class node_shaping,node_layout,node_contours toneAmber
class node_seriesbuild,node_sampling,node_coefficients,node_series toneMint
class node_renderer,node_preview,node_encoding toneRose
class node_fontselect,node_fontdownload,node_user,node_ffmpeg,node_result toneIndigo
```

## Components

### User entry points

- [CLI](https://github.com/rizafulislam/fourier-name-drawing/blob/main/fourier_name/cli.py): `fourier_name/cli.py`
- [Python API](https://github.com/rizafulislam/fourier-name-drawing/blob/main/fourier_name/__init__.py): `fourier_name/__init__.py`

### Text geometry

- [Glyph shaping](https://github.com/rizafulislam/fourier-name-drawing/blob/main/fourier_name/outlines.py): `fourier_name/outlines.py`
- [Text layout](https://github.com/rizafulislam/fourier-name-drawing/blob/main/fourier_name/outlines.py): `fourier_name/outlines.py`
- [Contour joining](https://github.com/rizafulislam/fourier-name-drawing/blob/main/fourier_name/outlines.py): `fourier_name/outlines.py`

### Fourier representation

- [Series construction](https://github.com/rizafulislam/fourier-name-drawing/blob/main/fourier_name/__init__.py): `fourier_name/__init__.py`
- [Path resampling](https://github.com/rizafulislam/fourier-name-drawing/blob/main/fourier_name/fourier.py): `fourier_name/fourier.py`
- [FFT coefficients](https://github.com/rizafulislam/fourier-name-drawing/blob/main/fourier_name/fourier.py): `fourier_name/fourier.py`
- [Fourier series](https://github.com/rizafulislam/fourier-name-drawing/blob/main/fourier_name/fourier.py): `fourier_name/fourier.py`

### Rendering output

- [Epicycle renderer](https://github.com/rizafulislam/fourier-name-drawing/blob/main/fourier_name/render.py): `fourier_name/render.py`
- [PNG preview](https://github.com/rizafulislam/fourier-name-drawing/blob/main/fourier_name/cli.py): `fourier_name/cli.py`
- [Video/GIF encoder](https://github.com/rizafulislam/fourier-name-drawing/blob/main/fourier_name/render.py): `fourier_name/render.py`

### Font resources

- [Font selection](https://github.com/rizafulislam/fourier-name-drawing/blob/main/fourier_name/fonts.py): `fourier_name/fonts.py`
- [Font download/cache](https://github.com/rizafulislam/fourier-name-drawing/blob/main/fourier_name/fonts.py): `fourier_name/fonts.py`

### Other components

- **Name author**
- **ffmpeg**
- **Drawing output**

## Connections

- Name author → CLI: provides text (evidence: `README.md`)
- Name author → Python API: provides text (evidence: `README.md`)
- CLI → Python API: builds series (evidence: `fourier_name/cli.py`)
- Python API → Font selection: selects font (evidence: `fourier_name/__init__.py`)
- Font selection → Font download/cache: downloads fallback (evidence: `fourier_name/fonts.py`)
- Python API → Text layout: lays out text (evidence: `fourier_name/__init__.py`)
- Text layout → Glyph shaping: shapes glyphs (evidence: `fourier_name/outlines.py`)
- Text layout → Contour joining: joins contours (evidence: `fourier_name/__init__.py`)
- Python API → Series construction: constructs series (evidence: `fourier_name/__init__.py`)
- Series construction → Path resampling: resamples path (evidence: `fourier_name/fourier.py`)
- Path resampling → FFT coefficients: feeds samples (evidence: `fourier_name/fourier.py`)
- FFT coefficients → Fourier series: creates series (evidence: `fourier_name/fourier.py`)
- Python API → Epicycle renderer: creates renderer (evidence: `fourier_name/__init__.py`)
- CLI → Epicycle renderer: creates renderer (evidence: `fourier_name/cli.py`)
- Epicycle renderer → Fourier series: evaluates series (evidence: `fourier_name/render.py`)
- CLI → PNG preview: saves final frame (evidence: `fourier_name/cli.py`)
- Python API → Video/GIF encoder: encodes animation (evidence: `fourier_name/__init__.py`)
- CLI → Video/GIF encoder: encodes animation (evidence: `fourier_name/cli.py`)
- Video/GIF encoder → ffmpeg: streams frames (evidence: `fourier_name/render.py`)
- Video/GIF encoder → Drawing output: writes MP4/GIF (evidence: `fourier_name/render.py`)
- PNG preview → Drawing output: writes PNG (evidence: `fourier_name/cli.py`)
