Merge pull request #67667 from jtojnar/default-emoji
nixos/fontconfig: Allow setting default emoji font
This commit is contained in:
commit
83d60f72ae
@ -600,6 +600,26 @@
|
|||||||
removed from nixpkgs due to lack of maintainer.
|
removed from nixpkgs due to lack of maintainer.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
Using <option>fonts.enableDefaultFonts</option> adds a default emoji font <literal>noto-fonts-emoji</literal>.
|
||||||
|
<itemizedlist>
|
||||||
|
<para>Users of the following options will have this enabled by default:</para>
|
||||||
|
<listitem>
|
||||||
|
<para><option>services.xserver.enable</option></para>
|
||||||
|
</listitem>
|
||||||
|
<listitem>
|
||||||
|
<para><option>programs.sway.enable</option></para>
|
||||||
|
</listitem>
|
||||||
|
<listitem>
|
||||||
|
<para><option>programs.way-cooler.enable</option></para>
|
||||||
|
</listitem>
|
||||||
|
<listitem>
|
||||||
|
<para><option>services.xrdp.enable</option></para>
|
||||||
|
</listitem>
|
||||||
|
</itemizedlist>
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
</itemizedlist>
|
</itemizedlist>
|
||||||
</section>
|
</section>
|
||||||
</section>
|
</section>
|
||||||
|
@ -116,7 +116,7 @@ let
|
|||||||
defaultFontsConf =
|
defaultFontsConf =
|
||||||
let genDefault = fonts: name:
|
let genDefault = fonts: name:
|
||||||
optionalString (fonts != []) ''
|
optionalString (fonts != []) ''
|
||||||
<alias>
|
<alias binding="same">
|
||||||
<family>${name}</family>
|
<family>${name}</family>
|
||||||
<prefer>
|
<prefer>
|
||||||
${concatStringsSep ""
|
${concatStringsSep ""
|
||||||
@ -139,6 +139,8 @@ let
|
|||||||
|
|
||||||
${genDefault cfg.defaultFonts.monospace "monospace"}
|
${genDefault cfg.defaultFonts.monospace "monospace"}
|
||||||
|
|
||||||
|
${genDefault cfg.defaultFonts.emoji "emoji"}
|
||||||
|
|
||||||
</fontconfig>
|
</fontconfig>
|
||||||
'';
|
'';
|
||||||
|
|
||||||
@ -344,6 +346,21 @@ in
|
|||||||
in case multiple languages must be supported.
|
in case multiple languages must be supported.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
emoji = mkOption {
|
||||||
|
type = types.listOf types.str;
|
||||||
|
default = ["Noto Color Emoji"];
|
||||||
|
description = ''
|
||||||
|
System-wide default emoji font(s). Multiple fonts may be listed
|
||||||
|
in case a font does not support all emoji.
|
||||||
|
|
||||||
|
Note that fontconfig matches color emoji fonts preferentially,
|
||||||
|
so if you want to use a black and white font while having
|
||||||
|
a color font installed (eg. Noto Color Emoji installed alongside
|
||||||
|
Noto Emoji), fontconfig will still choose the color font even
|
||||||
|
when it is later in the list.
|
||||||
|
'';
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
hinting = {
|
hinting = {
|
||||||
|
@ -43,6 +43,7 @@ with lib;
|
|||||||
pkgs.xorg.fontmiscmisc
|
pkgs.xorg.fontmiscmisc
|
||||||
pkgs.xorg.fontcursormisc
|
pkgs.xorg.fontcursormisc
|
||||||
pkgs.unifont
|
pkgs.unifont
|
||||||
|
pkgs.noto-fonts-emoji
|
||||||
];
|
];
|
||||||
|
|
||||||
};
|
};
|
||||||
|
@ -68,6 +68,7 @@ in rec {
|
|||||||
nixos.tests.chromium.x86_64-linux or []
|
nixos.tests.chromium.x86_64-linux or []
|
||||||
(all nixos.tests.firefox)
|
(all nixos.tests.firefox)
|
||||||
(all nixos.tests.firewall)
|
(all nixos.tests.firewall)
|
||||||
|
(all nixos.tests.fontconfig-default-fonts)
|
||||||
(all nixos.tests.gnome3-xorg)
|
(all nixos.tests.gnome3-xorg)
|
||||||
(all nixos.tests.gnome3)
|
(all nixos.tests.gnome3)
|
||||||
(all nixos.tests.pantheon)
|
(all nixos.tests.pantheon)
|
||||||
|
@ -87,6 +87,7 @@ in
|
|||||||
flatpak = handleTest ./flatpak.nix {};
|
flatpak = handleTest ./flatpak.nix {};
|
||||||
flatpak-builder = handleTest ./flatpak-builder.nix {};
|
flatpak-builder = handleTest ./flatpak-builder.nix {};
|
||||||
fluentd = handleTest ./fluentd.nix {};
|
fluentd = handleTest ./fluentd.nix {};
|
||||||
|
fontconfig-default-fonts = handleTest ./fontconfig-default-fonts.nix {};
|
||||||
fsck = handleTest ./fsck.nix {};
|
fsck = handleTest ./fsck.nix {};
|
||||||
fwupd = handleTestOn ["x86_64-linux"] ./fwupd.nix {}; # libsmbios is unsupported on aarch64
|
fwupd = handleTestOn ["x86_64-linux"] ./fwupd.nix {}; # libsmbios is unsupported on aarch64
|
||||||
gdk-pixbuf = handleTest ./gdk-pixbuf.nix {};
|
gdk-pixbuf = handleTest ./gdk-pixbuf.nix {};
|
||||||
|
28
nixos/tests/fontconfig-default-fonts.nix
Normal file
28
nixos/tests/fontconfig-default-fonts.nix
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
import ./make-test.nix ({ lib, ... }:
|
||||||
|
{
|
||||||
|
name = "fontconfig-default-fonts";
|
||||||
|
|
||||||
|
machine = { config, pkgs, ... }: {
|
||||||
|
fonts.enableDefaultFonts = true; # Background fonts
|
||||||
|
fonts.fonts = with pkgs; [
|
||||||
|
noto-fonts-emoji
|
||||||
|
cantarell-fonts
|
||||||
|
twitter-color-emoji
|
||||||
|
source-code-pro
|
||||||
|
gentium
|
||||||
|
];
|
||||||
|
fonts.fontconfig.defaultFonts = {
|
||||||
|
serif = [ "Gentium Plus" ];
|
||||||
|
sansSerif = [ "Cantarell" ];
|
||||||
|
monospace = [ "Source Code Pro" ];
|
||||||
|
emoji = [ "Twitter Color Emoji" ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
testScript = ''
|
||||||
|
$machine->succeed("fc-match serif | grep '\"Gentium Plus\"'");
|
||||||
|
$machine->succeed("fc-match sans-serif | grep '\"Cantarell\"'");
|
||||||
|
$machine->succeed("fc-match monospace | grep '\"Source Code Pro\"'");
|
||||||
|
$machine->succeed("fc-match emoji | grep '\"Twitter Color Emoji\"'");
|
||||||
|
'';
|
||||||
|
})
|
Loading…
x
Reference in New Issue
Block a user