Skip to content

Commit 6cd1ef0

Browse files
Merge pull request #5 from frnxstd/master
finalize the pack
2 parents 6cc4270 + d998ec7 commit 6cd1ef0

18 files changed

+292
-8
lines changed

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ try {
6464
| text-color | array | text color as RGB |
6565
| left | integer | Margin Left value of text |
6666
| top | integer | Margin Top value of text |
67-
| background-url | file | Backgroun file on the server. Exact path and file name. Should be PNG or JPG |
67+
| wrap (optional) | integer | Integer value to wrap text. If disables *auto-center* selector. |
6868

6969

7070
### Availabile Config Values
@@ -75,7 +75,11 @@ the ``Generator`` class takes third parameter as configs.
7575
| auto-center | bool | Enable text center on image |
7676
| angle | integer |Angle of the text on image |
7777
| header | string | default value of header when image generated. default is ``Content-type: image/jpeg`` |
78+
| background-url | file | Background file on the server. Exact path and file name. Should be PNG or JPG |
7879

80+
```
81+
Important: If you wrap the line, auto-center is forced to false.
82+
```
7983

8084
### Error Handling
8185

composer.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,19 @@
77
{
88
"name": "Cagri S.",
99
"email": "hi@bencagri.com"
10+
},
11+
{
12+
"name": "Burak",
13+
"email": "burak@myself.com"
1014
}
1115
],
12-
"minimum-stability": "dev",
16+
"minimum-stability": "stable",
1317
"require": {
1418
"simple-validator/simple-validator": "1.0.2"
1519
},
20+
"require-dev": {
21+
"fzaninotto/faker": "~1.6"
22+
},
1623
"autoload": {
1724
"psr-4": { "DngoIO\\CoverCreator\\": "src/" }
1825
}

sample-usage/config.php

