Repository navigation
Unicode Fonts and Legacy Indic
SIDHARTH SINGH edited this page Dec 3, 2026
·
1 revision
Indian multilingual billing, regional municipal portals, and Arabic RTL layouts often break silently on headless Linux containers where system fonts only ship basic Latin glyphs.
ONEX bundles 7 SIL Open Font License Noto TTF files:
-
NotoSans-Regular.ttf/NotoSans-Bold.ttf -
NotoSansDevanagari-Regular.ttf/NotoSansDevanagari-Bold.ttf NotoSansBengali-Regular.ttfNotoSansTamil-Regular.ttfNotoSansArabic-Regular.ttf
Notice two intentional optimizations in src/fonts/runtime-fonts.ts:
-
Three-stage scan before injecting: Raw HTML, live DOM
innerText, and post-image layout text are inspected so pure English/Latin documents never pay base64 font CSS overhead. -
Scoped
ONEX Rupee(U+20B9): Registers Noto Sans under alias'ONEX Rupee'strictly on unicode-rangeU+20B9, placing Noto Latin only at the bottom tail of computed stacks. ExistingGeorgia,Arial, or corporate fonts stay intact while₹always renders crisply. Arabic content automatically receivesdir="auto"andunicode-bidi: plaintext.
Old government databases frequently store Hindi inside legacy 8-bit font encodings (Kruti Dev 010 or Chanakya) where half-glyphs and short i matras (ि) were typed visually out of order.
-
krutiDevToUnicode()&chanakyaToUnicode()run greedy longest-match substitution (104 and 56 pairs) followed by PUA sentinel reordering (reorderDevanagariVisualMarks) across halant conjunct chains and NFC normalization. -
normalizeLegacyIndicHtml()maintains an HTML tag font-family stack, converts only legacy font spans while sparing<script>/<style>, and switches font stacks over toNoto Sans Devanagari. - On render,
convertLegacyFontsdefaults to'auto', making 20-year-old Kruti Dev templates immediately searchable in modern PDF readers without touching legacy source tables.
- Home
- Architecture & Render Pipeline
- PDF Internals & Extraction
- Unicode 16, Fonts & Legacy Indic
- Security & SSRF Model
- Digital Signing (
signPdf) - True Redaction (
redactPdf) - Semantic Diff & Redlines (
diffPdfs) - Self-Auditing Renders (
renderVerified) - PDF/A-3b & E-Invoices (
renderEInvoice) - HTTP, MCP, CLI & Puppeteer
Handbook & Deep Analysis: bahubalisid.github.io/onex