Skip to content

nixos/fontconfig: fix allowBitmaps option with recent fontconfig versions#449715

Closed
mcsimw wants to merge 1 commit into
NixOS:masterfrom
mcsimw:master
Closed

nixos/fontconfig: fix allowBitmaps option with recent fontconfig versions#449715
mcsimw wants to merge 1 commit into
NixOS:masterfrom
mcsimw:master

Conversation

@mcsimw

@mcsimw mcsimw commented Oct 7, 2025

Copy link
Copy Markdown
Contributor

The new version of fontconfig includes a new configuration file 70-no-bitmaps-except-emoji.conf that rejects bitmap fonts by default. This breaks the existing fonts.fontconfig.allowBitmaps option, which is true by default but no longer has any effect.

This change removes the new bitmap rejection config file when allowBitmaps is true, restoring the intended behavior and allowing bitmap fonts like Spleen and Terminus to work correctly.

Fixes #449657

Things done

  • Built on platform:
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • Tested, as applicable:
  • Ran nixpkgs-review on this PR. See nixpkgs-review usage.
  • Tested basic functionality of all binary files, usually in ./result/bin/.
  • Nixpkgs Release Notes
    • Package update: when the change is major or breaking.
  • NixOS Release Notes
    • Module addition: when adding a new NixOS module.
    • Module update: when the change is significant.
  • Fits CONTRIBUTING.md, pkgs/README.md, maintainers/README.md and other READMEs.

Add a 👍 reaction to pull requests you find important.

@nixpkgs-ci nixpkgs-ci Bot added 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-nixos-tests This PR causes rebuilds for all NixOS tests and should normally target the staging branches. 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` labels Oct 7, 2025
@acid-bong

acid-bong commented Oct 8, 2025

Copy link
Copy Markdown
Contributor

Rename your commit to match the PR: title conventions apply to both commits and PRs.

And a non-blocking tip for the future (and your own convenience): when submitting PRs, never commit to the main branch, branch out. The main branch in your clone is there only to be synced with the upstream

@mcsimw

mcsimw commented Oct 8, 2025

Copy link
Copy Markdown
Contributor Author

Rename your commit to match the PR: title conventions apply to both commits and PRs.

And a non-blocking tip for the future (and your own convenience): when submitting PRs, never commit to the main branch, branch out. The main branch in your clone is there only to be synced with the upstream

I renamed the commit to match PR.

And noted for next time, will branch out when commiting changes to my nixpkgs repo.

Comment thread nixos/modules/config/fonts/fontconfig.nix Outdated
@mcsimw

mcsimw commented Oct 8, 2025

Copy link
Copy Markdown
Contributor Author

@acid-bong I would also like to add that I am not sure exactly what caused this file to get generated as of yesterday by nixpkgs. Fontconfig was updated last about a month ago in the nixos-unstable branch and I keep my nixpkgs updated pretty frequently. I would have noticed earlier if that was an issue. So the title of PR/commit/my description of the cause of this problem might not be accurate.

The fontconfig package might not be generating it, perhaps some other package that got updated. I'm not too sure🤷🏻‍♂️

Anyways that new file that's getting generated 70-no-bitmaps-except-emoji.conf has to be either removed or modified in some way for bitmap fonts to work on nixos (outside a tty session)

@acid-bong acid-bong requested a review from jtojnar October 9, 2025 03:29
@Soveu

Soveu commented Oct 9, 2025

Copy link
Copy Markdown
Contributor

Anyways that new file that's getting generated 70-no-bitmaps-except-emoji.conf has to be either removed or modified in some way for bitmap fonts to work on nixos (outside a tty session)

I'm not sure how fontconfig should be configured, but 70-no-bitmaps-except-emoji.conf lies right next to 70-yes-bitmaps.conf and these files are present both in 2.16 and 2.17 version of fontconfig

@Soveu

Soveu commented Oct 9, 2025

Copy link
Copy Markdown
Contributor

There are four different files with priority 70: https://gitlab.freedesktop.org/fontconfig/fontconfig/-/tree/main/conf.d?ref_type=heads

replaceDefaultConfig "11-lcdfilter-default.conf" "11-lcdfilter-${cfg.subpixel.lcdfilter}.conf"
)}

${lib.optionalString cfg.allowBitmaps ''

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like line 137 should be tweaked instead?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure really how to do this properly. Line 202 blindly links the configuration files, while some of them are conflicting.

@Ma27 Ma27 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please retarget to staging-nixos since this causes a rebuild of all nixos tests.
Everything in there will usually be merged with the next kernel update, i.e. ~weekly.

See also https://github.com/NixOS/nixpkgs/blob/master/CONTRIBUTING.md#changes-rebuilding-all-nixos-tests

@mcsimw

mcsimw commented Oct 9, 2025

Copy link
Copy Markdown
Contributor Author

Anyways that new file that's getting generated 70-no-bitmaps-except-emoji.conf has to be either removed or modified in some way for bitmap fonts to work on nixos (outside a tty session)

I'm not sure how fontconfig should be configured, but 70-no-bitmaps-except-emoji.conf lies right next to 70-yes-bitmaps.conf and these files are present both in 2.16 and 2.17 version of fontconfig

pretty sure I did not see 70-no-bitmaps-except-emoji.conf in my filesystem in a generation from a few days ago.

@Soveu

Soveu commented Oct 9, 2025

Copy link
Copy Markdown
Contributor

i do see them on my desktop PC, which I have not updated since monday

soveu@gaming /n/store> find . -name '70-no-bitmaps-except-emoji.conf'
./5kwqwv0l273i2c21x834friv4pwj5q5z-fontconfig-2.16.0/share/fontconfig/conf.avail/70-no-bitmaps-except-emoji.conf
./94migj77lfkqxjz8dzdicb68hgdiv53g-fontconfig-2.16.2/share/fontconfig/conf.avail/70-no-bitmaps-except-emoji.conf
./lscizzvxksjpvqd0kjkd04q264qq22yr-fontconfig-2.16.2/share/fontconfig/conf.avail/70-no-bitmaps-except-emoji.conf

@mcsimw

mcsimw commented Oct 9, 2025

Copy link
Copy Markdown
Contributor Author

i do see them on my desktop PC, which I have not updated since monday

soveu@gaming /n/store> find . -name '70-no-bitmaps-except-emoji.conf'
./5kwqwv0l273i2c21x834friv4pwj5q5z-fontconfig-2.16.0/share/fontconfig/conf.avail/70-no-bitmaps-except-emoji.conf
./94migj77lfkqxjz8dzdicb68hgdiv53g-fontconfig-2.16.2/share/fontconfig/conf.avail/70-no-bitmaps-except-emoji.conf
./lscizzvxksjpvqd0kjkd04q264qq22yr-fontconfig-2.16.2/share/fontconfig/conf.avail/70-no-bitmaps-except-emoji.conf

Is it present in /etc/fonts/conf.d? I don't think they get symlinked there in older revisions of nixpkgs.

@mcsimw mcsimw closed this Oct 9, 2025
@mcsimw mcsimw reopened this Oct 9, 2025
@mcsimw

mcsimw commented Oct 9, 2025

Copy link
Copy Markdown
Contributor Author

Closing in favor of #450484 which targets staging-nixos as requested by @Ma27

@mcsimw mcsimw closed this Oct 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-nixos-tests This PR causes rebuilds for all NixOS tests and should normally target the staging branches.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

nixos/fonts: Bitmap fonts are filtered by fontconfig

4 participants