diff --git a/flake.nix b/flake.nix index d0d95bd..909af02 100644 --- a/flake.nix +++ b/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" diff --git a/src/styles/opdavies-dark.yaml b/src/styles/opdavies-dark.yaml index 791ce12..eb1bca7 100644 --- a/src/styles/opdavies-dark.yaml +++ b/src/styles/opdavies-dark.yaml @@ -1,22 +1,22 @@ 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' pageSetup: diff --git a/src/styles/opdavies-light.yaml b/src/styles/opdavies-light.yaml index 89f1cab..1234d88 100644 --- a/src/styles/opdavies-light.yaml +++ b/src/styles/opdavies-light.yaml @@ -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'