tests: add base and font tests

This commit is contained in:
2025-09-26 11:36:52 +02:00
parent 35cc041d6e
commit fd397003ba
5 changed files with 71 additions and 0 deletions

View File

@@ -36,3 +36,5 @@ TEMPLATE_SRCS := $(shell find template -type f)
%.pdf: %.typ $(TEMPLATE_SRCS) %.pdf: %.typ $(TEMPLATE_SRCS)
typst compile --font-path template/fonts $< typst compile --font-path template/fonts $<
include tests/make.mk

0
tests/citations.bib Normal file
View File

4
tests/citations.typ Normal file
View File

@@ -0,0 +1,4 @@
// todo: add citations
#pagebreak(weak: true)
#bibliography("citations.bib", title: "Bibliography - CZ", style: "../template/tul_citace.csl")

59
tests/fonts.typ Normal file
View File

@@ -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")

6
tests/make.mk Normal file
View File

@@ -0,0 +1,6 @@
.PHONY: test_%
test_%: tests/%.pdf
xdg-open $<
tests/%.pdf: tests/%.typ
typst compile --root . --font-path template/fonts $<