Skip to content

nickcheek/Handwritingio

Repository files navigation

Handwriting.io PHP API Wrapper

Latest Version on Packagist Quality Score Scrutinizer Code Quality Build Status

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.

Installation

You can install the package via composer:

composer require nickcheek/handwriting

Usage

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);

Render

Builder Class

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.

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

About

Handwriting IO php wrapper

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages