This is a simple php wrapper for the handwriting.io api. You'll need to register for an account and get your access and secret tokens.
You can install the package via composer:
composer require nickcheek/handwriting
You can use renderPNGImage(), renderPNGString(), or renderPDF()
use Nickcheek\Handwriting\Writer;
$handwriting = new Writer($key, $secret);
//get random font
$random = $handwriting->getAllHandwriting(['limit'=> 50,'offset'=>1,'order_dir'=>'asc','order_by'=>'title']);
//build the url
$build = $handwriting->text('Testing the handwriting.io library')
->font($random[array_rand($random)]->id)
->build();
echo $handwriting->renderPNGImage($build);
The builder class allows you to inject the settings you'd like for your image in a chainable format.
$build = $handwriting->text('text to output')
->font($fontID)
->height('50px')
->width('10px')
->size('25px')
->lineSpace()
->lineSpaceVariance()
->wordSpaceVariance()
->randomSeed()
->color()
->build();
Check the docs if you'd like more information.
Please see CHANGELOG for more information what has changed recently.
Please see CONTRIBUTING for details.
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.