NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
17.89k stars 13.95k forks source link

LibreOffice does not get some fonts including WQY ZenHei #93396

Closed ShamrockLee closed 4 years ago

ShamrockLee commented 4 years ago

Describe the bug Some fonts such as WQY ZenHei cannot be used in LibreOffice after these fonts are installed.

To Reproduce Steps to reproduce the behavior:

  1. Install libreoffice.
  2. install wqy_zenhei.
  3. Open LibreOffice.
  4. Choose "Create: Writer Document" or "Create: Impress Presentation", etc.
  5. Navigate to the choice box of fonts.
  6. Notice that WQY ZenHei is not inside.

Expected behavior Expected installed fonts such as WQY ZenHei to appear in the font choice box in LibreOffice Writer, LibreOffice Impress, and other pieces of software in LibreOffice suite.

Screenshots Screenshot_20200718_165917

Additional context Add any other context about the problem here.

Notify maintainers

@7c6f434c

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

Maintainer information:

# a list of nixpkgs attributes affected by the problem
attribute: libreoffice
# a list of nixos modules affected by the problem
module:
nixos-discourse commented 4 years ago

This issue has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/guidelines-on-packaging-fonts/7683/4

Thra11 commented 4 years ago
  1. install wqy_zenhei.

How did you install wqy_zenheI? Did you add it to fonts.fonts in /etc/nixos/configuration.nix, or try to install it in some other way (e.g. by putting it in environment.systemPackages or using nix-env or nix-shell)?

I added it to my /etc/nixos/configuration.nix like this:

  fonts.fonts = with pkgs; [
    wqy_zenhei
  ];

Libreoffice is already in my environment.systemPackages. After running nixos-rebuild switch, libreoffice (I tested Writer) has three variants, "WenQuanYi Zen Hei", "WenQuanYi Zen Hei Mono", and "WenQuanYi Zen Hei Sharp".

ShamrockLee commented 4 years ago

How did you install wqy_zenheI? Did you add it to fonts.fonts in /etc/nixos/configuration.nix, or try to install it in some other way (e.g. by putting it in environment.systemPackages or using nix-env or nix-shell)?

I didn't know about fonts.fonts. Thanks a lot for your help!