Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nmcteam/image-with-text
Create images with embedded text using advanced typography
https://github.com/nmcteam/image-with-text
Last synced: 4 days ago
JSON representation
Create images with embedded text using advanced typography
- Host: GitHub
- URL: https://github.com/nmcteam/image-with-text
- Owner: nmcteam
- License: mit
- Created: 2013-11-14T19:16:32.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2017-10-26T16:59:21.000Z (over 7 years ago)
- Last Synced: 2025-01-14T21:09:36.649Z (11 days ago)
- Language: PHP
- Size: 311 KB
- Stars: 144
- Watchers: 10
- Forks: 36
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
- awesome-php-cn - nmcteam/image-with-text - 在图像中嵌入文本的库 (目录 / 图像 Imagery)
README
# Image with Text
This class makes it super easy to render images with multiple, independently styled
text blocks. You can control each text block's alignment, color, font, line height, and size.
You may also position each text block with specific X and Y coordinates relative to the
source image.## Installation
Install this library with [Composer](http://getcomposer.org). Add this to your `composer.json` file:
{
"require": {
"nmcteam/image-with-text": "~2.0"
}
}Then run `composer install`.
## Usage
Here's a quick demonstration. You can find this full working demo in the `example/`
directory.align = 'left';
$text1->color = 'FFFFFF';
$text1->font = dirname(__FILE__) . '/Ubuntu-Medium.ttf';
$text1->lineHeight = 36;
$text1->size = 24;
$text1->startX = 40;
$text1->startY = 40;
$image->addText($text1);// Add another styled text to image
$text2 = new \NMC\ImageWithText\Text('No, really, thanks!', 1, 30);
$text2->align = 'left';
$text2->color = '000000';
$text2->font = dirname(__FILE__) . '/Ubuntu-Medium.ttf';
$text2->lineHeight = 20;
$text2->size = 14;
$text2->startX = 40;
$text2->startY = 140;
$image->addText($text2);// Render image
$image->render(dirname(__FILE__) . '/destination.jpg');## How to Contribute
* Fork the repo on GitHub and send a pull request
* Find a list of TODOs on the GitHub issue trackerWe have not written any unit tests just yet, but we hope to do that soon.
## Author
[Josh Lockhart](http://www.newmediacampaigns.com/about/team/josh-lockhart)
## Copyright
(c) 2013 New Media Campaigns
## License
MIT