@@ -244,7 +244,7 @@ public function it_can_generate_circle_svg()
244
244
{
245
245
$ expected = '<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"> ' ;
246
246
$ expected .= '<circle cx="50" cy="50" r="45" stroke="yellow" stroke-width="10" fill="red" /> ' ;
247
- $ expected .= '<text x="50" y="50" font-size="24" fill="white " alignment-baseline="middle" text-anchor="middle" dominant-baseline="central">AB</text> ' ;
247
+ $ expected .= '<text font-size="24" fill="white" x="50% " y="50%" dy=".1em" style="line-height:1 " alignment-baseline="middle" text-anchor="middle" dominant-baseline="central">AB</text> ' ;
248
248
$ expected .= '</svg> ' ;
249
249
250
250
$ avatar = new \Laravolt \Avatar \Avatar ();
@@ -267,7 +267,7 @@ public function it_can_generate_rectangle_svg()
267
267
{
268
268
$ expected = '<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"> ' ;
269
269
$ expected .= '<rect x="5" y="5" width="90" height="90" stroke="yellow" stroke-width="10" rx="15" fill="red" /> ' ;
270
- $ expected .= '<text x="50" y="50" font-size="24" fill="white " alignment-baseline="middle" text-anchor="middle" dominant-baseline="central">AB</text> ' ;
270
+ $ expected .= '<text font-size="24" fill="white" x="50% " y="50%" dy=".1em" style="line-height:1 " alignment-baseline="middle" text-anchor="middle" dominant-baseline="central">AB</text> ' ;
271
271
$ expected .= '</svg> ' ;
272
272
273
273
$ avatar = new \Laravolt \Avatar \Avatar ();
@@ -291,7 +291,7 @@ public function it_can_generate_svg_with_custom_font_family()
291
291
{
292
292
$ expected = '<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"> ' ;
293
293
$ expected .= '<circle cx="50" cy="50" r="45" stroke="yellow" stroke-width="10" fill="red" /> ' ;
294
- $ expected .= '<text x="50" y="50" font-size="24" font-family="Lato" fill="white" alignment-baseline="middle" text-anchor="middle" dominant-baseline="central">AB</text> ' ;
294
+ $ expected .= '<text font-size="24" font-family="Lato" fill="white" x="50%" y="50%" dy=".1em" style="line-height:1 " alignment-baseline="middle" text-anchor="middle" dominant-baseline="central">AB</text> ' ;
295
295
$ expected .= '</svg> ' ;
296
296
297
297
$ avatar = new \Laravolt \Avatar \Avatar ();
@@ -315,7 +315,7 @@ public function it_can_use_the_foreground_color_for_the_svg_border()
315
315
{
316
316
$ expected = '<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"> ' ;
317
317
$ expected .= '<circle cx="50" cy="50" r="45" stroke="green" stroke-width="10" fill="red" /> ' ;
318
- $ expected .= '<text x="50" y="50" font-size="24" fill="green " alignment-baseline="middle" text-anchor="middle" dominant-baseline="central">AB</text> ' ;
318
+ $ expected .= '<text font-size="24" fill="green" x="50% " y="50%" dy=".1em" style="line-height:1 " alignment-baseline="middle" text-anchor="middle" dominant-baseline="central">AB</text> ' ;
319
319
$ expected .= '</svg> ' ;
320
320
321
321
$ avatar = new \Laravolt \Avatar \Avatar (['border ' => ['size ' => 10 , 'color ' => 'foreground ' ]]);
@@ -337,7 +337,7 @@ public function it_can_use_the_background_color_for_the_svg_border()
337
337
{
338
338
$ expected = '<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"> ' ;
339
339
$ expected .= '<circle cx="50" cy="50" r="45" stroke="red" stroke-width="10" fill="red" /> ' ;
340
- $ expected .= '<text x="50" y="50" font-size="24" fill="green " alignment-baseline="middle" text-anchor="middle" dominant-baseline="central">AB</text> ' ;
340
+ $ expected .= '<text font-size="24" fill="green" x="50% " y="50%" dy=".1em" style="line-height:1 " alignment-baseline="middle" text-anchor="middle" dominant-baseline="central">AB</text> ' ;
341
341
$ expected .= '</svg> ' ;
342
342
343
343
$ avatar = new \Laravolt \Avatar \Avatar (['border ' => ['size ' => 10 , 'color ' => 'background ' ]]);
0 commit comments