File tree Expand file tree Collapse file tree 2 files changed +41
-39
lines changed Expand file tree Collapse file tree 2 files changed +41
-39
lines changed Original file line number Diff line number Diff line change 1
1
[img ]
2
+ out = " ./img/functora-card-"
2
3
dpi = 96
3
4
width = 2100
4
5
height = 1200
@@ -19,18 +20,8 @@ vertical = true
19
20
[[group .item ]]
20
21
kind = " Head"
21
22
data = " Functora"
22
- size = 90
23
- padX = 734
24
- [[group .item ]]
25
- kind = " Head"
26
- data = " Hi-end quality software development."
27
- size = 30
28
- padX = 635
29
- [[group .item ]]
30
- kind = " Head"
31
- data = " Reliable. Functional. Pure."
32
- size = 30
33
- padX = 714
23
+ size = 150
24
+ padX = 585
34
25
[[group .item ]]
35
26
data = " 0xe677"
36
27
kind = " Icon"
@@ -45,25 +36,28 @@ size = 590
45
36
data = " https://functora.github.io"
46
37
kind = " Note"
47
38
size = 30
48
- padY = 5
39
+ padY = 0
49
40
50
41
[[group ]]
51
42
[[group .item ]]
43
+ kind = " Head"
44
+ data = " "
45
+ size = 150
46
+ [[group .item ]]
52
47
data = " 0xe636"
53
48
kind = " Icon"
54
- size = 210
55
- padX = 168
56
- padY = 236
49
+ size = 217
50
+ padX = 164
57
51
[[group .item ]]
58
52
data = " https://functora.github.io/apps/currency-converter"
59
53
kind = " Qr"
60
54
size = 590
61
- padY = 52
55
+ padY = 53
62
56
[[group .item ]]
63
57
data = " https://functora.github.io/apps/"
64
58
kind = " Note"
65
59
size = 30
66
- padY = 5
60
+ padY = 8
67
61
[[group .item ]]
68
62
data = " currency-converter"
69
63
kind = " Note"
@@ -72,21 +66,24 @@ padY = 0
72
66
73
67
[[group ]]
74
68
[[group .item ]]
69
+ kind = " Head"
70
+ data = " "
71
+ size = 150
72
+ [[group .item ]]
75
73
data = " 0xe60e"
76
74
kind = " Icon"
77
75
size = 180
78
76
padX = 198
79
- padY = 240
80
77
[[group .item ]]
81
78
data = " https://play.google.com/store/apps/details?id=com.functora.currency_converter"
82
79
kind = " Qr"
83
80
size = 594
84
- padY = 70
81
+ padY = 90
85
82
[[group .item ]]
86
83
data = " https://play.google.com/store/apps/"
87
84
kind = " Note"
88
85
size = 30
89
- padY = 5
86
+ padY = 16
90
87
[[group .item ]]
91
88
data = " details?id=com.functora.currency_converter"
92
89
kind = " Note"
Original file line number Diff line number Diff line change @@ -26,7 +26,6 @@ main = withUtf8 $ do
26
26
fmap (foldl1 const ) $ case cli of
27
27
CliTextConf txt _ -> forM txt unToml
28
28
CliFileConf loc _ -> forM loc $ readFile >=> unToml
29
- putStrLn $ inspect @ Text @ Cfg cfg
30
29
headFont <- mkFont $ cfg ^. # cfgFont . # cfgFontHead
31
30
iconFont <- mkFont $ cfg ^. # cfgFont . # cfgFontIcon
32
31
noteFont <- mkFont $ cfg ^. # cfgFont . # cfgFontNote
@@ -47,6 +46,7 @@ main = withUtf8 $ do
47
46
forM_ (Extra (Px width) (Px height) False : cfgExtra cfg) $ \ ext -> do
48
47
let extWidth = ext ^. # extraWidth . # unPx
49
48
let extHeight = ext ^. # extraHeight . # unPx
49
+ let out = from @ Text @ String $ cfg ^. # cfgImg . # imgOut
50
50
let fin =
51
51
R. renderDrawingAtDpi
52
52
extWidth
@@ -59,23 +59,27 @@ main = withUtf8 $ do
59
59
(unsafeFrom @ Int @ Float (extHeight - height) / 2 )
60
60
if extraVertical ext
61
61
then
62
- CP. writePng
63
- ( " ./img/card-"
64
- <> inspect extHeight
65
- <> " x"
66
- <> inspect extWidth
67
- <> " .png"
68
- )
69
- $ JP. rotateRight90 fin
62
+ ( do
63
+ let file =
64
+ out
65
+ <> inspect extHeight
66
+ <> " x"
67
+ <> inspect extWidth
68
+ <> " .png"
69
+ CP. writePng file $ JP. rotateRight90 fin
70
+ putStrLn $ " Created ==> " <> file
71
+ )
70
72
else
71
- CP. writePng
72
- ( " ./img/card-"
73
- <> inspect extWidth
74
- <> " x"
75
- <> inspect extHeight
76
- <> " .png"
77
- )
78
- fin
73
+ ( do
74
+ let file =
75
+ out
76
+ <> inspect extWidth
77
+ <> " x"
78
+ <> inspect extHeight
79
+ <> " .png"
80
+ CP. writePng file fin
81
+ putStrLn $ " Created ==> " <> file
82
+ )
79
83
80
84
mkFont :: Text -> IO TT. Font
81
85
mkFont =
@@ -234,7 +238,8 @@ data Cfg = Cfg
234
238
via GenericType Cfg
235
239
236
240
data Img = Img
237
- { imgDpi :: Px ,
241
+ { imgOut :: Text ,
242
+ imgDpi :: Px ,
238
243
imgWidth :: Px ,
239
244
imgHeight :: Px ,
240
245
imgPadX :: Px ,
You can’t perform that action at this time.
0 commit comments