NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
16.53k stars 13.02k forks source link

Fantasy and Cursive fonts not included in fonts.enableDefaultPackages #302980

Open Animaly0 opened 3 months ago

Animaly0 commented 3 months ago

Describe the bug

fonts.enableDefaultPackages does not include Fantasy fonts or Cursive Fonts for the web even if fontconfig have them defined. This means that if a website use the css arguments font-family: fantasy; or font-family: cursive; without importing a font, they will fallback to Sans-serif.

Steps To Reproduce

Steps to reproduce the behavior:

  1. Use fonts.enableDefaultPackages = true; on a system without any custom fonts
  2. Use fc-match fantasy or fc-match cursive to see what font is used 2.bis Visit this codepen or whatever website website using these font-family
  3. Install any of the fonts used by fontconfig or install nur.repos.mikilio.ttf-ms-fonts from the NUR

Expected behavior

fonts.enableDefaultPackages should install any of aliases fonts defined by fontconfig. For fantasy, those are Bauhaus Std, Cooper Std, Copperlate Gothic Std, Impact. For cursive, those are Comic Sans MS, Zapf Chancery Std, Zapfino.

OR

change the fontconfig aliases for the fantasy and cursive faces with custom added fonts

Screenshots

codepen without the fonts font-familyNixOS24 05 codepen with the ms-fonts font-familyNixOS24 05_fixed

Additional context

I found the fonts asked by fontconfig at /usr/share/fontconfig/conf.avail/45-latin.conf in the current nixos derivation

Notify maintainers

@SuperSandro2000 @nbraud

Metadata

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

[user@system:~]$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 6.6.23, NixOS, 24.05 (Uakari), 24.05pre604424.d8fe5e6c92d0`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.18.2`
 - channels(root): `"home-manager, nixos, nixos-hardware, nixos-unstable, nixpkgs-unstable"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`

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

SuperSandro2000 commented 3 months ago

Are those Microsoft contacts unfree like corefonts?

Animaly0 commented 3 months ago

I'm unsure what Microsoft contacts means but the ms-font is unfree for sure yeah. I don't they would be a good choice, I just made a quick fix with my current limited skillset