1
0
Fork 0

explicitly set fonts used

This commit is contained in:
Kim, Jimin 2025-05-20 19:09:48 +09:00
parent b1022bf6ec
commit 6068889397
Signed by: pomp
GPG key ID: D3932F82A0667A3B
9 changed files with 44 additions and 22 deletions

View file

@ -20,6 +20,7 @@
"nixfmt",
"nixos",
"nixpkgs",
"noto",
"opentype",
"pagebreak",
"pinit",
@ -42,7 +43,6 @@
"editor.defaultFormatter": "myriad-dreamin.tinymist"
},
"tinymist.formatterMode": "typstyle",
"tinymist.exportPdf": "onSave",
"[jsonc]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"

11
devenv.nix vendored
View file

@ -3,8 +3,8 @@
let
fontsOverlay = import (
builtins.fetchTarball {
url = "https://github.com/pompydev/nix-google-fonts-overlay/archive/dfb84823efeb84314f8186cb2014edf05136b527.tar.gz";
sha256 = "sha256:01cpfyzd4xl3a462jyn2xn22hn6i1my1svyag7926r3r2vmck24y";
url = "https://github.com/pompydev/nix-google-fonts-overlay/archive/fc0690302d895d6813a51bcd918442f7dc9db49a.tar.gz";
sha256 = "sha256:1mvhxl20vbccwzcr55ghlxnr8fnanbzh3jy7l4k2mzin4vmz4qan";
}
);
in
@ -15,13 +15,16 @@ in
nixd
nixfmt-rfc-style
# fonts
font-awesome_6
google-fonts-noto-serif
google-fonts-noto-serif-kr
];
scripts.compile.exec = ''
find src/ -name '*.typ' | while read file; do
echo "Compiling $file"
typst compile --root . "$file"
typst compile --ignore-system-fonts --root . "$file"
done
echo Done!
'';
@ -31,6 +34,8 @@ in
enable = true;
fontPaths = [
"${pkgs.font-awesome_6}/share/fonts/opentype"
"${pkgs.google-fonts-noto-serif}/share/fonts/truetype"
"${pkgs.google-fonts-noto-serif-kr}/share/fonts/truetype"
];
};
}

5
src/_lib/const.typ Normal file
View file

@ -0,0 +1,5 @@
#let page_width = 90mm
#let page_height = 140mm
#let page_margin = 5mm
#let default_font = ("Noto Serif", "Noto Serif KR")
#let default_font_size = 10pt

View file

@ -1,11 +1,13 @@
#import "../_lib/const.typ": *
#import "../_lib/cover.typ": cover
#set page(
width: 90mm,
height: 140mm,
margin: 5mm,
width: page_width,
height: page_height,
margin: page_margin,
numbering: "1",
)
#set text(font: default_font, size: default_font_size)
#set list(marker: "•")
#cover(name: "Chemistry", slug: "math")

View file

@ -1,11 +1,13 @@
#import "../_lib/const.typ": *
#import "../_lib/cover.typ": cover
#set page(
width: 90mm,
height: 140mm,
margin: 5mm,
width: page_width,
height: page_height,
margin: page_margin,
numbering: "1",
)
#set text(font: default_font, size: default_font_size)
#set list(marker: "•")
#cover(name: "Computer Science", slug: "cs")

View file

@ -1,11 +1,13 @@
#import "../_lib/const.typ": *
#import "../_lib/cover.typ": cover
#set page(
width: 90mm,
height: 140mm,
margin: 5mm,
width: page_width,
height: page_height,
margin: page_margin,
numbering: "1",
)
#set text(font: default_font, size: default_font_size)
#set list(marker: "•")
#cover(name: "Electrical Engineering", slug: "ee")

View file

@ -1,14 +1,16 @@
#import "../_lib/const.typ": *
#import "../_lib/cover.typ": cover
#import "@preview/fletcher:0.5.7"
#import fletcher: diagram, node, edge
#import "@preview/pinit:0.2.2": *
#set page(
width: 90mm,
height: 140mm,
margin: 5mm,
width: page_width,
height: page_height,
margin: page_margin,
numbering: "1",
)
#set text(font: default_font, size: default_font_size)
#set list(marker: "•")
#cover(name: "Mathematics", slug: "math")

View file

@ -1,11 +1,13 @@
#import "../_lib/const.typ": *
#import "../_lib/cover.typ": cover
#set page(
width: 90mm,
height: 140mm,
margin: 5mm,
width: page_width,
height: page_height,
margin: page_margin,
numbering: "1",
)
#set text(font: default_font, size: default_font_size)
#set list(marker: "•")
#cover(name: "Neuroscience", slug: "neuro")

View file

@ -1,11 +1,13 @@
#import "../_lib/const.typ": *
#import "../_lib/cover.typ": cover
#set page(
width: 90mm,
height: 140mm,
margin: 5mm,
width: page_width,
height: page_height,
margin: page_margin,
numbering: "1",
)
#set text(font: default_font, size: default_font_size)
#set list(marker: "•")
#cover(name: "Physics", slug: "phy")