@@ -39,6 +39,13 @@ return $image->stream('png', 100);
3939````
4040You can also just pass along the initials, and it will use those. Should you just include a first name, it will use the first two letters of it.
4141
42+ ## SVG generation
43+ ```` php
44+ $avatar = new LasseRafn\InitialAvatarGenerator\InitialAvatar();
45+
46+ echo $avatar->name('Lasse Rafn')->generateSvg()->toXMLString(); // returns SVG XML string
47+ ````
48+
4249## Supported methods and parameters
4350Of cause, passing a name is not the only thing this sweet thing does!
4451
@@ -55,19 +62,31 @@ Will detect language script (using [lasserafn/php-string-script-language](https:
5562$image = $avatar->autoFont()->generate();
5663````
5764
58- ### Size - default: 48
65+ ### Width - default: 48
66+ ```` php
67+ // will be 96 pixels wide.
68+ $image = $avatar->width(96)->generate();
69+ ````
70+
71+ ### Height - default: 48
72+ ```` php
73+ // will be 96 pixels tall.
74+ $image = $avatar->height(96)->generate();
75+ ````
76+
77+ ### Size - default: 48 (proxy for ` $avatar->width(X)->height(X) ` )
5978```` php
6079// will be 96x96 pixels.
6180$image = $avatar->size(96)->generate();
6281````
6382
64- ### Background color - default: #000
83+ ### Background color - default: #f0e9e9
6584```` php
6685// will be red
6786$image = $avatar->background('#ff0000')->generate();
6887````
6988
70- ### Font color - default: #fff
89+ ### Font color - default: #8b5d5d
7190```` php
7291// will be red
7392$image = $avatar->color('#ff0000')->generate();
@@ -88,8 +107,11 @@ If you input an integer between 1 and 5, it will use a GD Internal font as per t
88107$image = $avatar->font('/fonts/OpenSans-Semibold.ttf')->generate();
89108````
90109
91- ### Cache - removed!
92- Cache has been removed. Performance-wise it was not doing much anyway.
110+ ### Font name (for SVGs) - default: Open Sans, sans-serif
111+
112+ ```` php
113+ $image = $avatar->fontName('Arial, Helvetica, sans-serif')->generate();
114+ ````
93115
94116### Length - default: 2
95117```` php
@@ -171,7 +193,7 @@ return $avatar->glyph('f007')
171193```
172194
173195## Requirements
174- * PHP 5.6, 7.0, 7.1 or 7.2
196+ * PHP + 7.0
175197* Fileinfo Extension (from intervention/image)
176198
177199## Script/Language support
0 commit comments