ONLYOFFICE / DocumentServer

ONLYOFFICE Docs is a free collaborative online office suite comprising viewers and editors for texts, spreadsheets and presentations, forms and PDF, fully compatible with Office Open XML formats: .docx, .xlsx, .pptx and enabling collaborative editing in real time.
https://www.onlyoffice.com
GNU Affero General Public License v3.0
5.27k stars 1.12k forks source link

[FR] Cross-platform font automatic mapping #3101

Open mokeyish opened 3 months ago

mokeyish commented 3 months ago

This issue is unique.

Your idea.

Fonts on different platforms are different. Some fonts are not available, or display abnormally, and the effect is not good.

I hope to add a global font mapping that can be mapped to a specified font based on the font name.

TatianaKirillova commented 3 months ago

Hello @mokeyish! Thanks for your idea, but we are already using this scheme. If the system does not have a specific font, then we replace it with another one that is most suitable not only by name, but also by font metrics

mokeyish commented 3 months ago

Thanks for your reply. But I hopefully this can be configured manually.


This is the automatically selected font:

image

This is the desired font:

image

TatianaKirillova commented 3 months ago

@mokeyish I don't quite understand what actions you are doing to reproduce the problem. Can you tell us in more detail what you expect and at what stages?

mokeyish commented 3 months ago

@TatianaKirillova The font is set on Windows, but macOS does not have this font. Just like what you said, onlyoffice will automatically find a suitable font, but this font still does not display well. So I hope there is a place where I can configure it globally, fontA => fontB mapping.


For example, the following configuration

{
    "fontMappings": {
        "Calibri": "思源宋体",
        // other mappings ...
    }
}

When onlyoffice wants to use the calibri font, it is forced to switch to 思源宋体.

mokeyish commented 3 months ago

BTW, @TatianaKirillova do you have documentation on how to contribute to this project? For example, how to start debugging. I tried looking for npm run dev in package.json, but couldn't find it.

TatianaKirillova commented 2 months ago

@mokeyish Thanks for the detailed explanation! I have issued this enhancement as 72681 The problem is reproduced on Document Server.