Heti is a CSS-based typographic enhancement library for Chinese web content. It applies standard Chinese typesetting rules entirely through stylesheets, without any JavaScript dependencies, handling punctuation compression, character alignment, mixed-script spacing, and baseline grid alignment for both simplified and traditional Chinese characters.
The library distinguishes itself by supporting traditional vertical text layout flowing from top to bottom and right to left, alongside horizontal reading directions, using CSS Grid and writing-mode properties. It provides automatic dark mode adaptation through CSS media queries, preset desktop font family selection, and interlinear annotation placement for commentary alongside main text. Classical Chinese poetry and prose receive specialized formatting that preserves traditional layout and rhythm.
Additional capabilities include multi-column content arrangement using CSS column-count and column-width properties, automatic spacing between Chinese characters and Latin letters or digits, and punctuation compression through CSS pseudo-elements and letter-spacing adjustments. The system applies pre-designed typographic rules to all HTML tags used in Chinese content, removing the need for manual styling.