PHPackages                             nazmulpcc/texter - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Image &amp; Media](/categories/media)
4. /
5. nazmulpcc/texter

ActiveLibrary[Image &amp; Media](/categories/media)

nazmulpcc/texter
================

A PHP class which makes it easier to write Bangla text on images. Supports multi-line, align etc.

1.0(9y ago)12591[1 issues](https://github.com/nazmulpcc/Texter/issues)DBADPHP

Since Mar 1Pushed 8y ago2 watchersCompare

[ Source](https://github.com/nazmulpcc/Texter)[ Packagist](https://packagist.org/packages/nazmulpcc/texter)[ RSS](/packages/nazmulpcc-texter/feed)WikiDiscussions master Synced yesterday

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

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

[](#example)

```
	$texter = new nazmulpcc\Texter;
	$image = imagecreate(500, 300);
	imagecolorallocate($image, 255, 255, 255);
	$texter->startFrom(50, 90)->width(400)->on($image)->align('center')->fontSize(30)->color('333333');
	$texter->text('আমার সোনার বাংলা, আমি তোমায় ভালবাসি Lorem ipsum dolor sit amet.....')->write();
```

**It will give you something like this:**[![Result](https://camo.githubusercontent.com/75fcc8a2a937b0019f0211a9e250611e79120cf9c5119192b86e093c0eb567e2/68747470733a2f2f692e696d6775722e636f6d2f657377394d73722e6a7067 "Result")](https://camo.githubusercontent.com/75fcc8a2a937b0019f0211a9e250611e79120cf9c5119192b86e093c0eb567e2/68747470733a2f2f692e696d6775722e636f6d2f657377394d73722e6a7067)

Installation
------------

[](#installation)

You can easily install **Texter** via composer or you can manually download the package and include them in your code.

### Composer

[](#composer)

```
	composer require nazmulpcc/Texter
```

### Manual

[](#manual)

- Download/Clone this repo.
- Download/Clone [mirazmac/Unicode2Bijoy](https://github.com/mirazmac/Unicode2Bijoy) .
- Include **Texter.php** and **Unicode2Bijoy.php** in your code and you are ready to go.

Documentation
-------------

[](#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 `$texter->fontSize('15pt')` or `$texter->fontSize('15px')`. 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:

```
    $texter->startFrom(10, 10)
                ->color(0, 0, 0)
                ->align('center')
                ->width(500)
                ->text('Hellow World')
                ->write();
```

**Note:** Before you write a piece of text, you must at least set the starting points(**startFrom**), **width**, and **image**.

About Texter
------------

[](#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
-----

[](#to-do)

- Add vertical alignment feature.
- Support for Text shadow.
- Add some debugging functions etc.

License
-------

[](#license)

This project is lincensed under [DBAD](http://www.dbad-license.org) license.

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3408d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/3b1e7c1c1099138d6409a43382e39b6ef728469af42e6c1cab4715eb01bf1acf?d=identicon)[nazmul](/maintainers/nazmul)

---

Top Contributors

[![nazmulpcc](https://avatars.githubusercontent.com/u/8166346?v=4)](https://github.com/nazmulpcc "nazmulpcc (4 commits)")

### Embed Badge

![Health badge](/badges/nazmulpcc-texter/health.svg)

```
[![Health](https://phpackages.com/badges/nazmulpcc-texter/health.svg)](https://phpackages.com/packages/nazmulpcc-texter)
```

###  Alternatives

[goat1000/svggraph

Generates SVG graphs

133890.0k3](/packages/goat1000-svggraph)[imagekit/imagekit

PHP library for Imagekit

46877.3k10](/packages/imagekit-imagekit)[gravatarphp/gravatar

Gravatar URL builder which is most commonly called as a Gravatar library

12644.1k2](/packages/gravatarphp-gravatar)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
