ONLYOFFICE / Docker-DocumentServer

ONLYOFFICE Document Server is an online office suite comprising viewers and editors for texts, spreadsheets and presentations, fully compatible with Office Open XML formats: .docx, .xlsx, .pptx and enabling collaborative editing in real time.
GNU Affero General Public License v3.0
1.37k stars 470 forks source link

Can't add fonts correctly #746

Closed Lakhtion closed 2 months ago

Lakhtion commented 2 months ago

I have documentsserver in conjunction with nextcloud. I mounted it in compose:

By default, for some reason, I do not have the most standard fonts, for example calibri, arial, times new roman. Is this like this for everyone? I need fonts with Cyrillic support. What’s surprising is that even if I don’t have the choice of the font I need in the documentserver, it is displayed when I open the document (if it was already there in any text) and I can print on it. Moreover, I can select a font that is not in the list by entering it manually. I get a warning, but everything works. Next I follow the instructions https://helpcenter.onlyoffice.com/ru/installation/docs-community-install-fonts-linux.aspx On the host, I upload calibri fonts (pulled out of Windows) in the amount of 6 files into /media/onlyoffice_documentserver/fonts, execute documentsserver-generate-allfonts.sh inside the container - no errors occur, everything is ok. When I open a document, I see crooked characters on any layout. The font itself appears, but when you try to select a font, some other one is selected, and the characters are displayed crookedly in any language. Firefox browser, clearing cache does not help. Newly installed Chrome on Windows also has crooked symbols. At the same time, everything is displayed correctly through the Yandex browser. Through Firefox on Ubuntu, everything is also displayed correctly. Through the Onlyoffice application on Android, everything is also displayed as it should. And through the nextcloud application and through the Firefox browser on Android, I again see crooked characters. I tried deleting the cache of firefox, nextcloud, android web view - it did not help. It seems that the problem is still in the onlyoffice instance. Please help. I saw similar topics, but a simple cache clearing helped everywhere. No to me. Documentserver version 8.0.1.31, host - debian 11 (openmediavault), docker 26.1.4

igwyd commented 2 months ago

Hello @Lakhtion, yes the docker distribution have only our core fonts by default.

What’s surprising is that even if I don’t have the choice of the font I need in the documentserver, it is displayed when I open the document (if it was already there in any text) and I can print on it. Moreover, I can select a font that is not in the list by entering it manually. I get a warning, but everything works.

When you select a font that does not exist on the server, a warning appears that one of the system fonts will be used if it matches or will be select automatically from the most similar ones.

I checked you case with chrome and firefox on windows and linux, adding fonts works correctly. Most likely, the problem is not in the server, but in the cache in your devices, browsers, cache proxy(do you use clouflare maybe?), VPN or someting else. For a clean test, install your browsers on a new clean virtual machine and test your fonts.

Lakhtion commented 2 months ago

I checked you case with chrome and firefox on windows and linux, adding fonts works correctly. Most likely, the problem is not in the server, but in the cache in your devices, browsers, cache proxy(do you use clouflare maybe?), VPN or someting else. For a clean test, install your browsers on a new clean virtual machine and test your fonts.

Greetings. I already wrote that I tried to delete all kinds of caches. I tried to install pure Chrome - the problem is there too. Today I tried to install a clean Windows 10 via vmware and immediately open the document in Edge - there is a problem there too. All the characters are crooked, the fonts in the list are mixed, it’s impossible to work. I tried resetting the cache both with ctrl+f5 and through the browser settings, but I think it doesn’t matter, since the problem is reproduced on a completely clean operating system and browser.

igwyd commented 2 months ago

Then maybe the problem is in some fonts, could you attach the fonts with which you are experiencing problems?

Lakhtion commented 2 months ago

Then maybe the problem is in some fonts, could you attach the fonts with which you are experiencing problems?

Yes, you can try with it. I pulled it from Windows 11, this is system fonts, and it works correctly in MS Office. Based on the test results, I realized that apparently the calibri is working correctly, but not arial and times. I tried to install them separately.

Is it important to put fonts in the /usr/share/fonts directory just as a bunch of files or distribute them into folders? Should I put them in this directory or in the truetype or custom folder inside it? Or does this moment make absolutely no difference for onlyoffice?

I also could not figure out how to 100% reset the browser cache in a situation with Firefox - sometimes even completely deleting all history, cookies, cache and generally everything possible for the entire time does not help. And ctrl+f5 for a snack. And sometimes it works. With chrome and Yandex browser it seems to be simpler. I test changes in Yandex now, because I guaranteed can see any results there. fonts.zip

igwyd commented 2 months ago

Firefox has a guide in support on how to clear the cache - here. It doesn't matter whether the fonts are in the /usr/share/fonts or into a nested folders. I checked your fonts and they are correctly added and displayed, so the problem is in your stand. You need to localize the issue. Try installing onlyoffice-documentserver and nextcloud on a clean machine without a proxy and test adding fonts. If everything works, then add your settings one by one to get closer to the problematic stand and I think you will be able to find the error.

Lakhtion commented 2 months ago

and I think you will be able to find the error

Thanks, I figured out the issue! The error was that I had the item cache assets enabled in Nginx proxy manager. The proxy manager cached onlyoffice data in its container in addition to my browsers. I disabled cache assets and now, when adding fonts and resetting the cache in the browser for my domain, everything is ok. PS by the way, ctrl+f5 does not help, need to reset cache manually, but all works now.

I think we can close this thread, thanks