Skip to content

Commit 05057b9

Browse files
typst brand yaml: tests for relative logo and font paths
1 parent d712fd2 commit 05057b9

8 files changed

Lines changed: 94 additions & 0 deletions

File tree

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
title: logo background
3+
brand: brand_yaml/quarto-brand.yml
4+
format:
5+
typst:
6+
keep-typ: true
7+
logo:
8+
padding: 2rem
9+
_quarto:
10+
tests:
11+
typst:
12+
ensureTypstFileRegexMatches:
13+
-
14+
- '#set page\(background: align\(center\+top, box\(inset: 2em, image\("brand_yaml/resources/quarto.png", width: 225pt\)\)\)\)'
15+
- []
16+
---
17+
18+
{{< lipsum 4 >}}
19+
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
logo:
2+
images:
3+
large-light: resources/quarto.png
4+
large: large-light
5+
defaults:
6+
quarto:
7+
format:
8+
typst:
9+
logo:
10+
src: large
11+
location: center-top
12+
width: 300px
13+
padding: 1in
11.5 KB
Loading
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
---
2+
title: title is `#context text.font`{=typst} `#context text.weight`{=typst} `#context text.style`{=typst} `#context text.size`{=typst}
3+
format: typst
4+
brand: branding/brand.yml
5+
include-in-header:
6+
text: |
7+
#set text(fallback: false)
8+
_quarto:
9+
tests:
10+
typst:
11+
ensurePdfRegexMatches:
12+
-
13+
- 'title is roboto slab semibold normal 16.5pt'
14+
- 'heading-2 is roboto slab semibold normal 15.4pt'
15+
- 'paragraph is open sans regular normal 11pt'
16+
- 'fib = num => num < 2'
17+
- []
18+
---
19+
20+
## heading-2 is `#context text.font`{=typst} `#context text.weight`{=typst} `#context text.style`{=typst} `#context text.size`{=typst}
21+
22+
paragraph is `#context text.font`{=typst} `#context text.weight`{=typst} `#context text.style`{=typst} `#context text.size`{=typst}.
23+
24+
```{=typst}
25+
#block(text(font: "Fira Code", weight: "black")[Some text with font set explicitly to #context text.font #context text.weight #context text.style #context text.size])
26+
27+
```
28+
29+
```
30+
const fib = num => num < 2 ? num : fib(num-1) + fib(num - 2);
31+
console.log(fib(12))
32+
```
33+
34+
{{< lipsum 3 >}}
35+
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
typography:
2+
fonts:
3+
- family: "Open Sans"
4+
source: file
5+
files:
6+
- resources/fonts/opensans/OpenSans-VariableFont_wdth,wght.ttf
7+
- family: "Fira Code"
8+
source: file
9+
files:
10+
- resources/fonts/firacode/FiraCode-VF.ttf
11+
- family: "Roboto Slab"
12+
source: file
13+
files:
14+
- path: resources/fonts/robotoslab/RobotoSlab-VariableFont_wght.ttf
15+
weight: 600
16+
style: normal
17+
base:
18+
family: Open Sans
19+
line-height: 1.25em
20+
size: 1rem
21+
headings:
22+
family: Roboto Slab
23+
color: primary
24+
weight: 600
25+
monospace:
26+
family: Fira Code
27+
size: 0.9em

0 commit comments

Comments
 (0)