php-initial-avatar-generator
php-initial-avatar-generator copied to clipboard
FontAwesome only user icon works
Hey,
Two quick questions:
-
How do I load a custom font? Running on Laravel here and generating them (not for users). Any hints? I've tried the
resource_path()and theasset()without any luck. -
FontAwesome not all icons are supported, I've tried multiple but only seem to ge the user to work. In the example below this should render the question mark.
$image = $avatar->glyph('f128')
->font('/fonts/FontAwesome5Free-Regular-400.otf')
->size(500)
->rounded()
->background('#e9655b')
->color('#ffffff')
->generate();
return response($image->stream('png', 100))
->header('Content-Type','image/png')
->header('Pragma','public')
->header('Content-Disposition','inline; filename="1231231231231.png"')
->header('Cache-Control','max-age=60, must-revalidate');
Side note, when it renders, it renders a very small font-size, see the attached image