Japanese Fonts and Input

Not many people know this, but around 2003 and 2004 I took a Japanese course. Unfortunately, almost a decade without contact with the language made me forget most of what I learned. Now I can only recognize a few very basic words, written in Hiragana or Katakana.
Today I decided to reconnect with the language, but first I needed to get my computer ready. This post explains how to display and type Japanese characters on GNU/Linux (more specifically on Arch Linux).
Fonts
Your computer needs the right fonts to be able to display Kanji, Hiragana and Katakana characters.
Some fonts are available in the Arch repository and on the AUR, but you can also install fonts found on the internet. At the end of this post I put links to a few free fonts.
Packages in the repository:
sudo pacman -S ttf-sazanami ttf-hanazono
Packages on the AUR:
for f in {otf-ipafont,ttf-vlgothic,ttf-mplus,ttf-ipa-mona,ttf-monapo}; do packer $f; done
Done! Open a Japanese site to test your new fonts.
Input
If you do not write much, an online Romaji (Latin characters) to Japanese converter is probably enough; otherwise you will need to install specific packages.
The three most common ones are: IBus, uim and SCIM. I tried IBus and SCIM, but I will only go into detail on IBus, which is the one I liked best.
IBus
Install ibus and ibus-anthy from the official repository:
sudo pacman -S ibus ibus-qt ibus-anthy
ibus-qt is what makes ibus work with Qt/KDE programs.
Run ibus-setup:
julio@acer ~> ibus-setup
A window will appear asking you to start the ibus daemon, and another one to configure it. One of the windows shows the following text:
IBus has been started! If you cannot use IBus, please add below lines in $HOME/.bashrc, and relogin your desktop.
export GTK_IM_MODULE=ibus
export XMODIFIERS=@im=ibus
export QT_IM_MODULE=ibus
I skipped this step, since I knew it would not work here (I use ZSH and Awesome). Instead I simply
run ibus-daemon -drx when I want to use IBus. You can put that line in ~/.xinitrc to make IBus
start along with X.
The configuration is quite intuitive. Just add the keyboard layouts you use, so you can switch
between them with the ctrl + space shortcut.
Links
- http://www.wazu.jp/gallery/Fonts_Japanese.html
- https://help.ubuntu.com/community/JapaneseInput
- http://kanjidict.stc.cx/hiragana.php
- https://wiki.archlinux.org/index.php/Smart_Common_Input_Method_platform
- https://wiki.archlinux.org/index.php/Input_Japanese_using_uim
- https://wiki.archlinux.org/index.php/IBus
- http://home.roadrunner.com/~computertaijutsu/jpninpt.html

I’m a Brazilian computer engineer based in Germany, passionate about tech, science, photography, and languages.
I’ve been programming for about two decades already, exploring everything from mobile apps and web development to machine learning. These days I focus on cloud SRE and data engineering.
I volunteer in the open source and Python communities, helping organize PyCon DE and PyData Berlin, mentoring, and contributing with code and translations.
On my blog, I share Linux tips, setup guides, and personal notes I’ve written for future reference. I hope others find them helpful as well. The content is available in multiple languages.
Browse my gallery for some of my photography.
Away from the keyboard, you’ll find me at concerts, playing clarinet, cycling, scuba diving, or exploring new places, cultures, and cuisines.
Always happy to connect! 🙂