From fd397003ba45af75e8dbb669aa71dc7b52ab066e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Mekina?= Date: Fri, 26 Sep 2025 11:36:52 +0200 Subject: [PATCH] tests: add base and font tests --- Makefile | 2 ++ tests/citations.bib | 0 tests/citations.typ | 4 +++ tests/fonts.typ | 59 +++++++++++++++++++++++++++++++++++++++++++++ tests/make.mk | 6 +++++ 5 files changed, 71 insertions(+) create mode 100644 tests/citations.bib create mode 100644 tests/citations.typ create mode 100644 tests/fonts.typ create mode 100644 tests/make.mk diff --git a/Makefile b/Makefile index f1624e3..20ac6ab 100644 --- a/Makefile +++ b/Makefile @@ -36,3 +36,5 @@ TEMPLATE_SRCS := $(shell find template -type f) %.pdf: %.typ $(TEMPLATE_SRCS) typst compile --font-path template/fonts $< + +include tests/make.mk diff --git a/tests/citations.bib b/tests/citations.bib new file mode 100644 index 0000000..e69de29 diff --git a/tests/citations.typ b/tests/citations.typ new file mode 100644 index 0000000..b23f06b --- /dev/null +++ b/tests/citations.typ @@ -0,0 +1,4 @@ +// todo: add citations + +#pagebreak(weak: true) +#bibliography("citations.bib", title: "Bibliography - CZ", style: "../template/tul_citace.csl") diff --git a/tests/fonts.typ b/tests/fonts.typ new file mode 100644 index 0000000..b64a866 --- /dev/null +++ b/tests/fonts.typ @@ -0,0 +1,59 @@ +#let display_font(family, weight) = { + if type(family) == type(none) { + block( + spacing: 2em, + text("Příšerně žluťoučký kůn úpěl ďábelské ódy. " + lorem(25), weight: weight) + ) + } else { + block( + spacing: 2em, + text("Příšerně žluťoučký kůn úpěl ďábelské ódy. " + lorem(25), font: family, weight: weight) + ) + } +} +#show heading.where(level: 1): it => { + v(3em); + it; +} + += #highlight[TUL Mono] + +== Regular + +#display_font("tul mono", "regular") + += #highlight[Inter] + +== Regular + +#display_font("inter", "regular") + +== Light + +#display_font("inter", "light") + +== Bold + +#display_font("inter", "bold") + +#pagebreak() + += #highlight[Default] + +== Regular + +#display_font(none, "regular") + += #highlight[Merriweather] + +== Regular + +#display_font("merriweather", "regular") + +== Light + +#display_font("merriweather", "light") + +== Bold + +#display_font("merriweather", "bold") diff --git a/tests/make.mk b/tests/make.mk new file mode 100644 index 0000000..ab448a4 --- /dev/null +++ b/tests/make.mk @@ -0,0 +1,6 @@ +.PHONY: test_% +test_%: tests/%.pdf + xdg-open $< + +tests/%.pdf: tests/%.typ + typst compile --root . --font-path template/fonts $<