-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathquick-reply.typ
More file actions
57 lines (52 loc) · 1.62 KB
/
quick-reply.typ
File metadata and controls
57 lines (52 loc) · 1.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#set page(width: 256pt, height: 256pt, margin: 0pt, fill: none)
#set text(font: "Inter Khmer Looped", weight: "bold", size: 48pt, fill: white, stroke: (1pt + black))
// fit-to-width function from https://github.com/mtolk/one-liner/blob/master/lib.typ
#let fit-to-width(max-text-size: 256pt, min-text-size: 8pt, it) = context {
let contentsize = measure(it)
layout(size => {
if contentsize.width > 0pt {
// Prevent failure on empty content
let ratio-x = size.width / contentsize.width
let ratio-y = size.height / contentsize.height
let ratio = if ratio-x < ratio-y {
ratio-x
} else {
ratio-y
}
let newx = contentsize.width * ratio
let newy = contentsize.height * ratio
let suggestedtextsize = 1em * ratio
if (suggestedtextsize + 0pt).to-absolute() > max-text-size {
suggestedtextsize = max-text-size
}
if (suggestedtextsize + 0pt).to-absolute() < min-text-size {
suggestedtextsize = min-text-size
}
set text(size: suggestedtextsize)
it
}
})
}
#let words = (
"បាទ!",
"ចាស!",
"យល់ព្រម!",
"មិនយល់ព្រម!",
"ឯកភាព!",
"មិនឯកភាព!",
"អរុណសួស្ដី!",
"រាត្រីសួស្ដី!",
"ចាំមួយភ្លេត!",
"អរគុណ!",
"ហ្នឹងហើយ!",
)
#for word in words [
// Center the content on the card
#align(center + horizon)[
#fit-to-width(word)
]
// Create a new page for the next day, except after the last one
#if word != word.last() [
#pagebreak()
]
]