Confluence upload file Attachment preview garbled problem (Linux Server installation font operation)

Source: Internet
Author: User

In the Confluence upload Excel file, the preview found garbled problem is mainly because the time to upload the file is usually under the Windows file upload, and the preview is the environment under Linux, because there is no Microsoft fonts under Linux, so the preview of the document font is not recognized, So it will appear garbled. Also for example, a business has a function to generate pictures, the results of the image of the word all change the space, which is not the server on the corresponding font caused. Workaround: Install the Chinese font on the server. Here 's how it works:

1) First install the desired font, such as italics, from the local "C-Disk->windows-fonts" folder copy Simkai font copied to confluence deployment machine (you can also download a few fonts to put in the past). 2) Install new fonts under Linux system Linux with fontconfig to install font libraries [[email protected] ~]# yum-y install Fontconfig #一般是默认自带的安装成功后, in/usr/ The shared directory will see the fonts and Fontconfig directories (not previously) [[email protected] ~]# ll-d/usr/share/fonts/[[email protected] ~]# ll-d/usr/share/fontconfig/drwxr-xr-x. 3 root root 4096 November 9 2017/usr/share/fontconfig/Add a Chinese font, such as the Italic Simkai font file above to the Confluence deployment machine/usr/share/ Under a directory under fonts (for example, create a new windowsfonts directory) [[email protected] ~]# cd/usr/share/fonts/[[email protected] Fonts ]# mkdir windowsfonts[[email protected] fonts]# ll windowsfonts/total dosage 4044-rwxr-xr-x 1 root root 4135804 August 2004 Si Mkai.ttf immediately needs to modify the permissions of the windowsfonts directory: [[email protected] ~]# chmod-r 755/usr/share/fonts/windowsfonts/ Next you need to install Ttmkfdir to search all the font information in the directory and summarize the generated Fonts.scale file [[email protected] ~]# yum-y install Ttmkfdir #一般会默认自带然 After executing the ttmkfdir command [[Email protected]nfluence-server ~]# CD/USR/SHARE/FONtconfig/windowsfonts/[[email protected] windowsfonts]# mkdir/usr/share/x11/fonts/encodings/encodings.dir[[ Email protected] windowsfonts]# ttmkfdir-e/usr/share/x11/fonts/encodings/encodings.dir found in/usr/share/ The fontconfig/windowsfonts/directory has a fonts.scale[[email protected] windowsfonts]# cat Fonts.scale 2simkai.ttf- Misc-kaiti_gb2312-medium-r-normal--0-0-0-0-c-0-ascii-0simkai.ttf-misc-kaiti_ Gb2312-medium-r-normal--0-0-0-0-c-0-iso10646-1 The last step is to modify the font configuration file, first through the editor to open the configuration file, you can see a font list, that is, the font lists, Here we need to add the Chinese font location added: [[email protected] windowsfonts]# vim/etc/fonts/fonts.conf.......<!--Font Directory List--><dir>/usr/share/fonts</dir><dir>/usr/share/x11/fonts/type1</dir> <dir>/ Usr/share/x11/fonts/ttf</dir> <dir>/usr/local/share/fonts</dir> <dir>/usr/share/fonts/ Windowsfonts</dir> #添加这一行 <dir>~/.fonts</dir> <!--then enter: Wq save to quit, and finally don't forget to refresh the in-memory font cache, so you don't have to Rebo OT restarted: [[email protected] Windowsfonts]# Fc-cache finally look at the font list again through fc-list: [[email protected] windowsfonts]# fc-list ... Italics _gb2312,kaiti_gb2312:style=regular .... You can see that the Chinese fonts have been successfully installed, so that the installation process is complete, and again to see the report can be found in Chinese style and content can be displayed properly. 3) in the Confluence Deployment machine installation directory, such as/opt/atlassian/confluence/bin find setenv.sh, find catalina_opts, add a row [[email protected] ~] # vim/opt/atlassian/confluence/bin/setenv.sh ... Catalina_opts= "-dconfluence.document.conversion.fontpath=/usr/share/fonts/windowsfonts/${CATALINA_OPTS}" 4) empty confluence home under the Viewfile directory and shared-home/dcl-document directory of all cached document files, do not empty, Confluence preview the old file will still show the box, only the new file will be normal. [[email protected] ~]# cd/var/atlassian/application-data/confluence/shared-home/dcl-document[[email  Protected] dcl-document]# rm-rf./*5) reboot confluence OK. If after restarting, found that the original uploaded attachments preview also garbled, that is the cache document file caused! You can delete these files, re-upload into the normal preview!!       [[email protected] ~]# lsof-i:8080command PID USER FD TYPE DEVICE size/off NODE Namejava 138112 Jira 151u IPv6 230299384 0t0 TCP *:webcache (LISTEN) Java 188894 Confluence 868u IPv6 286937024 0t0 TCP confluence-server:37886->confluence-server:webcache (CLOSE_WAIT) [[EMA Il protected] ~]#/etc/init.d/confluence Restart by the way, confluence to the database encoding format requirements is utf-8, so please set the database encoding format correctly, so as to avoid garbled in other places.

Confluence upload file Attachment preview garbled problem (Linux Server installation font operation)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.