ange007 / poster-gen
Poster and image generator for news/aticles/other
0.6.5
2019-05-30 16:20 UTC
Requires
- php: ^5.6|^7
- ext-gd: *
This package is auto-updated.
Last update: 2024-11-29 05:38:51 UTC
README
Use for:
- Poster for your site or blog
- Poster for social network
- Poster for your promo materials ☻
Example Images
Dependencies
- PHP >= 5.6
- GD
Install
composer require ange007/poster-gen
Example Code
<?php use \PosterGen; // Generate poster $poster = ( new \PosterGen\PosterGen( [ ] ) ) ->setSize( 1280, 720 ) ->setBackgroundImage( __DIR__ . "/backgrounds/1.jpg" ) ->setHorizontalAlignment( 'center' ) ->setVerticalAlignment( 'center' ) ->setFontShadow( '#333333', -2, 2 ) ->setOverlayColor( '#FF0000' ) ->setBorder( 'black', 1 ) // Title ->setFont( __DIR__ . "/fonts/Roboto-Regular" ) ->setFontSize( 40 ) ->setFontColor( '#FFFFFF' ) ->addText( 'Microsoft buying GitHub' ) ->addText( '' ) // Subtitle ->setFont( __DIR__ . "/fonts/Blogger_Sans.otf" ) ->setFontSize( 20 ) ->setFontColor( '#00FFFF' ) ->addText( 'The deal is concluded' ) // Watermark ->setTextBackground( 'black', 50 ) ->setHorizontalAlignment( 'right' ) ->setVerticalAlignment( 'bottom' ) ->setFontSize( 14 ) ->setFontColor( '#FFFFFF' ) ->setFontShadow( '' ) ->setFontStroke( 'black' ) ->addText( 'http://news.com' ); // Poster output echo $poster->saveToBase64Image( );
Plans
- Background position and adaptation
- Text rotate
- Image rotate
License
It is released under the MIT License.