DEV Community

SEN LLC
SEN LLC

Posted on

Japanese Lorem Ipsum From 5 Classic Authors — Why Real Text Beats Random Characters

Japanese Lorem Ipsum From 5 Classic Authors — Why Real Text Beats Random Characters

When you need Japanese placeholder text, random hiragana strings don't test real line-breaking behavior. Kanji-kana mixed text from actual literature has the right density, punctuation rhythm, and character-width distribution. This generator pulls from 5 public-domain classics: Sōseki, Kenji, Dazai, Akutagawa, and Ango.

English has Lorem Ipsum. Japanese dummy text generators often produce random kana strings, but those don't look like real Japanese text. They miss the kanji-to-kana ratio, the sentence-ending particles, the punctuation patterns (。、「」) that affect how text wraps and how fonts render.

🔗 Live demo: https://sen.ltd/portfolio/lorem-jp/
📦 GitHub: https://github.com/sen-ltd/lorem-jp

Screenshot

Features:

  • 5 sources: 吾輩は猫である, 銀河鉄道の夜, 走れメロス, 羅生門, 堕落論
  • Generate by paragraphs (1-10), sentences (1-50), or character count (10-5000)
  • Font preview (serif / sans-serif / monospace)
  • One-click copy
  • Book-like design with cream paper option
  • Japanese / English UI
  • Zero dependencies, 34 tests

Why classic literature

All 5 sources are public domain (authors died 70+ years ago, copyright expired under Japanese law). Each has a distinct writing style:

  • 漱石 (Sōseki): intellectual, complex sentences
  • 賢治 (Kenji): lyrical, nature imagery
  • 太宰 (Dazai): conversational, emotional
  • 芥川 (Akutagawa): precise, classical Japanese influence
  • 安吾 (Ango): philosophical, provocative

Different styles produce different text densities, which is exactly what you want when testing typography.

Sentence splitting on 。

Japanese sentences end with 。(full-width period). Splitting is simpler than English:

export function splitSentences(paragraph) {
  return paragraph
    .split('')
    .map(s => s.trim())
    .filter(s => s.length > 0)
    .map(s => s + '');
}
Enter fullscreen mode Exit fullscreen mode

Wrap-around for overflow

If you request 20 paragraphs but the source only has 12, we cycle:

export function generateParagraphs(sourceId, count) {
  const paragraphs = getSourceParagraphs(sourceId);
  const result = [];
  for (let i = 0; i < count; i++) {
    result.push(paragraphs[i % paragraphs.length]);
  }
  return result;
}
Enter fullscreen mode Exit fullscreen mode

Series

This is entry #42 in my 100+ public portfolio series.

Top comments (0)