masokky/quotemaker
Composer 安装命令:
composer require masokky/quotemaker
包简介
Simple library to create quote image
README 文档
README
QuoteMaker is simple library to create quote image
Example Result
Installation
composer require masokky/quotemaker
If you won't use composer, click here with the simple installation
Usage
<?php require "./vendor/autoload.php"; use masokky\QuoteMaker; try{ $text = "the cruelest crime is giving false hope without love"; (new QuoteMaker) ->setBackgroundFromUnsplash(["b353e61a07cc0068080258kc0294ks85042f2560d6223366500a2aa30ff28052"],"heart") ->quoteText($text) ->watermarkText("Mas Okky") ->toFile("result.jpg"); }catch(Exception $e){ echo $e->getMessage(); }
Available Methods
setBackground($path)
$path(string) - Location of background image
setBackgroundFromUnsplash($client_id,$keyword)
You can search and use image from unsplash.com
Before use this function, you should create app to get "client_id" for accessing the API
Because there is a limit per hour for each "client_id", so you can add two or more "client_id" to increase the limit
$client_id(array) - The access key of unsplash app$keyword(string) - Keyword to search an image, defaultrandom
quoteText($text)
$text(string) - Set the quote text. Use\nto add line break
setQuoteFont($path)
$path(string) - Set the custom quote font*
setQuoteFontSize($size)
$size(int) - Set the custom quote font size*
watermarkText($text)
$text(string) - Set the watermark text, defaultnull
setWatermarkFont($path)
$path(string) - Set the custom watermark font*
setWatermarkFontSize($size)
$size(int) - Set the custom watermark font size*
toScreen()
Output the result to the screen
toFile($file)
Save the result to image file
*Default see the example result
Feel free to develop and maintain this library
统计信息
- 总下载量: 144
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 23
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-10-05
