Remove font files, use fonts from the Nix store
This commit is contained in:
parent
68869f59e7
commit
e24d2df83f
3 changed files with 56 additions and 33 deletions
27
flake.nix
27
flake.nix
|
@ -7,9 +7,31 @@
|
|||
system = "x86_64-linux";
|
||||
pkgs = import nixpkgs { inherit system; };
|
||||
|
||||
inherit (pkgs) lib;
|
||||
inherit (nixpkgs.lib) makeOverridable;
|
||||
inherit (pkgs.stdenvNoCC) mkDerivation;
|
||||
|
||||
interStaticFonts = mkDerivation {
|
||||
pname = "inter-static-fonts";
|
||||
version = "4.1";
|
||||
|
||||
src = pkgs.fetchzip {
|
||||
url = "https://github.com/rsms/inter/releases/download/v4.1/Inter-4.1.zip";
|
||||
sha256 = "sha256-5vdKKvHAeZi6igrfpbOdhZlDX2/5+UvzlnCQV6DdqoQ=";
|
||||
stripRoot = false;
|
||||
};
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/share/fonts/truetype
|
||||
cp $src/extras/ttf/*.ttf $out/share/fonts/truetype
|
||||
'';
|
||||
};
|
||||
|
||||
fontPaths = lib.concatStringsSep ":" [
|
||||
"${pkgs.inconsolata}/share/fonts/truetype/inconsolata"
|
||||
"${interStaticFonts}/share/fonts/truetype"
|
||||
];
|
||||
|
||||
shared-assets = mkDerivation {
|
||||
name = "talks-shared-assets";
|
||||
src = ./src;
|
||||
|
@ -18,13 +40,14 @@
|
|||
runHook preInstall
|
||||
|
||||
mkdir $out
|
||||
cp -r fonts styles $out
|
||||
cp -r styles $out
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
};
|
||||
|
||||
commonBuildInputs = with pkgs; [
|
||||
interStaticFonts
|
||||
(python310.withPackages (p: with p; [ rst2pdf ]))
|
||||
];
|
||||
|
||||
|
@ -48,7 +71,7 @@
|
|||
--break-level 1 \
|
||||
--extension-module preprocess \
|
||||
--fit-background-mode scale \
|
||||
--font-path "${toString shared-assets}/fonts" \
|
||||
--font-path "${fontPaths}" \
|
||||
--output slides.pdf \
|
||||
--stylesheets bw,"${toString shared-assets}/styles/opdavies-light"
|
||||
|
||||
|
|
|
@ -1,21 +1,21 @@
|
|||
embeddedFonts:
|
||||
- - Inconsolata.ttf
|
||||
- Inconsolata.ttf
|
||||
- Inconsolata.ttf
|
||||
- Inconsolata.ttf
|
||||
- - Helvetica.ttf
|
||||
- Helvetica-Bold.ttf
|
||||
- Helvetica.ttf
|
||||
- Helvetica-Bold.ttf
|
||||
- - Inconsolata-Regular.ttf
|
||||
- Inconsolata-Regular.ttf
|
||||
- Inconsolata-Regular.ttf
|
||||
- Inconsolata-Regular.ttf
|
||||
- - Inter-Regular.ttf
|
||||
- Inter-Bold.ttf
|
||||
- Inter-Regular.ttf
|
||||
- Inter-Bold.ttf
|
||||
|
||||
fontsAlias:
|
||||
fontBold: Helvetica-Bold
|
||||
fontFont: Helvetica
|
||||
fontItalic: Helvetica
|
||||
fontMono: Inconsolata
|
||||
fontMonoBold: Inconsolata
|
||||
fontMonoBoldItalic: Inconsolata
|
||||
fontMonoItalic: Inconsolata
|
||||
fontBold: Inter-Bold
|
||||
fontFont: Inter-Regular
|
||||
fontItalic: Inter-Regular
|
||||
fontMono: inconsolata
|
||||
fontMonoBold: inconsolata
|
||||
fontMonoBoldItalic: inconsolata
|
||||
fontMonoItalic: inconsolata
|
||||
|
||||
linkColor: '#60a5fa'
|
||||
|
||||
|
|
|
@ -1,21 +1,21 @@
|
|||
embeddedFonts:
|
||||
- - Inconsolata.ttf
|
||||
- Inconsolata.ttf
|
||||
- Inconsolata.ttf
|
||||
- Inconsolata.ttf
|
||||
- - Helvetica.ttf
|
||||
- Helvetica-Bold.ttf
|
||||
- Helvetica.ttf
|
||||
- Helvetica-Bold.ttf
|
||||
- - Inconsolata-Regular.ttf
|
||||
- Inconsolata-Regular.ttf
|
||||
- Inconsolata-Regular.ttf
|
||||
- Inconsolata-Regular.ttf
|
||||
- - Inter-Regular.ttf
|
||||
- Inter-Bold.ttf
|
||||
- Inter-Regular.ttf
|
||||
- Inter-Bold.ttf
|
||||
|
||||
fontsAlias:
|
||||
fontBold: Helvetica-Bold
|
||||
fontFont: Helvetica
|
||||
fontItalic: Helvetica
|
||||
fontMono: Inconsolata
|
||||
fontMonoBold: Inconsolata
|
||||
fontMonoBoldItalic: Inconsolata
|
||||
fontMonoItalic: Inconsolata
|
||||
fontBold: Inter-Bold
|
||||
fontFont: Inter-Regular
|
||||
fontItalic: Inter-Regular
|
||||
fontMono: inconsolata
|
||||
fontMonoBold: inconsolata
|
||||
fontMonoBoldItalic: inconsolata
|
||||
fontMonoItalic: inconsolata
|
||||
|
||||
linkColor: '#24608a'
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue