Download the PHP package nazmulpcc/texter without Composer
On this page you can find all versions of the php package nazmulpcc/texter. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download nazmulpcc/texter
More information about nazmulpcc/texter
Files in nazmulpcc/texter
Package texter
Short Description A PHP class which makes it easier to write Bangla text on images. Supports multi-line, align etc.
License DBAD
Informations about the package texter
Texter
Texter helps to write Bangla/English text on image with PHP GD. It also has featurs like align, maintain lineheight, color settings etc.
Example
It will give you something like this:
Installation
You can easily install Texter via composer or you can manually download the package and include them in your code.
Composer
Manual
- Download/Clone this repo.
- Download/Clone mirazmac/Unicode2Bijoy .
- Include Texter.php and Unicode2Bijoy.php in your code and you are ready to go.
Documentation
Each method is fairly well documented in the source code. A few important methods:
- startFrom(x, y): Set up the co-ordinates from which Texter will start writing.
- width($w): Width of the boundary inside which Texter will write text.
- align($position): Set the horizontal alignment to left, right or center/centre. Default is left.
- on($image) / image($image): Set the image on which Texter will write. Image is passed by reference.
- fontSize($size): Set the font size. $size can be point or pixel, like or . If 'pt' or 'px' is absent, the gd default is used.
- color($hex): / color($red, $green, $blue): Both hex and RGB are accepted as text color.
- text($text): Add text to be written.
- lineHeight($height): The line height. $height can be in pixel or as a percentage of the text height.
- write(): Call this guy to do the job or if you want to start a new line.
All public functions can be chained up. So you can always do things like:
Note: Before you write a piece of text, you must at least set the starting points(startFrom), width, and image.
About Texter
I developed this out of pure frustration that PHP, one of the most widely used coding language doesn't support Bangla because GD can't handle complex fonts. There are room for a lot of improvements which I will try to accomplish gradually. Please contribute if you can.
To-Do
- Add vertical alignment feature.
- Support for Text shadow.
- Add some debugging functions etc.
License
This project is lincensed under DBAD license.