CSS first
Where a browser supports text-spacing-trim and text-autospace, that implementation is what runs. No extra script executes.
Japanese typography compatibility layer
The gaping space around brackets and punctuation, the cramped join where Japanese meets Latin text. Mojikumi settles what browsers cannot yet, building on standard CSS. Your readers will never notice the work, only that the page sits right.
『美しい本文』は、文字そのものだけでなく、文字と文字のあいだに宿ります。
Principles
Where a browser supports text-spacing-trim and text-autospace, that implementation is what runs. No extra script executes.
Only the work a browser cannot do yet gets added. The text itself is never touched, so what readers copy and what screen readers announce stay exactly as written.
Plain HTML, React, Markdown. One typesetting policy carries across all of them unchanged.
Before / After
The same passage, set once without punctuation adjustment and once with Mojikumi. Watch the half-character of space around the brackets and punctuation close up, the unevenness go out of the setting, and more of the text fit on each line.
『日本語組版処理の要件(JLREQ)』は、行末に置いた終わり括弧類や句読点について「その後ろを原則として二分アキとする」と定めたうえで、行の調整処理で詰めてベタ組にしてもよい、と述べています〈W3C技術ノート、2012年、3.1.9〉。約物が連続する箇所、たとえば「『引用』」や〈補足(注記)〉でアキを重ねないのも、同じ体裁上の判断です。
『日本語組版処理の要件(JLREQ)』は、行末に置いた終わり括弧類や句読点について「その後ろを原則として二分アキとする」と定めたうえで、行の調整処理で詰めてベタ組にしてもよい、と述べています〈W3C技術ノート、2012年、3.1.9〉。約物が連続する箇所、たとえば「『引用』」や〈補足(注記)〉でアキを重ねないのも、同じ体裁上の判断です。
One policy, several surfaces
Start with a single CSS import, then add the DOM layer, React or MDX support as you need them. At no point does your project structure have to be rearranged.
mojikumiThe all-in-one API for everyday use@mojikumi/cssPresets built around standard CSS@mojikumi/domThe DOM layer that covers browser gaps@mojikumi/reactComponent and hook@mojikumi/rehypeMarkdown / MDX integrationSee the difference
Put no adjustment, YakuHanJP, standard CSS and Mojikumi side by side, then change the measure, the size and the typeface as you read. Paste in your own copy if you like.
Open the Playground