Documentserver: chinese font not display correctly

Created on 25 Jun 2015  ·  30Comments  ·  Source: ONLYOFFICE/DocumentServer

is this problem caused by font or built in library?

Most helpful comment

Dear ONLYOFFICE users!
We are working hard on implementation of asian fonts in Document Server. So we need both standard and non-standard fonts to analyze their behaviour in our product. Please send us fonts via [email protected] or attach them to your messages. We will appreciate your assistance.
Best regards
John
ONLYOFFICE support team

All 30 comments

The reason of the issue may be that you do not have chinese fonts on the machine where Document Server is installed.
In order to resolve the issue, please, set chinese fonts using the package or put tff font to /usr/share/fonts/ directory.
Then run the script: documentserver-generate-allfonts.sh
Clear the browser cache and reopen the page.
After that you should choose the font for your document.

thanks for your help , i would try to follow your way. by the way how to contribute to the project, I would like to make this update to the core and help other chinese clients to use it.

I regret to inform you that we do not currently have ssh protocol.
Feel free to fork the repo and continue working.

thanks now get the font worked , but still not perfect. because if my original document was wrote in Chinese, when I open it , the document not rendered in Chinese by default. I have to select all text and choose the font again. Is this an improvement for the software or it was caused by the font missing or font auto detection issue on the server?

This is standard situation. The algorithm is: if the necessary font is not found the editors select the most suitable.
There are two solutions:
1) download the font package which supports Chinese language.
2) change the document fragments with incorrect symbols to the font that supports necessary characters.

I solve the issue with this:

apt-get install fonts-arphic-ukai
cd /usr/share/fonts/
tar cv * | docker exec -i XXX tar x -C /usr/share/fonts/
docker exec XXX /var/www/onlyoffice/documentserver/Tools/GenerateAllFonts.sh
where XXX is the container ID

Then clear cache browser and logon again.

Chinese font not display correctly in onlyoffice spreadsheet chart ?

Please describe the issue more detailed and send us an examle for analyzing
Make sure that the fonts are installed

Our test server:

  1. OS -> CentOS Linux release 7.2.1511 (Core)
  2. Docker -> 1.8.2 10.el7.centos
  3. Server -> HP DL360 G8
  4. onlyoffice documentserver -> image download from DockerHub
  5. chinese fonts -> copy from windows 7 and installed correctly.

We open the "Sample Spreadsheet" file, and change Rank 1 "USA" to Chinese fonts, chinese font not display correctly in the chart.

Screenshot is in the attache file.

chinese_error

Hello
The feature is planned for future versions, at the moment areal font only can be used in the chart inside the spreadsheet.

Dear ONLYOFFICE users!
We are working hard on implementation of asian fonts in Document Server. So we need both standard and non-standard fonts to analyze their behaviour in our product. Please send us fonts via [email protected] or attach them to your messages. We will appreciate your assistance.
Best regards
John
ONLYOFFICE support team

@JohnPerkin
Dear John!
Thanks for for your reply this issues.
I am Chinese, and I am more concerned about this problem.
Is it working right now?

Hi @leangjia. Thank you for intresting for Document Server.
It's difficult feature, so we are still working on it.

my doc 's Chinese fonts is ok,but the interface have some trouble.....
tim 20171205150642

Hi @jianbosu, could you provide us this document?

@agolybev 你的姓名.docx

@agolybev i delete all file in /usr/share/fonts, then cp my font into it. and run Then run the script: documentserver-generate-allfonts.sh && Clear the browser cache and reopen the page. Everything is worked perfect.
tim 20180119160237

Hi, @jianbosu . 'my font', your font means which fonts?

@jianbosu Did you delete all the fonts except Chinese fonts? So onlyoffice force all words to Chinese fonts. I donot think that is a good practice, though temporarily solved Chinese problem.

@JoeLucky yes,i copy some Chinese fonts into your system,and delete all others,clear browser cache,at the end everything will be work perfect。
1

@jianbosu 请问你的界面是如何变成中文的?
How does your interface become Chinese?

snap6

THANK you,According to your method, now is ok. thank you。
"editorConfig": { "callbackUrl": "http://192.168.99.1/url-to-callback?id={{.Doc.Id}}", "user": { "id": "{{.Uid}}", "name": "{{.Uname}}" }, "lang": "zh-CN",//"en-US", },

@3xxx 请问这个配置"editorConfig": 在哪个文件里面修改呢?

在哪里加的

https://github.com/3xxx/ONLYOFFICE-golang
@xwinfo 就是你调用的页面里。

<!DOCTYPE html>
<html style="height: 100%;">
<head>
    <title>fei-OnlyOffice</title>
</head>
<body style="height: 100%; margin: 0;">

    <div id="placeholder" style="height: 100%"></div>
    <script type="text/javascript" src="http://192.168.99.100:9000/web-apps/apps/api/documents/api.js"></script>
    <script type="text/javascript">
        // alert({{.Doc.FileName}});
        window.docEditor = new DocsAPI.DocEditor("placeholder",
            {
                "document": {
                    "fileType": "{{.fileType}}",
                    "key": "{{.Key}}",//"Khirz6zTPdfd7"
                    "title": "{{.Doc.FileName}}",
                    "url": "http://192.168.99.1/attachment/onlyoffice/{{.Doc.FileName}}"
                },
                "documentType": "{{.documentType}}",
                "editorConfig": {
                    "callbackUrl": "http://192.168.99.1/url-to-callback?id={{.Doc.Id}}",
                    "user": {
                        "id": "{{.Uid}}",
                        "name": "{{.Uname}}"
                    },
                    "lang": "zh-CN",//"en-US",
                },
                "height": "100%",
                "width": "100%"
            });
    </script>
</body>
</html>

为什么我的字体显示“yahei”而不显示“微软雅黑”

Is this solution still valid? I installed new fonts on my host machine and they are not showing up in my onlyoffice instance. I tried running docker exec XXX /var/www/onlyoffice/documentserver/Tools/GenerateAllFonts.sh but it did not work. I ssh'd into the docker container and there does not appear to be a Tools folder as specified in this solution.

Any clue on how to fix this issue?

Okay found the info. GenerateAllFonts is now in the usr/bin folder of the docker container.

I ran the script though and it didn't work. I'm looking through the script in nano and it does not look like it ever grabs anything from outside the container. Instead it seems to be loading from "core-fronts" and "fonts" in the documentserver folder.

Is this a change in OnlyOffice or am I missing something?

I'm manually docker cp the fonts files into onlyoffice:/usr/share/font and run the generate font script and while now the files appear on the frontend of the instance, the actual fon is incorrect and it automatically tries to turn the text into a different unrelated font (which judging by it's name just happens to be whatever the next font is in line alphabetically)

Was this page helpful?
0 / 5 - 0 ratings