Lines changed: 239 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,239 @@
1+
<?php
2+
$config = [
3+
1 => [
4+
'text1' => [
5+
'font-size' => 65, //px
6+
'font-type' => 'fonts/MavenPro-Bold.ttf', //path of ttf file on server
7+
'text-color' => [255,255,255],
8+
'left' => 50,
9+
'top' => 350,
10+
'wrap' => 20,
11+
],
12+
13+
'text2' => [
14+
'font-size' => 30, //px
15+
'font-type' => 'fonts/MavenPro-Bold.ttf', //path of ttf file on server
16+
'text-color' => [255,255,255],
17+
'left' => 50,
18+
'top' => 1500,
19+
],
20+
21+
'config' => [
22+
'auto-center' => false,
23+
'angle' => 0,
24+
'header' => 'Content-type: image/jpeg',
25+
'background-url' => 'covers/Dngo Book Covers1.png' //path of the png
26+
]
27+
],
28+
29+
2 => [
30+
'text1' => [
31+
'font-size' => 65, //px
32+
'font-type' => 'fonts/MavenPro-Bold.ttf', //path of ttf file on server
33+
'text-color' => [225, 225, 225],
34+
'left' => 100,
35+
'top' => 450,
36+
'wrap' => 20
37+
],
38+
39+
'text2' => [
40+
'font-size' => 30, //px
41+
'font-type' => 'fonts/MavenPro-Bold.ttf', //path of ttf file on server
42+
'text-color' => [225, 225, 225],
43+
'left' => 100,
44+
'top' => 1300,
45+
],
46+
47+
'config' => [
48+
'auto-center' => false,
49+
'angle' => 0,
50+
'header' => 'Content-type: image/jpeg',
51+
'background-url' => 'covers/Dngo Book Covers2.png' //path of the png
52+
]
53+
],
54+
55+
3 => [
56+
'text1' => [
57+
'font-size' => 65, //px
58+
'font-type' => 'fonts/MavenPro-Bold.ttf', //path of ttf file on server
59+
'text-color' => [255,255,255],
60+
'left' => 100,
61+
'top' => 650,
62+
'wrap' => 20,
63+
],
64+
65+
'text2' => [
66+
'font-size' => 30, //px
67+
'font-type' => 'fonts/MavenPro-Bold.ttf', //path of ttf file on server
68+
'text-color' => [255,255,255],
69+
'left' => 0,
70+
'top' => 650,
71+
],
72+
73+
'config' => [
74+
'auto-center' => true,
75+
'angle' => 0,
76+
'header' => 'Content-type: image/jpeg',
77+
'background-url' => 'covers/Dngo Book Covers3.png' //path of the png
78+
]
79+
],
80+
81+
4 => [
82+
'text1' => [
83+
'font-size' => 65, //px
84+
'font-type' => 'fonts/MavenPro-Bold.ttf', //path of ttf file on server
85+
'text-color' => [255, 255, 255],
86+
'left' => 50,
87+
'top' => 640,
88+
'wrap' => 20
89+
],
90+
91+
'text2' => [
92+
'font-size' => 30, //px
93+
'font-type' => 'fonts/MavenPro-Bold.ttf', //path of ttf file on server
94+
'text-color' => [255, 255, 255],
95+
'left' => 50,
96+
'top' => 1400,
97+
],
98+
99+
'config' => [
100+
'auto-center' => false,
101+
'angle' => 0,
102+
'header' => 'Content-type: image/jpeg',
103+
'background-url' => 'covers/Dngo Book Covers4.png' //path of the png
104+
]
105+
],
106+
107+
5 => [
108+
'text1' => [
109+
'font-size' => 65, //px
110+
'font-type' => 'fonts/MavenPro-Bold.ttf', //path of ttf file on server
111+
'text-color' => [255, 255, 255],
112+
'left' => 50,
113+
'top' => 600,
114+
'wrap' => 20
115+
],
116+
117+
'text2' => [
118+
'font-size' => 30, //px
119+
'font-type' => 'fonts/MavenPro-Bold.ttf', //path of ttf file on server
120+
'text-color' => [255, 255, 255],
121+
'left' => 50,
122+
'top' => 1000,
123+
],
124+
125+
'config' => [
126+
'auto-center' => false,
127+
'angle' => 0,
128+
'header' => 'Content-type: image/jpeg',
129+
'background-url' => 'covers/Dngo Book Covers5.png' //path of the png
130+
]
131+
],
132+
133+
6 => [
134+
'text1' => [
135+
'font-size' => 65, //px
136+
'font-type' => 'fonts/MavenPro-Bold.ttf', //path of ttf file on server
137+
'text-color' => [255, 255, 255],
138+
'left' => 50,
139+
'top' => 500,
140+
'wrap' => 20
141+
],
142+
143+
'text2' => [
144+
'font-size' => 30, //px
145+
'font-type' => 'fonts/MavenPro-Bold.ttf', //path of ttf file on server
146+
'text-color' => [255, 255, 255],
147+
'left' => 50,
148+
'top' => 1000,
149+
],
150+
151+
'config' => [
152+
'auto-center' => false,
153+
'angle' => 0,
154+
'header' => 'Content-type: image/jpeg',
155+
'background-url' => 'covers/Dngo Book Covers6.png' //path of the png
156+
]
157+
],
158+
159+
7 => [
160+
'text1' => [
161+
'font-size' => 65, //px
162+
'font-type' => 'fonts/Montserrat-Regular.ttf', //path of ttf file on server
163+
'text-color' => [0, 0, 0],
164+
'left' => 100,
165+
'top' => 700,
166+
'wrap' => 17
167+
],
168+
169+
'text2' => [
170+
'font-size' => 45, //px
171+
'font-type' => 'fonts/Montserrat-Bold.ttf', //path of ttf file on server
172+
'text-color' => [0, 0, 0],
173+
'left' => 100,
174+
'top' => 1300,
175+
'wrap' => 25
176+
],
177+
178+
'config' => [
179+
'auto-center' => false,
180+
'angle' => 0,
181+
'header' => 'Content-type: image/jpeg',
182+
'background-url' => 'covers/Dngo Book Covers7.png' //path of the png
183+
]
184+
],
185+
186+
8 => [
187+
'text1' => [
188+
'font-size' => 65, //px
189+
'font-type' => 'fonts/Montserrat-Regular.ttf', //path of ttf file on server
190+
'text-color' => [0, 0, 0],
191+
'left' => 100,
192+
'top' => 500,
193+
'wrap' => 17
194+
],
195+
196+
'text2' => [
197+
'font-size' => 45, //px
198+
'font-type' => 'fonts/Montserrat-Bold.ttf', //path of ttf file on server
199+
'text-color' => [0, 0, 0],
200+
'left' => 100,
201+
'top' => 1300,
202+
'wrap' => 25,
203+
],
204+
205+
'config' => [
206+
'auto-center' => false,
207+
'angle' => 0,
208+
'header' => 'Content-type: image/jpeg',
209+
'background-url' => 'covers/Dngo Book Covers8.png' //path of the png
210+
]
211+
],
212+
213+
9 => [
214+
'text1' => [
215+
'font-size' => 65, //px
216+
'font-type' => 'fonts/Montserrat-Regular.ttf', //path of ttf file on server
217+
'text-color' => [0, 0, 0],
218+
'left' => 100,
219+
'top' => 700,
220+
'wrap' => 17
221+
],
222+
223+
'text2' => [
224+
'font-size' => 45, //px
225+
'font-type' => 'fonts/Montserrat-Bold.ttf', //path of ttf file on server
226+
'text-color' => [0, 0, 0],
227+
'left' => 100,
228+
'top' => 1300,
229+
'wrap' => 25,
230+
],
231+
232+
'config' => [
233+
'auto-center' => false,
234+
'angle' => 0,
235+
'header' => 'Content-type: image/jpeg',
236+
'background-url' => 'covers/Dngo Book Covers9.png' //path of the png
237+
]
238+
],
239+
];
23.1 KB
Loading
22.3 KB
Loading
22.3 KB
Loading
17 KB
Loading
30.7 KB
Loading
26.2 KB
Loading
22.7 KB
Loading

0 commit comments

Comments
 (0)