Skip to content

Add support for ruby (CJK, e.g., furigana for Japanese) #1489

@Andrew15-5

Description

@Andrew15-5

Description

I use ruby package to add furigana on top of the Japanese words in lualatex:

\documentclass[a4paper]{article}
\usepackage[margin=1cm]{geometry}
\pagestyle{empty}
\usepackage{fontspec}
\setmainfont{Noto Sans CJK JP}
\usepackage{ruby}
\usepackage{fontsize}
\changefontsize[21]{14}
\let\fu\ruby
\begin{document}

\begin{center}
  \textbf{柊マグネタイト「マーシャル・マキシマイザー」歌詞}
\end{center}

\begin{center}
  \fu{唖}{あ}\fu{々}{あ}、\fu{臨界実験}{りんかいじっけん}に\fu{付}{つ}き\fu{合}{あ}う\fu{朝}{あさ}
\end{center}

\end{document}

image

I just tried a few things with Typst and I can already tell with 99% of confidence that I can do everything I do with lualatex except adding furigana, which is a crucial part of some Japanese documents (depends on type of document and other things). I was thinking about making some kind of table/math-like vertically nested text, but I'm not a package creator, so I don't know how it is (properly) implemented in ruby package, and therefore I don't know how to implement this in Typst. By this, I mean some easy and concise way to add a Typst alternative of \ruby{}{} (without making a separate feature or template or something).

Use Case

It is not the feature everyone will want, but it should probably be included in the compiler (as a Japanese language "exclusive" feature). As furigana is a way to tell the reader how to pronounce words, this feature would be useful for creating content for Japanese beginners or children such as text books, comics (a.k.a. manga) and much more (or lyrics as per my example).

P.S. It could imply that the "vertical" "right to left" layout must be implemented in the Typst as well (for traditional Japanese style text flow).

Metadata

Metadata

Assignees

No one assigned

    Labels

    cjkChinese, Japanese, Korean typography.feature requestNew feature or requesttextRelated to the text category, which is all about text handling, shaping, etc.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions