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";
|
system = "x86_64-linux";
|
||||||
pkgs = import nixpkgs { inherit system; };
|
pkgs = import nixpkgs { inherit system; };
|
||||||
|
|
||||||
|
inherit (pkgs) lib;
|
||||||
inherit (nixpkgs.lib) makeOverridable;
|
inherit (nixpkgs.lib) makeOverridable;
|
||||||
inherit (pkgs.stdenvNoCC) mkDerivation;
|
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 {
|
shared-assets = mkDerivation {
|
||||||
name = "talks-shared-assets";
|
name = "talks-shared-assets";
|
||||||
src = ./src;
|
src = ./src;
|
||||||
|
@ -18,13 +40,14 @@
|
||||||
runHook preInstall
|
runHook preInstall
|
||||||
|
|
||||||
mkdir $out
|
mkdir $out
|
||||||
cp -r fonts styles $out
|
cp -r styles $out
|
||||||
|
|
||||||
runHook postInstall
|
runHook postInstall
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
commonBuildInputs = with pkgs; [
|
commonBuildInputs = with pkgs; [
|
||||||
|
interStaticFonts
|
||||||
(python310.withPackages (p: with p; [ rst2pdf ]))
|
(python310.withPackages (p: with p; [ rst2pdf ]))
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -48,7 +71,7 @@
|
||||||
--break-level 1 \
|
--break-level 1 \
|
||||||
--extension-module preprocess \
|
--extension-module preprocess \
|
||||||
--fit-background-mode scale \
|
--fit-background-mode scale \
|
||||||
--font-path "${toString shared-assets}/fonts" \
|
--font-path "${fontPaths}" \
|
||||||
--output slides.pdf \
|
--output slides.pdf \
|
||||||
--stylesheets bw,"${toString shared-assets}/styles/opdavies-light"
|
--stylesheets bw,"${toString shared-assets}/styles/opdavies-light"
|
||||||
|
|
||||||
|
|
|
@ -1,22 +1,22 @@
|
||||||
embeddedFonts:
|
embeddedFonts:
|
||||||
- - Inconsolata.ttf
|
- - Inconsolata-Regular.ttf
|
||||||
- Inconsolata.ttf
|
- Inconsolata-Regular.ttf
|
||||||
- Inconsolata.ttf
|
- Inconsolata-Regular.ttf
|
||||||
- Inconsolata.ttf
|
- Inconsolata-Regular.ttf
|
||||||
- - Helvetica.ttf
|
- - Inter-Regular.ttf
|
||||||
- Helvetica-Bold.ttf
|
- Inter-Bold.ttf
|
||||||
- Helvetica.ttf
|
- Inter-Regular.ttf
|
||||||
- Helvetica-Bold.ttf
|
- Inter-Bold.ttf
|
||||||
|
|
||||||
fontsAlias:
|
fontsAlias:
|
||||||
fontBold: Helvetica-Bold
|
fontBold: Inter-Bold
|
||||||
fontFont: Helvetica
|
fontFont: Inter-Regular
|
||||||
fontItalic: Helvetica
|
fontItalic: Inter-Regular
|
||||||
fontMono: Inconsolata
|
fontMono: inconsolata
|
||||||
fontMonoBold: Inconsolata
|
fontMonoBold: inconsolata
|
||||||
fontMonoBoldItalic: Inconsolata
|
fontMonoBoldItalic: inconsolata
|
||||||
fontMonoItalic: Inconsolata
|
fontMonoItalic: inconsolata
|
||||||
|
|
||||||
linkColor: '#60a5fa'
|
linkColor: '#60a5fa'
|
||||||
|
|
||||||
pageSetup:
|
pageSetup:
|
||||||
|
|
|
@ -1,21 +1,21 @@
|
||||||
embeddedFonts:
|
embeddedFonts:
|
||||||
- - Inconsolata.ttf
|
- - Inconsolata-Regular.ttf
|
||||||
- Inconsolata.ttf
|
- Inconsolata-Regular.ttf
|
||||||
- Inconsolata.ttf
|
- Inconsolata-Regular.ttf
|
||||||
- Inconsolata.ttf
|
- Inconsolata-Regular.ttf
|
||||||
- - Helvetica.ttf
|
- - Inter-Regular.ttf
|
||||||
- Helvetica-Bold.ttf
|
- Inter-Bold.ttf
|
||||||
- Helvetica.ttf
|
- Inter-Regular.ttf
|
||||||
- Helvetica-Bold.ttf
|
- Inter-Bold.ttf
|
||||||
|
|
||||||
fontsAlias:
|
fontsAlias:
|
||||||
fontBold: Helvetica-Bold
|
fontBold: Inter-Bold
|
||||||
fontFont: Helvetica
|
fontFont: Inter-Regular
|
||||||
fontItalic: Helvetica
|
fontItalic: Inter-Regular
|
||||||
fontMono: Inconsolata
|
fontMono: inconsolata
|
||||||
fontMonoBold: Inconsolata
|
fontMonoBold: inconsolata
|
||||||
fontMonoBoldItalic: Inconsolata
|
fontMonoBoldItalic: inconsolata
|
||||||
fontMonoItalic: Inconsolata
|
fontMonoItalic: inconsolata
|
||||||
|
|
||||||
linkColor: '#24608a'
|
linkColor: '#24608a'
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue