The Center
CodexMono is The Brick - the fundamental unit that enables Monokinetics: unified Human + AI experience through predictable, trustable visual alignment.Rendering Pipeline
Copy
+-----------------------------------------------------------------------------+
| MONOLEX TERMINAL RENDERING PIPELINE |
+-----------------------------------------------------------------------------+
| |
| +-----------------------------------------------------------------------+ |
| | PTY Daemon (Rust) | |
| | Raw byte stream --- No interpretation --- Unix socket | |
| +------------------------------------+----------------------------------+ |
| | |
| v |
| +-----------------------------------------------------------------------+ |
| | Alacritty VTE Parser (Rust) | |
| | - Unicode width detection | |
| | - CJK characters flagged as wide (width=2) | |
| | - Spacer cells for wide character placeholders | |
| +------------------------------------+----------------------------------+ |
| | |
| v |
| +-----------------------------------------------------------------------+ |
| | Cell Converter | |
| | Alacritty Cell ----> xterm.js Cell (width pre-encoded) | |
| +------------------------------------+----------------------------------+ |
| | |
| v |
| +-----------------------------------------------------------------------+ |
| | Tauri emit() to Frontend | |
| | JSON payload with pre-calculated widths | |
| +------------------------------------+----------------------------------+ |
| | |
| v |
| +-----------------------------------------------------------------------+ |
| | Direct Buffer Injection | |
| | No intermediate parsing --- Maximum performance | |
| +------------------------------------+----------------------------------+ |
| | |
| v |
| +-----------------------------------------------------------------------+ |
| | xterm.js Buffer + WebGL Renderer | |
| | CodexMono font --- 600 units per cell --- Perfect alignment | |
| +-----------------------------------------------------------------------+ |
| |
+------------------------------------------------------------------------------+
The No-Fallback Philosophy
Copy
+-----------------------------------------------------------------------------+
| THE NO-FALLBACK PHILOSOPHY |
+-----------------------------------------------------------------------------+
| |
| +-----------------------------+ +-----------------------------+ |
| | WITH FALLBACK (BROKEN) | | WITHOUT FALLBACK (TRUST) | |
| +-----------------------------+ +-----------------------------+ |
| | | | | |
| | Font A: "x = " | | CodexMono: "x = SIGMA y" | |
| | Font B: "SIGMA" (wrong!) | | All 600 units | |
| | Font A: " y" | | Perfect align | |
| | | | | |
| | Result: x = SIGMA y | | Result: x = SIGMA y | |
| | ^^^^^ | | ^^^^^^^^^^^^ | |
| | MISALIGNED | | ALIGNED | |
| +-----------------------------+ +-----------------------------+ |
| |
+-----------------------------------------------------------------------------+
The Trust Equation
Copy
Completeness
|
v
No Fallback
|
v
Consistent Width
|
v
Perfect Alignment
|
v
Visual Trust
|
v
Shared Understanding
|
v
MONOKINETICS
Character Coverage
Copy
+-----------------------------------------------------------------------------+
| CHARACTER COVERAGE BY CATEGORY |
+-----------------------------------------------------------------------------+
| |
| Category 1: Base Latin (inherited from JetBrains Mono) |
| +-----------------------------------------------------------------------+ |
| | A-Z, a-z, 0-9, punctuation ----------> Fallback Risk: NONE | |
| +-----------------------------------------------------------------------+ |
| |
| Category 2: Mathematical Notation (CodexMono added) |
| +-----------------------------------------------------------------------+ |
| | Subscripts: a e o x h k l m n p s t i r u v j | |
| | Superscripts: 0 1 2 3 4 5 6 7 8 9 + - = ( ) i j m n | |
| | ------------------------------------------------> Fallback Risk: NONE| |
| +-----------------------------------------------------------------------+ |
| |
| Category 3: Database Operators (CodexMono added) |
| +-----------------------------------------------------------------------+ |
| | bowtie (natural join) ltimes (left semijoin) rtimes (right) | |
| | ------------------------------------------------> Fallback Risk: NONE| |
| +-----------------------------------------------------------------------+ |
| |
| Category 4: CJK (CodexMono-KR/EA variants) |
| +-----------------------------------------------------------------------+ |
| | Korean Hangul: 11,428 | Chinese Hanzi: 8,231 | Japanese Kana: 189 | |
| | ------------------------------------------------> Fallback Risk: NONE| |
| +-----------------------------------------------------------------------+ |
| |
+------------------------------------------------------------------------------+
The Five Alignment Rules
Copy
+-----------------------------------------------------------------------------+
| THE FIVE ALIGNMENT RULES |
+-----------------------------------------------------------------------------+
| |
| RULE 1: Box Width Consistency |
| +-----------------------------------------------------------------------+ |
| | All lines within a box must have the same visual width | |
| +-----------------------------------------------------------------------+ |
| |
| RULE 2: Missing Inner Border Detection |
| +-----------------------------------------------------------------------+ |
| | Inner box closing characters must be present | |
| +-----------------------------------------------------------------------+ |
| |
| RULE 3: Inner Position Consistency |
| +-----------------------------------------------------------------------+ |
| | Double-line border positions must be consistent across all lines | |
| +-----------------------------------------------------------------------+ |
| |
| RULE 4: Inner Border Width |
| +-----------------------------------------------------------------------+ |
| | Top and bottom borders of inner boxes must match in width | |
| +-----------------------------------------------------------------------+ |
| |
| RULE 5: Flow Diagram Recognition |
| +-----------------------------------------------------------------------+ |
| | Flow lines are NOT inner box issues - mark as false positive | |
| +-----------------------------------------------------------------------+ |
| |
+------------------------------------------------------------------------------+
Width Calculation Flow
Copy
+-----------------------------------------------------------------------------+
| VISUAL WIDTH ALGORITHM |
+-----------------------------------------------------------------------------+
| |
| START: width = 0 |
| | |
| v |
| +---------------+ |
| | Get character | |
| +-------+-------+ |
| | |
| v |
| +------------------------+ |
| | Control character? |----YES----> width += 0, continue |
| | (code < 32) | |
| +-----------+------------+ |
| | NO |
| v |
| +------------------------+ |
| | ASCII? |----YES----> width += 1, continue |
| | (code < 127) | (FAST PATH) |
| +-----------+------------+ |
| | NO |
| v |
| +------------------------+ |
| | Combining mark? |----YES----> width += 0, continue |
| | (diacritics) | (Zero-width) |
| +-----------+------------+ |
| | NO |
| v |
| +------------------------+ |
| | Wide character? |----YES----> width += 2, continue |
| | (CJK, emoji) | (Double-width) |
| +-----------+------------+ |
| | NO |
| v |
| +---------------+ |
| | width += 1 | |
| | (Default) | |
| +---------------+ |
| |
| RETURN width |
| |
+------------------------------------------------------------------------------+
Width Categories
Copy
+-----------------------------------------------------------------------------+
| WIDTH TABLE SUMMARY |
+-----------------------------------------------------------------------------+
| |
| Zero-Width (Combining Marks) |
| +-----------------------------------------------------------------------+ |
| | - Diacritical Marks (accents, umlauts) | |
| | - Hebrew combining marks | |
| | - Zero-width spaces (ZWSP, ZWNJ, ZWJ) | |
| | - Variation Selectors | |
| +-----------------------------------------------------------------------+ |
| |
| Single-Width (1 cell) |
| +-----------------------------------------------------------------------+ |
| | - ASCII characters (A-Z, a-z, 0-9, symbols) | |
| | - Latin extended | |
| | - Most Unicode symbols | |
| +-----------------------------------------------------------------------+ |
| |
| Double-Width (2 cells) |
| +-----------------------------------------------------------------------+ |
| | - Hangul Jamo | |
| | - Hiragana + Katakana | |
| | - CJK Unified Ideographs (~22,000 chars) | |
| | - Hangul Syllables (~11,000 chars) | |
| | - Fullwidth ASCII | |
| | - Emoji and pictographs | |
| +-----------------------------------------------------------------------+ |
| |
+------------------------------------------------------------------------------+
Width Consistency Chain
Copy
+-----------------------------------------------------------------------------+
| WIDTH CONSISTENCY CHAIN |
+-----------------------------------------------------------------------------+
| |
| Stage 1: Document Creation |
| +-----------------------------------------------------------------------+ |
| | Calculate visual width using Unicode tables | |
| +------------------------------------+----------------------------------+ |
| | |
| Same tables as xterm.js |
| | |
| v |
| Stage 2: Alacritty VTE Parsing |
| +-----------------------------------------------------------------------+ |
| | Detect width using unicode_width crate | |
| +------------------------------------+----------------------------------+ |
| | |
| Width encoded in cell data |
| | |
| v |
| Stage 3: xterm.js Rendering |
| +-----------------------------------------------------------------------+ |
| | Apply width from pre-calculated data | |
| +------------------------------------+----------------------------------+ |
| | |
| Consistent = proper alignment |
| | |
| v |
| Stage 4: CodexMono Font Rendering |
| +-----------------------------------------------------------------------+ |
| | CJK glyphs: 1200 units = 2 cells | |
| | ASCII glyphs: 600 units = 1 cell | |
| | Monospace alignment maintained | |
| +-----------------------------------------------------------------------+ |
| |
| RESULT: ASCII boxes align perfectly! |
| |
+------------------------------------------------------------------------------+
Wide Character Handling
Copy
+-----------------------------------------------------------------------------+
| WIDE CHARACTER HANDLING |
+-----------------------------------------------------------------------------+
| |
| Input: "A" + CJK character |
| |
| Step 1: Parse 'A' |
| +---------------------------+ |
| | Cell { | |
| | character: 'A', | |
| | width: 1 | |
| | } | |
| +---------------------------+ |
| |
| Step 2: Parse CJK - width detected as 2 |
| +---------------------------+ +---------------------------+ |
| | Cell { | | Cell { | |
| | character: CJK, | | character: ' ', | |
| | width: 2 | | width: 0 (spacer) | |
| | flag: WIDE_CHAR | | flag: WIDE_CHAR_SPACER | |
| | } | | } | |
| +---------------------------+ +---------------------------+ |
| Primary cell Spacer cell |
| (content here) (placeholder) |
| |
| Result: 3 cells total |
| +-----+-------------+-------+ |
| | 'A' | CJK | spacer| |
| | w=1 | w=2 | w=0 | |
| +-----+-------------+-------+ |
| col:0 col:1 col:2 |
| |
+------------------------------------------------------------------------------+
Font Configuration
Copy
+-----------------------------------------------------------------------------+
| FONT STACK CONFIGURATION |
+-----------------------------------------------------------------------------+
| |
| Priority Order: |
| +----------+------------------+---------+----------+ |
| | Priority | Font Name | Type | Size | |
| +----------+------------------+---------+----------+ |
| | 1 (best) | CodexMono Simple | Static | 581KB | |
| | 2 | CodexMono | Variable| 299KB | |
| | 3 | Consolas | System | System | |
| | 4 | Monaco | System | System | |
| | 5 (worst)| monospace | Generic | System | |
| +----------+------------------+---------+----------+ |
| |
| WHY NO FONT PICKER: |
| +-----------------------------------------------------------------------+ |
| | Traditional: User picks font that breaks alignment | |
| | Monolex: CodexMono IS the font - Only size adjustable | |
| | | |
| | Benefits: | |
| | - Perfect alignment guaranteed | |
| | - AI output works as intended | |
| | - Zero font-related support issues | |
| | - "It just works" | |
| +-----------------------------------------------------------------------+ |
| |
+------------------------------------------------------------------------------+
The Brick: 600 Units
Copy
+-----------------------------------------------------------------------------+
| CODEXMONO FONT METRICS |
+-----------------------------------------------------------------------------+
| |
| THE BRICK = 600 units |
| |
| +------------------+-------------+------------------------------------+ |
| | Metric | Value | Notes | |
| +------------------+-------------+------------------------------------+ |
| | Units per EM | 1000 | Standard TrueType | |
| | Narrow Width | 600 units | THE BRICK | |
| | Wide Width | 1200 units | CJK (2x THE BRICK) | |
| | Ascender | 800 units | Above baseline | |
| | Descender | 200 units | Below baseline | |
| +------------------+-------------+------------------------------------+ |
| |
| PIXEL CALCULATIONS: |
| +-------+-----------+------------+----------------------------------+ |
| | Size | Cell Width| Cell Height| Use Case | |
| +-------+-----------+------------+----------------------------------+ |
| | 12px | 7.2px | 14.4px | Dense display | |
| | 14px | 8.4px | 16.8px | DEFAULT - balanced | |
| | 16px | 9.6px | 19.2px | Comfortable reading | |
| | 18px | 10.8px | 21.6px | Large display | |
| | 20px | 12.0px | 24.0px | Accessibility | |
| +-------+-----------+------------+----------------------------------+ |
| |
| Changing font size does NOT break alignment! |
| The 600:1200 ratio is preserved at any size. |
| |
+------------------------------------------------------------------------------+
The Trust Contract
Copy
+-----------------------------------------------------------------------------+
| HUMAN + AI = SAME VISUAL REALITY |
+-----------------------------------------------------------------------------+
| |
| TRADITIONAL: |
| +-------------------+ +-------------------+ |
| | Human sees: | | AI sees: | |
| | Visual pixels | | Parsed text | |
| | (rendered font) | | (UTF-8 bytes) | |
| +---------+---------+ +---------+---------+ |
| | | |
| +----------+ +---------+------+ |
| v v |
| MISMATCH! |
| |
| MONOKINETICS: |
| +-------------------+ +-------------------+ |
| | Human sees: | === | AI sees: | |
| | Atomic Frame | | Atomic Frame | |
| | (CodexMono grid) | | (same cell data) | |
| +---------+---------+ +---------+---------+ |
| | | |
| +----------+ +---------+------+ |
| v v |
| IDENTICAL! |
| |
| Both see: |
| - Same character at same position |
| - Same width for every character |
| - Same alignment, same structure |
| - Trust established through CodexMono |
| |
+------------------------------------------------------------------------------+