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

11
devenv.nix vendored
View file

@ -3,8 +3,8 @@
let let
fontsOverlay = import ( fontsOverlay = import (
builtins.fetchTarball { builtins.fetchTarball {
url = "https://github.com/pompydev/nix-google-fonts-overlay/archive/dfb84823efeb84314f8186cb2014edf05136b527.tar.gz"; url = "https://github.com/pompydev/nix-google-fonts-overlay/archive/fc0690302d895d6813a51bcd918442f7dc9db49a.tar.gz";
sha256 = "sha256:01cpfyzd4xl3a462jyn2xn22hn6i1my1svyag7926r3r2vmck24y"; sha256 = "sha256:1mvhxl20vbccwzcr55ghlxnr8fnanbzh3jy7l4k2mzin4vmz4qan";
} }
); );
in in
@ -15,13 +15,16 @@ in
nixd nixd
nixfmt-rfc-style nixfmt-rfc-style
# fonts
font-awesome_6 font-awesome_6
google-fonts-noto-serif
google-fonts-noto-serif-kr
]; ];
scripts.compile.exec = '' scripts.compile.exec = ''
find src/ -name '*.typ' | while read file; do find src/ -name '*.typ' | while read file; do
echo "Compiling $file" echo "Compiling $file"
typst compile --root . "$file" typst compile --ignore-system-fonts --root . "$file"
done done
echo Done! echo Done!
''; '';
@ -31,6 +34,8 @@ in
enable = true; enable = true;
fontPaths = [ fontPaths = [
"${pkgs.font-awesome_6}/share/fonts/opentype" "${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 #import "../_lib/cover.typ": cover
#set page( #set page(
width: 90mm, width: page_width,
height: 140mm, height: page_height,
margin: 5mm, margin: page_margin,
numbering: "1", numbering: "1",
) )
#set text(font: default_font, size: default_font_size)
#set list(marker: "•") #set list(marker: "•")
#cover(name: "Chemistry", slug: "math") #cover(name: "Chemistry", slug: "math")

View file

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

View file

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

View file

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

View file

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

View file

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