-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.typ
44 lines (43 loc) · 852 Bytes
/
test.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
#let img = image("momotalk/assets/azusa.png", fit: "contain")
// #style(styles => {
// let block = block(
// img,
// inset: 0pt,
// outset: 0pt,
// clip: true,
// // width: 50pt,
// // height: 50pt,
// radius: 100%
// )
// let size = measure(block, styles)
// scale(block, x: (size.width / 50pt))
// })
#style(styles => {
let size = measure(img, styles)
// 需要让图像的 x 放大到
let x = (50pt / size.width) * 100%
let y = (50pt / size.height) * 100%
x = 120%
y = 120%
[#x, #y]
let img = scale(img, x: x, y: y)
let block = block(
align(img, center),
inset: 0pt,
outset: 0pt,
clip: true,
width: 50pt,
height: 50pt,
radius: 25pt
)
block
})
// #block(
// align(img, center),
// inset: 0pt,
// outset: 0pt,
// clip: true,
// width: 50pt,
// height: 50pt,
// radius: 25pt
// )