Japanese fonts display as square characters with question marks on CentOS hosted Confluence
Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.
Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Summary
If you have followed all of the KB articles and applied the detailed workaround outlined below, CentOS might not have the correct font to render Japanese texts within office files.
You may see Japanese texts being rendered as expected in thumbnail but upon clicking preview these Japanese texts are shown as squares with a question mark in it.

Environment
Confluence version 6.13.6
CentOS 6, 7, 8
Diagnosis
Install all Japanese fonts using the following command.
1
yum groupinstall Fonts
Apply the following parameters into the
setenv.sh
file.1 2
CATALINA_OPTS="-Dconversion.sandbox.java.options=-Dconfluence.document.conversion.fontpath=/usr/share/fonts ${CATALINA_OPTS}" CATALINA_OPTS="-Dconversion.sandbox.java.options=-Dconfluence.document.conversion.slides.defaultfontname.regular=IPAGothic,-Dconfluence.document.conversion.slides.defaultfontname.asian=IPAGothic,-Dconfluence.document.conversion.slides.defaultfontname.symbol=IPAGothic,-Dconfluence.document.conversion.words.defaultfontname=IPAGothic ${CATALINA_OPTS}"
Manually install all Japanese fonts onto CentOS.
1 2 3 4 5 6
yum install ipa-gothic-fonts yum install ipa-mincho-fonts yum install vlgothic-fonts yum install vlgothic-p-fonts yum install ipa-pmincho-fonts yum install ipa-pgothic-fonts
Cause
Takao font is the missing fonts Confluence required to render the Japanese texts properly. CentOS defaults TakaoFonts for Japanese texts instead of the typical Japanese fonts e.g. IPAGothic used by other Linux distributions. Takao font is a derivative of the IPAGothic as described in this Japanese website: https://beyondjapan.com/blog/2017/01/japanese-gothic-fonts-on-linux/
Some Linux distributions use this Takao font as the default Japanese font. That should be the case, and the Takao font is a derivative version of the IPA font. It seems that the Takao font was created to maintain the IPA font, which has a gentle release cycle, in a way that makes a small turn. By the way, Takao is said to have been given by Mr. Takao Hayashi, the designer of TB font, which was the source of IPA font. If you tilt the other side, the TB font itself is a paid font, and you can purchase it in the TypeBank font family TB Gothic.
Solution
Shut down Confluence.
Verify your font path within the
setenv.sh
file. If you don't find the following parameter, the default font path is {{/usr/share/fonts}}1
-Dconfluence.document.conversion.fontpath=/usr/share/fonts
Download the TakaoFonts_00303.01.zip from https://launchpad.net/takao-fonts onto your CentOS, unzip and extract the contents onto your dedicated fonts folder.
Restart Confluence.
You may need to re-download and attach the office files to trigger the file conversion using the right fonts. Squares with question marks may still present on existing office files.
Was this helpful?