1
0
mirror of https://github.com/kmein/niveum synced 2026-03-16 10:11:08 +01:00
Files
niveum/configs/fonts.nix

162 lines
4.6 KiB
Nix
Raw Normal View History

{
pkgs,
...
2025-12-27 22:22:54 +01:00
}:
let
zip-font =
name: arguments:
let
directory = pkgs.fetchzip arguments;
in
pkgs.runCommand name { } ''
2022-09-23 09:32:03 +02:00
mkdir -p $out/share/fonts/{truetype,opentype,woff}
${pkgs.findutils}/bin/find ${directory} -name '*.ttf' -exec install '{}' $out/share/fonts/truetype \;
${pkgs.findutils}/bin/find ${directory} -name '*.otf' -exec install '{}' $out/share/fonts/opentype \;
2022-09-23 09:32:03 +02:00
${pkgs.findutils}/bin/find ${directory} -name '*.woff' -exec install '{}' $out/share/fonts/woff \;
'';
2025-12-27 22:22:54 +01:00
simple-ttf =
name: arguments:
let
file = pkgs.fetchurl arguments;
in
pkgs.runCommand name { } ''
mkdir -p $out/share/fonts/truetype
install ${file} $out/share/fonts/truetype
'';
2022-09-23 09:32:03 +02:00
egyptianHiero = zip-font "EgyptianHiero" {
url = "https://github.com/MKilani/Djehuty/archive/master.zip";
2024-12-31 14:03:36 +01:00
sha256 = "sha256-S3vZxdeBj57KJsF+zaZw7sQw8T+z1aVC2CnpnZ0/x2c=";
};
2022-09-23 09:32:03 +02:00
antinoou = zip-font "Antinoou" {
url = "https://www.evertype.com/fonts/coptic/AntinoouFont.zip";
sha256 = "0jwihj08n4yrshcx07dnaml2x9yws6dgyjkvg19jqbz17drbp3sw";
stripRoot = false;
};
2022-09-23 09:32:03 +02:00
newGardiner = zip-font "NewGardiner" {
url = "https://mjn.host.cs.st-andrews.ac.uk/egyptian/fonts/NewGardiner.zip";
2023-12-23 07:38:59 +01:00
hash = "sha256-nP0y4ILt+0mlkDRdCNSeO2Gequ8wyix/qQdmujTNw3Y=";
stripRoot = false;
};
2022-09-23 09:32:03 +02:00
newAthenaUnicode = zip-font "NewAthenaUnicode" {
url = "https://classicalstudies.org/sites/default/files/userfiles/files/NAU5_005.zip";
sha256 = "1g7qk9gl4nq2dz41bvck1nzilhin44j8691cxax3dlp77bbn9bxr";
};
jsesh = simple-ttf "JSesh" {
url = "http://files.qenherkhopeshef.org/jsesh/JSeshFont.ttf";
sha256 = "1203jrk2xzvgckcc5hx88kja1i3h8gm1wiyla5j6gspc0hbv56ry";
};
2024-05-04 09:35:54 +02:00
egyptianTextBeta = simple-ttf "EgyptianText-1.0beta" {
url = "http://c.krebsco.de/EgyptianText-v1.0-beta.ttf";
sha256 = "0cfjbk7xxnxhlp6v922psm5j1xzrv6wfk226ji2wz2yfrnkbcbsv";
};
2024-05-04 09:35:54 +02:00
coranica = simple-ttf "Coranica" {
url = "https://corpuscoranicum.de/fonts/coranica_1164.ttf";
sha256 = "0igi8q8b2p38x9jq8c98afsl7bf8rj32zj2052yyjgj9r88y4yi5";
};
2024-04-03 00:46:00 +02:00
koineGreek = simple-ttf "KoineGreek.ttf" {
url = "https://github.com/Center-for-New-Testament-Restoration/font/raw/af83eed50105344edaa5e5eddaf87696e271468c/KoineGreek.ttf";
hash = "sha256-YtC+nj7+Jl8k00rqAAqySYc8iTAOL7PixXc+LfSmnS0=";
};
2024-05-04 09:35:54 +02:00
egyptianText = simple-ttf "EgyptianText" {
url = "https://github.com/microsoft/font-tools/raw/1092cb23520967830001a0807eb21d6a44dda522/EgyptianOpenType/font/eot.ttf";
sha256 = "1n294vhcx90270pnsw1dbk6izd61fjvbnjrh4hcf98ff3s540x0c";
};
2025-12-27 22:22:54 +01:00
in
{
2019-04-19 15:02:05 +02:00
fonts = {
2023-12-06 14:41:49 +01:00
enableDefaultPackages = true;
2021-06-01 19:14:00 +02:00
fontDir.enable = true;
2023-12-06 14:41:49 +01:00
packages = with pkgs; [
2021-11-12 20:04:16 +01:00
alegreya
alegreya-sans
2022-04-13 09:01:16 +02:00
amiri
annapurna-sil
antinoou
2022-04-13 09:01:16 +02:00
cantarell-fonts
2022-09-16 09:27:47 +02:00
cardo
2022-04-13 09:01:16 +02:00
charis-sil
doulos-sil
newAthenaUnicode
2024-05-04 09:35:54 +02:00
coranica
2019-09-25 10:11:18 +02:00
corefonts
2022-04-13 09:01:16 +02:00
crimson
2019-09-25 10:11:18 +02:00
eb-garamond
2023-05-17 11:15:53 +02:00
ipaexfont
jsesh
egyptianHiero
egyptianText
2024-05-04 09:35:54 +02:00
egyptianTextBeta
2022-08-21 01:01:08 +02:00
font-awesome_6
2022-04-13 09:01:16 +02:00
etBook
newGardiner
junicode
2024-04-03 00:46:00 +02:00
koineGreek
2025-06-03 14:55:03 +02:00
# brill
ezra-sil
2019-09-25 10:11:18 +02:00
fira
font-awesome
galatia-sil
2022-04-13 09:01:16 +02:00
gentium
gyre-fonts
2019-09-25 10:11:18 +02:00
ibm-plex
2022-04-13 09:01:16 +02:00
jetbrains-mono
libertinus
libre-bodoni
2019-09-25 10:11:18 +02:00
lmodern
2022-04-13 09:01:16 +02:00
merriweather
ocr-a
2025-11-01 20:38:27 +01:00
montserrat
2019-09-25 10:11:18 +02:00
roboto
roboto-mono
2022-08-21 01:01:47 +02:00
noto-fonts
2024-12-13 13:42:16 +01:00
noto-fonts-cjk-sans
2025-12-02 21:37:02 +01:00
noto-fonts-color-emoji
2019-09-25 10:11:18 +02:00
roboto-slab
2022-04-13 09:01:16 +02:00
scheherazade-new
2019-09-25 10:11:18 +02:00
source-code-pro
2020-05-15 08:06:28 +02:00
source-sans-pro
2022-04-13 09:01:16 +02:00
source-serif-pro
theano
tocharian-font
2025-12-02 21:37:02 +01:00
vista-fonts
2022-04-13 09:01:16 +02:00
vollkorn
zilla-slab
]; # google-fonts league-of-moveable-type
2025-12-27 22:22:54 +01:00
fontconfig.defaultFonts =
let
emoji = [ "Noto Color Emoji" ];
in
{
monospace = [ "Noto Sans Mono" ] ++ emoji;
serif = [
"Noto Serif"
"Noto Naskh Arabic"
"Noto Serif Devanagari"
];
sansSerif = [
"Noto Sans Display"
"Noto Naskh Arabic"
"Noto Sans Hebrew"
"Noto Sans Devanagari"
"Noto Sans CJK JP"
"Noto Sans Coptic"
"Noto Sans Syriac Western"
];
inherit emoji;
};
2023-02-06 21:39:29 +01:00
# xelatex fails with woff files
# ref https://tex.stackexchange.com/questions/392144/xelatex-and-fontspec-crash-trying-to-find-woff-file-for-some-fonts-but-not-other
fontconfig.localConf = ''
<fontconfig>
<!-- Reject WOFF fonts We don't register WOFF(2) fonts with fontconfig because of the W3C spec -->
<selectfont>
<rejectfont>
<glob>*.woff*</glob>
</rejectfont>
</selectfont>
</fontconfig>
'';
2019-04-19 15:02:05 +02:00
};
}