---
title: "Flexbox Furigana"
date: 2022-06-25 11:30:00 +1100
last_modified_at: 2022-06-28 10:00:00 +1100
tags: japan japanese 日本語 振り仮名 ふりがな annotation blog jekyll meta
header:
image: /assets/images/2022-06-25/menu-with-furigana.jpg
image_description: "大和田鮨"
teaser: /assets/images/2022-06-25/menu-with-furigana.jpg
overlay_image: /assets/images/2022-06-25/menu-with-furigana-header.jpg
overlay_filter: 0.4
caption: >
Photo by 極地狐 on
Flickr
excerpt: >
Styling _kanji_ readings is a big subject for such small text.
---
_[Furigana][]_ are annotations used to indicate the Japanese reading, or
pronunciation, of Chinese _[kanji][]_ characters.
As a simple example, let's say we have a character like this[^1]:
車
_Furigana_ for the _kanji_, written with _[hiragana][]_[^2], can be placed above
it[^3]:
車
This is all well and good for Japanese speakers, but what if I wanted
English-speakers to be able to read along as well? This can be done by adding
the character's pronunciation using Latin script (_[romaji][]_) as another
_furigana_-style annotation:
車
Okay, but what does this word actually mean? We could put an English translation
to the right of the word, or pile on _yet another_ annotation for the English
meaning[^4]:
車
For single words, this "full-suite" of annotations could be considered
acceptable, but for complete sentences, where the objective is to have a
non-Japanese speaker read along
{% include ruby.html word="phonetically" annotation="fuh·neh·ti·kuh·lee" %}, I
think any translation needs its own dedicated section.
I did exactly this in a previous blog post, _[A Person's Character
(人という字は)][]_, where I wanted to show the
{% include ruby.html word="pronunciation" annotation="/pɹəˌnʌn.siˈeɪ.ʃən/" %}
and meaning of some lines of dialogue from the television drama
_[Kinpachi-sensei][]_. The intention was to enable English speakers to follow
the Japanese dialogue using the _romaji_ annotations, and _then_ read the
translation:
{% include japanese.html word="君"
furigana="きみ"
romaji="Kimi"
furigana-left-padding="4px" %}
{% include japanese.html word="たち" romaji="tachi" %}
{% include japanese.html word="いい" romaji="ii" %}
{% include japanese.html word="です" romaji="desu" %}
{% include japanese.html word="か" romaji="ka~." %}
{% include japanese.html word="〜。" %}
{% include japanese.html word="人"
furigana="ひと"
romaji="Hito"
furigana-left-padding="4px" %}
{% include japanese.html word="と" romaji="to" %}
{% include japanese.html word="いう" romaji="iu" %}
{% include japanese.html word="字"
furigana="じ"
romaji="ji"
furigana-left-padding="4px" %}
{% include japanese.html word="は" romaji="wa" %}
{% include japanese.html word="ねぇ" romaji="nē," %}
{% include japanese.html word="、" %}
{% include japanese.html word="ひとり" romaji="hitori" %}
{% include japanese.html word="の" romaji="no" %}
{% include japanese.html word="「人」"
furigana="ひと"
romaji="\"hito\""
furigana-left-padding="8px" %}
{% include japanese.html word="が" romaji="ga" %}
{% include japanese.html word="もう" romaji="mō" %}
{% include japanese.html word="ひとり" romaji="hitori" %}
{% include japanese.html word="の" romaji="no" %}
{% include japanese.html word="「人」"
furigana="ひと"
romaji="\"hito\""
furigana-left-padding="8px" %}
{% include japanese.html word="を" romaji="o" %}
{% include japanese.html word="支えて"
furigana="ささ"
romaji="sasaete"
furigana-align="left"
furigana-left-padding="3px" %}
{% include japanese.html word="いる" romaji="iru" %}
{% include japanese.html word="字"
furigana="じ"
romaji="ji"
furigana-left-padding="4px" %}
{% include japanese.html word="です" romaji="desu." %}
{% include japanese.html word="。" %}
{% include japanese.html word="つまり" romaji="Tsumari," %}
{% include japanese.html word="、" %}
{% include japanese.html word="人"
furigana="ひと"
romaji="hito"
furigana-left-padding="4px" %}
{% include japanese.html word="と" romaji="to" %}
{% include japanese.html word="人"
furigana="ひと"
romaji="hito"
furigana-left-padding="4px" %}
{% include japanese.html word="が" romaji="ga" %}
{% include japanese.html words="支え,合ってる"
furigana="ささ,あ"
romaji="sasae,atteru"
furigana-align="left"
furigana-left-padding="3px,8px" %}
{% include japanese.html word="から" romaji="kara" %}
{% include japanese.html word="人"
furigana="ひと"
romaji="hito"
furigana-left-padding="4px" %}
{% include japanese.html word="なん" romaji="nan" %}
{% include japanese.html word="です" romaji="desu." %}
{% include japanese.html word="。" %}
{% include japanese.html word="人"
furigana="ひと"
romaji="Hito"
furigana-left-padding="4px" %}
{% include japanese.html word="は" romaji="wa" %}
{% include japanese.html word="人"
furigana="ひと"
romaji="hito"
furigana-left-padding="4px" %}
{% include japanese.html word="に" romaji="ni" %}
{% include japanese.html word="よって" romaji="yotte" %}
{% include japanese.html word="支えられ"
furigana="ささ"
romaji="sasaerare,"
furigana-align="left"
furigana-left-padding="3px" %}
{% include japanese.html word="、" %}
{% include japanese.html word="人"
furigana="ひと"
romaji="hito"
furigana-left-padding="4px" %}
{% include japanese.html word="の" romaji="no" %}
{% include japanese.html word="間"
furigana="あいだ"
romaji="aida"
furigana-left-padding="5px" %}
{% include japanese.html word="で" romaji="de" %}
{% include japanese.html word="人間"
furigana="にんげん"
romaji="ningen"
furigana-left-padding="6px" %}
{% include japanese.html word="として" romaji="toshite" %}
{% include japanese.html word="磨かれて"
furigana="みが"
romaji="migakarete"
furigana-align="left"
furigana-left-padding="4px" %}
{% include japanese.html word="いくん" romaji="ikun" %}
{% include japanese.html word="です" romaji="desu." %}
{% include japanese.html word="。" %}
Can I have your attention, please. So, the character for "person" consists of
one person holding up and sustaining another person. In other words, it is a
"person" precisely because a person and another person are supporting
each other. A person gets support from other people and their community, and
through that support, grows and develops as a human.
Figuring out the idiosyncrasies of how to mark-up and display all of these
annotations in the way I wanted using [HTML][] and [CSS][], and then developing
a way to extract that logic out into functionality that could be shared across
multiple [Markdown][]-based blog posts using [Liquid][], took me far more time
than I expected, and became the catalyst for writing this particular blog post.
So, the following is my [brain dump][] on what I learned about using annotations
on the web.
## Annotation Markup
_Furigana_ is a type of [Ruby character][] annotation[^5], and is marked up in
HTML using the [``][] tag.
Searching the internet for how to mark-up `` elements leads to a
significant amount of conflicting information. The [W3 Ruby Annotation][]
document mentions a selection of markup tags that can appear inside a ``
tag:
- [`