The text in a PowerPoint, Excel or Word Document is missing or looks different via Confluence View File macro
プラットフォームについて: Server および Data Center のみ。この記事は、Server および Data Center プラットフォームのアトラシアン製品にのみ適用されます。
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.
*Fisheye および Crucible は除く
Before following this guide, check if you are using a Java version that is affected by this bug:
- CONFSERVER-59429 - Getting issue details... STATUS
If that is the case, proceed with the workaround on the bug before checking for font issues.
要約
The View File macros allow you to embed an Office or PDF document on a page. However, after an installation, upgrade, or migration to a different OS, the files are displaying incorrectly or not showing at all.
環境
- Confluence Server and Data Center.
- Supported OS.
診断
When using the view file macro, the text is missing or appears different than when viewing the document in its native application.
Viewed in MS PowerPoint | Viewed in Confluence |
---|---|
Text, background, and image are all shown. | Background and image are shown, but the text is missing. |
This error may also be seen in atlassian-confluence.log
2017-09-21 15:56:37,697 WARN [Caesium-1-2] [apache.fontbox.util.FontManager] findTTFontname Font not found: Arial,BoldItalic
This can also happen with non-English characters, like Chinese, which doesn't display properly or appear as boxes.
原因
Custom fonts or Microsoft-specific fonts (for example Arial, Times New Roman, or Courier New) may not exist if you are running Confluence and the Office Connector on a non-Windows server. When previewing, a substitute font will be used to render the text.
Similarly, to display non-English Characters like Chinese, the system will need the required fonts.
注意
Make sure that the document is using the correct fonts. For example, the msttcorefonts package does not include Wingdings but one called Webdings. In Windows this will fallback correctly, but not with Confluence. This also occurs for fonts such as Helvetica. Use Arial in the document instead. Also if there are any reservations installing the msttcorefonts package, you may opt for something like Liberation(tm) Fonts (this font family aims at metric compatibility with Arial, Times New Roman, and Courier New. It is sponsored by Red Hat)
ソリューション
Linux
- Confluence をシャットダウンします。
- Install the missing fonts onto your server on Linux (see below)
- Set the system property
confluence.document.conversion.fontpath
insetenv.sh
(see Configuring System Properties) to /usr/share/fonts/truetype/msttcorefonts
for Ubuntu/DebianCATALINA_OPTS="-Dconfluence.document.conversion.fontpath=/usr/share/fonts/truetype/msttcorefonts ${CATALINA_OPTS}"
CATALINA_OPTS="-Dconfluence.document.conversion.fontpath=<absolute path to font location> ${CATALINA_OPTS}"
/usr/share/fonts/msttcore
for Centos/RedHaTCATALINA_OPTS="-Dconfluence.document.conversion.fontpath=/usr/share/fonts/msttcore ${CATALINA_OPTS}"
CATALINA_OPTS="-Dconfluence.document.conversion.fontpath=<absolute path to font location> ${CATALINA_OPTS}"
- If you have any custom, non-Microsoft fonts in your document, the font files must be copied to the same path outlined in the previous step.
次のコマンドを利用してフォントのキャッシュを再構築します。
fc-cache -f -v
Confirm that your font is listed in the font cache:
fc-list
- Follow the steps in How to rebuild the file preview cache from scratch in Confluence to delete previous preview with incorrect fonts.
- (Optional) Clear the Confluence Plugins Cache.
- (Optional) Perform a Content Index Rebuild.
- Confluence を再起動します。
Installing Microsoft Fonts
For Debian/Ubuntu (see RestrictedFormats/Microsoft_Fonts)
sudo apt-get install ttf-mscorefonts-installer
For RedHat/Centos (see Get Microsoft's Core Fonts for the Web and Cleartype Fonts)
yum install curl cabextract xorg-x11-font-utils fontconfig rpm -i https://downloads.sourceforge.net/project/mscorefonts2/rpms/msttcore-fonts-installer-2.6-1.noarch.rpm
If you're running RHEL 7 / EC2 AMI on AWS and the server can't find the package crabextract, you may need to update the epel-release first:
yum install epel-release yum install ./epel-release-latest-*noarch.rpm
Webcore package (RedHat/Centos) - this package contains the Wingdings font, as well as other Microsoft fonts. It could be an alternative in case the msttcore package doesn't contain all the fonts you need.
yum localinstall http://li.nux.ro/download/nux/dextop/el7/x86_64/webcore-fonts-3.0-1.noarch.rpm
If you choose to use the WebCore package, make sure to update the JVM parameter to the following:
/usr/share/fonts/webcore for Centos/RedHatCATALINA_OPTS="-Dconfluence.document.conversion.fontpath=/usr/share/fonts/webcore ${CATALINA_OPTS}"
Installing Non-English Fonts
- Identify which fonts are being used in the Word Document. For example, in the case of Chinese Fonts, MingLiU is one famous font.
- It is important that all Chinese characters are using some kind of font, so Confluence can look for relevant files.
- Download the font and place it under the relevant path. In CentOS/RHEL, it will be as discussed above.
Use that font in the system property
confluence.document.conversion.fontpath
insetenv.sh
CATALINA_OPTS="-Dconfluence.document.conversion.fontpath=/usr/share/fonts/MingLiU ${CATALINA_OPTS}"
A generic font for Chinese is wqy-zenhei, this can also be used, in case it is unsure that what fonts are being used in the document.
For Korean Text, if the font Batang isn't displaying properly, it can be replaced by Malgun Gothic, a font commonly used in Microsoft PowerPoint/Word
For Japanese Text, a generic font would be IPA Gothic so this font family can be installed to help displaying Japanese Text
For broken bullet points in Power point files have a look at CONFSERVER-52254 - Getting issue details... STATUS
Windows
- Copy any missing fonts to
%windir%\fonts
this is usuallyc:\windows\fonts
.
When copying fonts from a computer running Windows, the font files will typically be located in c:\windows\fonts
. You can also download the Microsoft Core fonts from sourceforge.