From 9694701024283d3a12fa283105489069da2b97a0 Mon Sep 17 00:00:00 2001 From: servostar Date: Thu, 28 Mar 2024 17:15:34 +0100 Subject: [PATCH] make utils follow font size --- src/extra/util.typ | 39 +++++++++++++++++++++------------------ 1 file changed, 21 insertions(+), 18 deletions(-) diff --git a/src/extra/util.typ b/src/extra/util.typ index 84a0dc7..1820b31 100644 --- a/src/extra/util.typ +++ b/src/extra/util.typ @@ -1,22 +1,37 @@ -#let TitleSize = 24pt -#let SubtitleSize = 18pt -#let LargetextSize = 14pt +// general document information +#let format = yaml("../../conf/format.yaml") + +#let TitleSize = 2 +#let SubtitleSize = 1.5 +#let LargetextSize = 1.25 + +#let to_em(x) = { + x * 1em +} + +#let to_cm(x) = { + x * 1cm +} + +#let to_pt(x) = { + x * 1pt +} // titles are bold and twice the size of normal text // also they are centered and not justified #let title(x) = { - align(center, par(justify: false, text(weight: "regular", size: TitleSize)[#x])) + align(center, par(justify: false, text(weight: "regular", size: to_pt(format.font-size) * TitleSize)[#x])) } // subtitles are 1.5x the size of normal text // also they are centered and not justified #let subtitle(x) = { - par(justify: false, text(size: SubtitleSize)[#x]) + par(justify: false, text(size: to_pt(format.font-size) * SubtitleSize)[#x]) } #let largetext(x) = { - par(justify: false, text(size: LargetextSize)[#x]) + par(justify: false, text(size: to_pt(format.font-size) * LargetextSize)[#x]) } #let signature = { @@ -33,15 +48,3 @@ align(left, "Unterschrift") ) } - -#let to_em(x) = { - x * 1em -} - -#let to_cm(x) = { - x * 1cm -} - -#let to_pt(x) = { - x * 1pt -} \ No newline at end of file