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

150 lines
4.8 KiB
Nix
Raw Normal View History

{
pkgs,
niveumPackages,
...
}: let
2022-09-23 09:32:03 +02:00
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 \;
'';
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";
2023-02-06 21:39:29 +01:00
sha256 = "sha256-KbY4vedm757NWfDlgmNhslbZd+2Vs+o5PjtMMGDt61Y=";
};
2024-06-17 11:53:59 +02:00
brill = zip-font "Brill" {
url = "https://brill.com/fileasset/The_Brill_Typeface_Package_v_4_0.zip";
stripRoot = false;
hash = "sha256-ugmEIkeBzD/4C9wkVfbctEtnzI8Kw+YD6KGcbk4BAf4=";
};
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
junicode2 = zip-font "JunicodeTwo" {
url = "https://github.com/psb1558/Junicode-font/archive/48bf476db278c844c67542b04d1e0e4c71f139d2.zip";
sha256 = "1ryicc155vkvgv3315ddliigwa01afwyb4c4f6pnqcns03af001i";
};
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";
};
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
junicode2
2024-04-03 00:46:00 +02:00
koineGreek
2024-06-17 11:53:59 +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
2024-03-19 23:15:35 +01:00
# niveumPackages.gfs-fonts
2022-04-13 09:01:16 +02:00
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
2019-09-25 10:11:18 +02:00
roboto
roboto-mono
2022-08-21 01:01:47 +02:00
noto-fonts
2022-08-22 10:30:15 +02:00
noto-fonts-cjk
2022-08-18 18:46:54 +02:00
noto-fonts-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
niveumPackages.tocharian-font
2022-04-13 09:01:16 +02:00
vistafonts
vollkorn
zilla-slab
]; # google-fonts league-of-moveable-type
2022-09-19 07:29:47 +02:00
fontconfig.defaultFonts = rec {
monospace = ["Noto Sans Mono"] ++ emoji;
2022-08-21 01:01:47 +02:00
serif = ["Noto Serif" "Noto Naskh Arabic" "Noto Serif Devanagari"];
2023-12-21 19:19:30 +01:00
sansSerif = ["Noto Sans Display" "Noto Naskh Arabic" "Noto Sans Hebrew" "Noto Sans Devanagari" "Noto Sans CJK JP" "Noto Sans Coptic"];
2022-09-19 07:29:47 +02:00
emoji = ["Noto Color Emoji"];
2019-09-24 23:31:22 +02:00
};
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
};
}