diff options
| author | Anhgelus Morhtuuzh <william@herges.fr> | 2026-04-29 21:25:40 +0200 |
|---|---|---|
| committer | Anhgelus Morhtuuzh <william@herges.fr> | 2026-04-29 21:25:40 +0200 |
| commit | ce40702a501c3159db89693bd7da713ae1b4c011 (patch) | |
| tree | 1186ac83a59c7ce1b08b072ac82292338111824e /src/data | |
| parent | afd538d6af0baf8a1861ff2cdef881edbfb57000 (diff) | |
feat(typst): embed fonts
Diffstat (limited to 'src/data')
| -rw-r--r-- | src/data/_base.typ | 14 | ||||
| -rw-r--r-- | src/data/test_content_1.typ | 13 | ||||
| -rw-r--r-- | src/data/test_content_2.typ | 13 |
3 files changed, 20 insertions, 20 deletions
diff --git a/src/data/_base.typ b/src/data/_base.typ new file mode 100644 index 0000000..fa5b362 --- /dev/null +++ b/src/data/_base.typ @@ -0,0 +1,14 @@ +#let display(body) = context { + show math.equation: set text(font: "New Computer Modern Math") + show math.text: set text(font: "New Computer Modern") + + let margin = 4pt + let m = measure(body) + set page( + fill: none, + margin: margin, + width: m.width + margin*2, + height: m.height + margin*2, + ) + body +} diff --git a/src/data/test_content_1.typ b/src/data/test_content_1.typ index 3adf59a..e2f21a5 100644 --- a/src/data/test_content_1.typ +++ b/src/data/test_content_1.typ @@ -1,12 +1,5 @@ -#set page( - fill: none, - margin: 2pt, -); +#import "_base.typ": * -#let display(body) = context { - let m = measure(body) - set page(width: m.width + page.margin.length*2, height: m.height + page.margin.length*2) - body -} +#show: display.with() -#display()[$x$] +$text("Adwaita Mono") x$ diff --git a/src/data/test_content_2.typ b/src/data/test_content_2.typ index db02163..47666a8 100644 --- a/src/data/test_content_2.typ +++ b/src/data/test_content_2.typ @@ -1,12 +1,5 @@ -#set page( - fill: none, - margin: 2pt, -); +#import "_base.typ": * -#let display(body) = context { - let m = measure(body) - set page(width: m.width + page.margin.length*2, height: m.height + page.margin.length*2) - body -} +#show: display.with() -#display()[$x^2$] +$x^2$ |
