Skip to content

Add packages for a number of fonts. - #6793

Merged
vcunat merged 2 commits into
NixOS:masterfrom
rycee:fonts
Apr 9, 2015
Merged

vcunat merged 2 commits into
NixOS:masterfrom
rycee:fonts

Conversation

@rycee

@rycee rycee commented Mar 13, 2015

Copy link
Copy Markdown
Member

These are some packages for some nice fonts I like. Some of these also add fontconfig configs to establish aliases with popular Microsoft fonts but I am uncertain what is the best way to install those. I've manually added

<include ignore_missing="yes">~/.nix-profile/etc/fonts/conf.d</include>

to my fonts.conf file but some more smooth solution should hopefully be possible.

The added fonts are

  • Caladea,
  • Carlito,
  • Comfortaa,
  • Comic Relief,
  • Fantasque Sans Mono,
  • Lobster Two,
  • Pecita,
  • Quattrocento, and
  • Quattrocento Sans.

Also added is a set "fonts" giving, for example, Pecita the attribute path "fonts.pecita". Again, I am not certain if this would be considered best practice or I instead should put them in the "global path".

@Fuuzetsu Fuuzetsu added the 9.needs: reporter feedback This issue needs the person who filed it to respond label Mar 13, 2015
@vcunat

vcunat commented Mar 17, 2015

Copy link
Copy Markdown
Member
  • The fonts attribute: up to now we were putting almost everything directly into the top level, including all fonts AFAIK. I would either have all fonts under the attribute or none. Also, I think we would need recurseIntoAttrs for the fonts to be usable by nix-env.

  • Installable fonts.conf files: this use case hasn't occurred to me. /cc @ttuegel, @lethalman. At first blush, I think we should add this to the default font config (to cover both nix-env and systemPackages):

    <include ignore_missing="yes">~/.nix-profile/etc/fonts/conf.d</include>
    <include ignore_missing="yes">/run/current-system/sw/etc/fonts/conf.d</include>
    

    Which reminds me that there's special fonts.fonts not covered by either... I don't know right now what's best.

@rycee

rycee commented Mar 17, 2015

Copy link
Copy Markdown
Member Author

Agreed about having either all fonts under the fonts attribute or none. For this I have no preference one way or another, I mainly liked having fonts somewhat more easily discoverable.

An additional complication about the fonts config is that you may or may not want to have a particular configuration enabled. For example, if you already have the Microsoft core fonts installed then you may not want to have "Comic Relief" install itself as an alias for "Comic Sans". The way, for example, Debian solves this is to have the font package install its configuration file into /etc/fonts/conf.avail/ and symlink to it from /etc/fonts/conf.d/. If you then don't want a particular configuration enabled you remove the corresponding symlink from /etc/fonts/conf.d/.

@rycee

rycee commented Mar 19, 2015

Copy link
Copy Markdown
Member Author

I have now force-pushed an updated commit which no longer contains a fonts set. Instead the derivations are placed as attributes directly in all-packages.nix (together with existing fonts packages). I still am uncertain about the fontconfig configs, though. Would it be sufficient for now to have a boolean argument to the expression that enables/disables installation of the aliases? That is, something like comic-relief.override { enableAlias = false; } would not install the "Comic Sans MS" alias.

@vcunat

vcunat commented Mar 20, 2015

Copy link
Copy Markdown
Member

Idea: what about naming each fontconfig file by the font-family name that it overrides. Those file collisions would then be resolved by standard priorities that users can set. (We would need to add some files of those names to the original fonts as well, e.g. valid empty font configs.)

@rycee

rycee commented Mar 20, 2015

Copy link
Copy Markdown
Member Author

@vcunat: That sounds really quite clever. I can give that a try. Haven't played around with priorities yet so I'm happy to get the practice :-)

rycee added 2 commits March 21, 2015 00:33
With these fontconfig files it becomes possible for other packages to
configure font aliases for the Microsoft fonts. If both, for example,
vista-fonts and some package providing an alias for Cambria are
installed then the user may control whether or not the alias is active
by manipulating the package priorities.
The added fonts are

 - Caladea,
 - Carlito,
 - Comfortaa,
 - Comic Relief,
 - Crimson,
 - Fantasque Sans Mono,
 - Lobster Two,
 - Pecita,
 - Quattrocento, and
 - Quattrocento Sans.
@rycee

rycee commented Mar 21, 2015

Copy link
Copy Markdown
Member Author

I've force-pushed commits with the priority thing implemented. I've tried it out a bit and I think it works very well.

vcunat added a commit that referenced this pull request Apr 9, 2015
Also handle font-family aliases.
@vcunat

vcunat commented Apr 9, 2015

Copy link
Copy Markdown
Member

It's probably fine. I'm sorry I took so long to get back.

@vcunat
vcunat merged commit cebc434 into NixOS:master Apr 9, 2015
vcunat added a commit that referenced this pull request Apr 9, 2015
Also handle font-family aliases.
(I'm sorry about the bad commit above.)
@rycee

rycee commented Apr 9, 2015

Copy link
Copy Markdown
Member Author

That's ok. Thanks a lot for your input, I'm quite pleased with how it turned out.

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

Labels

9.needs: reporter feedback This issue needs the person who filed it to respond

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants