Pangu.js is a mature, widely-adopted text spacing library that automatically inserts whitespace between CJK (Chinese/Japanese/Korean) and ANS (alphabetical, numerical, symbols) characters. It is the reference implementation of the 'Paranoid Text Spacing' philosophy, designed to improve readability of mixed-script text. The project is highly multi-platform: it ships as a zero-dependency npm library (ESM and CJS) for Node.js, a browser bundle (ESM and UMD), a CLI tool, and a full-featured Chrome browser extension ('ηΊδ»ιΊΌδ½ εε°±ζ―δΈθ½ε εη©Ίζ Όε’οΌ'). The extension extends the core rule-based spacing with an AI disambiguation system that uses Chrome's on-device Gemini Nano (Prompt API) to resolve ambiguous characters like hyphens and plus signs in real-time, entirely offline. Architecturally, the codebase is exceptionally well-structured. The core spacing engine in `src/shared/index.ts` uses a `Pangu` base class pattern with `PlaceholderReplacer` to protect URLs, HTML tags, and other constructs from accidental spacing. The browser module adds a `BrowserPangu` subclass with a sophisticated DOM traversal system (`DomWalker`, `VisibilityDetector`, `TaskScheduler`) that applies spacing to live pages with minimal performance impact. The Chrome extension is cleanly separated into content script, service worker, popup, and options pages, with AI spacing modeled as a set of `AmbiguousShape` classes each with their own prompt engineering. A notable hybrid aspect is the rigorous research-like methodology for the AI spacing feature. The repository includes a full prompt experiment infrastructure in `scripts/prompt-experiments/`, with frozen corpora, paired-gate evaluation, round reports, and a script runner that replays production routing. This gives the project a data-driven, scientific character alongside its software engineering nature. The 30+ ADRs in `docs/adr/` document every significant contract decision with rationale, alternatives, and consequences, making this a model for architectural governance.
Typo.css is a mature, single-file CSS library that provides a comprehensive reset and typography system optimized for Chinese (CJK) web content. It normalizes browser defaults and exposes a `.typo` class container that applies advanced typographic features: CJK-optimized font stacks (sans, serif, mono, kai, fangsong) via CSS custom properties, proper line-height, line-break strictness, Han-Western spacing via `text-autospace`, punctuation trimming via `text-spacing-trim`, hanging punctuation, native emphasis marks with fallback, ruby annotation support, vertical writing mode helper, and readable line-length constraints. The library is dependency-free, uses progressive enhancement (e.g., `@supports` for native emphasis and script-specific generics), and includes a suite of modifier classes for common typographic needs. A comprehensive test suite (Node.js assertion-based) verifies the CSS contract, and detailed documentation explains the design rationale based on W3C CLReq and other standards. The demo page demonstrates real-world usage with SEO metadata. This is a production-ready library for any project requiring high-quality Chinese text rendering, and it is actively maintained with modern CSS best practices.
mPDF is a mature PHP library that generates PDF documents from UTF-8 encoded HTML content. It is not a standalone application but a dependency used within PHP projects (e.g., Laravel, Symfony) via Composer. The library parses HTML and CSS, handles complex typography (including bidirectional text, Indic and Myanmar scripts, hyphenation), and produces PDF output with support for barcodes, watermarks, forms, table of contents, PDF/A compliance, and encryption. The architecture follows a service-oriented pattern: the central `Mpdf` class orchestrates a set of specialized services (CSS parser, color converter, size converter, image processor, tag handlers, writers) assembled by a `ServiceFactory`. HTML tags are mapped to handler classes in `src/Tag/` that extend `BlockTag`, `InlineTag`, or `SubstituteTag`. PDF output is built by writer classes in `src/Writer/` that write raw PDF objects via a `BaseWriter`. External dependencies include FPDI for PDF import, PSR-3 logging, PSR-7 HTTP messages, and the `myclabs/deep-copy` library for table of contents page numbering. The library is extensively tested with over 200 unit tests and snapshot tests that compare generated PDFs against stored references.
This repository provides Chinese input method addons for the Fcitx5 input method framework. It implements Pinyin (including Shuangpin, fuzzy pinyin, stroke filtering, cloud pinyin, prediction) and table-based input methods (Wubi, Cangjie, Erbi, etc.) as Fcitx5 modules. The architecture follows a plugin/addon pattern, with engines handling key events, candidate generation, and text commit. Supporting modules handle punctuation, fullwidth characters, simplified/traditional Chinese conversion (via OpenCC), cloud pinyin (with pluggable backends like Google and Baidu), and pinyin helper (stroke lookup). GUI tools for custom phrase editing and dictionary management are included. The codebase is well-structured, uses modern C++17, and integrates tightly with Fcitx5's event and configuration systems. External dependencies include libime, Qt6 (for GUI), OpenCC, curl, nlohmann_json, and optionally Lua. The project is actively maintained with a comprehensive test suite.
This repository implements a font synthesis pipeline that merges BIZ UD Gothic (Japanese) with JetBrains Mono (Latin) to produce the UDEV Gothic family of programming fonts. The build process ingests source .ttf and .sfd files, uses FontForge for glyph preprocessing (size adjustment, duplicate handling, Nerd Font integration) and fonttools for hinting, merging, and table patching (OS/2, post, cmap with IVS). It generates 16+ variants with configurable width ratios, ligatures, and symbol sets via a config-driven, parallel build system (PowerShell on Windows, shell scripts on Linux). While primarily a font engineering pipeline, its well-structured Python scripts and configuration approach offer reusable patterns for similar font merging projects. The source fonts and dependencies are included, but cross-platform reproducibility is limited by hardcoded paths and lack of containerization.
This repository contains the build infrastructure and metadata for the LXGW WenKai (ιιΉζζ₯·) open-source Chinese font family. The actual font source data (UFO files) is stored in a separate submodule; this repo provides the build pipeline, font metadata (fontinfo.plist), OpenType feature files, CI/CD workflows, and release packaging. The build process uses Python tools (fontmake, gftools, ufomerge) to merge source UFOs, apply font metadata, and produce TTF fonts in three weights (Light, Regular, Medium) and two variants (proportional and monospaced). The repository does not contain application code or data analysis; it is a font development and distribution project. The architecture is a build pipeline orchestrated by a Makefile and shell scripts, with GitHub Actions workflows for automated building on pushes to source files, version bumping via repository dispatch, and release packaging when a GitHub Release is published. The key entry points are `make build` for local builds and the CI workflows for automated builds. External dependencies include Python 3, fontmake, fontbakery, gftools, ufomerge, and ttfautohint. The font itself is derived from Fontworks' Klee One and supports a wide range of CJK characters, Latin, Greek, Cyrillic, and other scripts. The codebase is well-structured for its purpose: the build script is clean, the CI workflows are comprehensive (including caching, conditional steps, and artifact archiving), and the metadata files are meticulously maintained. However, the repository is tightly coupled to the specific font project and its submodule structure, offering limited reusability for other projects. The font quality is high, but the code (build infrastructure) is functional and unremarkable, with no standout reusable components.