Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Separate AdobeBlank-Regular.ttf from google-fonts package, moved to google-fonts.adobeBlank #103779

Merged
merged 2 commits into from Nov 23, 2020

Conversation

aakropotkin
Copy link
Contributor

@aakropotkin aakropotkin commented Nov 14, 2020

modified:   default.nix
Motivation for this change

This absurdly large font causes libfontconfig to get trapped processing for hours. It managed to break my emacs and thunderbird packages. ( emacs did manage to respond after 40+ hours of me leaving it to run, thunderbird died immediately at startup ).

Frankly I don't know what Adobe was aiming to do with this font, but it has over 550,000 symbols, which is enough to murder fontconfig. Some "ancient wisdom" left in a log from a Google dev back in 2014 was helpful, as well as some discussions about a related issue with fontconfig #101813 and #73795

I tested the build by itself, as well as across my usual NixOS system.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.


# This abomination of a font causes crashes with `libfontconfig',
# It has an absurd number of symbols
rm -r ofl/adobeblank/
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe we could add outputs = [ "out" "adobeBlank" ]; after the version attribute and use moveToOutput share/fonts/truetype/something.ttf "$adobeBlank" where something.ttf are the file names of Adobe Blank font files in installPhase.

That way it will not be installed by default but interested people will still be able to install it using google-fonts.adobeBlank.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That sounds like a good plan.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I tried using moveToOutput during installPhase, but it wasn't working as expected.
I went ahead and did it the ol' fashioned way.

rm was necessary to prevent the font from being installed to $out.

I have tested google-fonts and google-fonts.adobeBlank, and they work as expected.

@aakropotkin aakropotkin changed the title Remove AdobeBlank-Regular.ttf from google-fonts package Separate AdobeBlank-Regular.ttf from google-fonts package, moved to google-fonts.adobeBlank Nov 15, 2020
@jtojnar jtojnar merged commit 3f17975 into NixOS:master Nov 23, 2020
@jtojnar
Copy link
Contributor

jtojnar commented Nov 23, 2020

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants