fonts: tell websites inter is a ui font
This commit is contained in:
parent
f38be57cac
commit
029dc5d1eb
101
sets/fonts.nix
101
sets/fonts.nix
|
@ -1,34 +1,79 @@
|
|||
{ pkgs, inputs, ... }:
|
||||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
fonts = {
|
||||
fontconfig.enable = true;
|
||||
fontconfig.localConf = ''
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
|
||||
<fontconfig>
|
||||
<match target="font">
|
||||
<test name="family">
|
||||
<string>Inter</string>
|
||||
</test>
|
||||
<edit name="fontfeatures" mode="append">
|
||||
<string>tnum on</string>
|
||||
<string>ss01 on</string>
|
||||
<string>ss02 on</string>
|
||||
</edit>
|
||||
</match>
|
||||
<match target="font">
|
||||
<test name="family">
|
||||
<string>Fira Code</string>
|
||||
</test>
|
||||
<edit name="fontfeatures" mode="append">
|
||||
<string>cv06 on</string>
|
||||
<string>ss02 on</string>
|
||||
<string>ss04 on</string>
|
||||
</edit>
|
||||
</match>
|
||||
</fontconfig>
|
||||
'';
|
||||
fontconfig = {
|
||||
enable = true;
|
||||
defaultFonts = {
|
||||
sansSerif = [ "Inter" ];
|
||||
|
||||
# Not really compatible with inter but i'm used to it
|
||||
monospace = [ "Fira Code" ];
|
||||
serif = [ "DejaVu Serif" ];
|
||||
|
||||
emoji = [ "Noto Color Emoji" "Noto Emoji" ];
|
||||
};
|
||||
localConf = ''
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
|
||||
<fontconfig>
|
||||
<!-- For some reason websites really want ui font instead of default -->
|
||||
<match target="pattern">
|
||||
<test qual="any" name="family">
|
||||
<string>ui-monospace</string>
|
||||
</test>
|
||||
<edit name="family" mode="assign" binding="same">
|
||||
<string>monospace</string>
|
||||
</edit>
|
||||
</match>
|
||||
<match target="pattern">
|
||||
<test qual="any" name="family">
|
||||
<string>system-ui</string>
|
||||
</test>
|
||||
<edit name="family" mode="assign" binding="same">
|
||||
<string>sans-serif</string>
|
||||
</edit>
|
||||
</match>
|
||||
<match target="pattern">
|
||||
<test qual="any" name="family">
|
||||
<string>BlinkMacSystemFont</string>
|
||||
</test>
|
||||
<edit name="family" mode="assign" binding="same">
|
||||
<string>sans-serif</string>
|
||||
</edit>
|
||||
</match>
|
||||
<match target="pattern">
|
||||
<test qual="any" name="family">
|
||||
<string>-apple-system</string>
|
||||
</test>
|
||||
<edit name="family" mode="assign" binding="same">
|
||||
<string>sans-serif</string>
|
||||
</edit>
|
||||
</match>
|
||||
|
||||
<match target="font">
|
||||
<test name="family">
|
||||
<string>Inter</string>
|
||||
</test>
|
||||
<edit name="fontfeatures" mode="append">
|
||||
<string>tnum on</string>
|
||||
<string>ss01 on</string>
|
||||
<string>ss02 on</string>
|
||||
</edit>
|
||||
</match>
|
||||
<match target="font">
|
||||
<test name="family">
|
||||
<string>Fira Code</string>
|
||||
</test>
|
||||
<edit name="fontfeatures" mode="append">
|
||||
<string>cv06 on</string>
|
||||
<string>ss02 on</string>
|
||||
<string>ss04 on</string>
|
||||
</edit>
|
||||
</match>
|
||||
</fontconfig>
|
||||
'';
|
||||
};
|
||||
|
||||
enableDefaultPackages = true;
|
||||
packages = with pkgs;
|
||||
|
|
Loading…
Reference in a new issue