forked from mintyfrankie/brilliant-CV
-
Notifications
You must be signed in to change notification settings - Fork 0
/
letter.typ
75 lines (67 loc) · 1.72 KB
/
letter.typ
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
/*
* Functions for the CV template
*/
#import "./utils/styles.typ": *
#let letterHeader(
myAddress: "Your Address Here",
recipientName: "Company Name Here",
recipientAddress: "Company Address Here",
date: "Today's Date",
subject: "Subject: Hey!",
metadata: metadata,
awesomeColors: awesomeColors,
) = {
let accentColor = setAccentColor(awesomeColors, metadata)
let letterHeaderNameStyle(str) = {
text(fill: accentColor, weight: "bold", str)
}
let letterHeaderAddressStyle(str) = {
text(fill: gray, size: 0.9em, smallcaps(str))
}
let letterDateStyle(str) = {
text(size: 0.9em, style: "italic", str)
}
let letterSubjectStyle(str) = {
text(fill: accentColor, weight: "bold", underline(str))
}
letterHeaderNameStyle(metadata.personal.first_name + " " + metadata
.personal
.last_name)
v(1pt)
letterHeaderAddressStyle(myAddress)
v(1pt)
align(right, letterHeaderNameStyle(recipientName))
v(1pt)
align(right, letterHeaderAddressStyle(recipientAddress))
v(1pt)
letterDateStyle(date)
v(1pt)
letterSubjectStyle(subject)
linebreak()
linebreak()
}
#let letterSignature(img) = {
set image(width: 25%)
linebreak()
place(right, dx: -5%, dy: 0%, img)
}
#let letterFooter(metadata) = {
// Parameters
let firstName = metadata.personal.first_name
let lastName = metadata.personal.last_name
let footerText = metadata.lang.at(metadata.language).letter_footer
// Styles
let footerStyle(str) = {
text(size: 8pt, fill: rgb("#999999"), smallcaps(str))
}
place(
bottom,
table(
columns: (1fr, auto),
inset: 0pt,
stroke: none,
footerStyle([#firstName #lastName]),
footerStyle(metadata.lang.at(metadata.language).letter_footer),
),
)
}