NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
16.6k stars 13.08k forks source link

wpsoffice: bold text rendering issue due to incompatiblility with newer freetype #279314

Open 66Leo66 opened 6 months ago

66Leo66 commented 6 months ago

Describe the bug

Bold font rendered abnormally unless scaled large enough. (e.g. For font size 12, only normal after document scaled to 440%). I'm using wpsoffice chinese version. Note that some font are not affected. On my machine Source Han Sans is rendered normally but Noto Sans is not. WPS community members have located the issue related to freetype >2.13.0 (wpsoffice on nixpkgs is at 2.13.2), see additional context below.

Steps To Reproduce

Steps to reproduce the behavior:

  1. Create a document/slideshow/... in WPS Office.
  2. Type in some text and set it bold.
  3. Change to Noto Sans font and see how it "glitched".

Expected behavior

Correct rendering of bold font.

Screenshots

image image Expected: image

Additional context

Community discussion in Chinese WPS forum. An archlinux fix package on AUR Corresponding AUR PKGBUILD with some patches

Notify maintainers

@Ninlives @Th0rgal @wineee

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

❯ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 6.6.1-zen1, NixOS, 23.11 (Tapir), 23.11.20240105.c1be43e`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.18.1`
 - nixpkgs: `/etc/nix/path/nixpkgs`

Add a :+1: reaction to issues you find important.

wineee commented 6 months ago

freetype rejected the corresponding patch, I tend to use the old version of freetype until wps fixes this issue

66Leo66 commented 6 months ago

@wineee Unrelated the the original issue, I'm having trouble building the wps package due to HTTP 403 Forbidden when WPS package was being fetched. Their official website still works though. I did some quick test and it seems that they have some referrer restriction?

Here's AUR's fix landed yesterday: https://aur.archlinux.org/cgit/aur.git/commit/?h=wps-office-cn&id=b0863db4c9a3acea861f50d70c48ef6762f9c0d5

# With referred: working
❯ curl https://wps-linux-personal.wpscdn.cn/wps/download/ep/Linux2019/11711/wps-office_11.1.0.11711_amd64.deb -e https://linux.wps.cn
Warning: Binary output can mess up your terminal. Use "--output -" to tell
Warning: curl to output it to your terminal anyway, or consider "--output
Warning: <FILE>" to save to a file.

# W/o referrer: 403
❯ curl https://wps-linux-personal.wpscdn.cn/wps/download/ep/Linux2019/11711/wps-office_11.1.0.11711_amd64.deb
<html>
<head><title>403 Forbidden</title></head>
<body bgcolor="white">
<center><h1>403 Forbidden</h1></center>
<hr><center>kngx/1.10.2</center>
</body>
</html>
66Leo66 commented 4 months ago

@wineee WPS released new version 11.1.0.11719. But their changelog (zh) (en) didn't mention fixing this font issue, and I haven't tested the new vresion.

Also as per comments in AUR, there seemed to be enhanced signature check on download links (some hash/timestamp bullshit I think). Header trick I mentioned in previous comments are no longer working. AUR package bypassed it using a script to dynamically generate download link which, AFAIK, is Nix-unfriendly? (Hashed won't change of course but you'll need to generate urls on the fly. Will that break reproducibility or caching or something?)


Update: Ubuntu Kylin has deb package for wpsoffice in their repo, which is mirrored by multiple providers. Example: https://mirrors.aliyun.com/ubuntukylin/pool/partner/wps-office_11.1.0.11719_amd64.deb I have confirmed that it's got the same hash for official website download. The problem might be, there's just cn version.

wineee commented 4 months ago

There is a new pull request to update wps:https://github.com/NixOS/nixpkgs/pull/291081 The font issue still exists in new version image

fingertap commented 2 weeks ago

So sad that this issue still exits in current version.