{"id":17172352,"url":"https://github.com/nazmulpcc/texter","last_synced_at":"2025-07-30T06:10:51.383Z","repository":{"id":57024274,"uuid":"83464516","full_name":"nazmulpcc/Texter","owner":"nazmulpcc","description":"Texter helps to write Bangla/English text on image with PHP GD.","archived":false,"fork":false,"pushed_at":"2018-01-29T16:50:07.000Z","size":236,"stargazers_count":12,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-22T14:13:44.611Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nazmulpcc.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-02-28T18:14:14.000Z","updated_at":"2025-02-23T09:23:07.000Z","dependencies_parsed_at":"2022-08-23T13:50:33.583Z","dependency_job_id":null,"html_url":"https://github.com/nazmulpcc/Texter","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/nazmulpcc/Texter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nazmulpcc%2FTexter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nazmulpcc%2FTexter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nazmulpcc%2FTexter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nazmulpcc%2FTexter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nazmulpcc","download_url":"https://codeload.github.com/nazmulpcc/Texter/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nazmulpcc%2FTexter/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267820873,"owners_count":24149293,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-30T02:00:09.044Z","response_time":70,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-14T23:36:46.607Z","updated_at":"2025-07-30T06:10:51.327Z","avatar_url":"https://github.com/nazmulpcc.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Texter\nTexter helps to write Bangla/English text on image with PHP GD. It also has featurs like align, maintain lineheight, color settings etc.\n## Example\n```php\n\t$texter = new nazmulpcc\\Texter;\n\t$image = imagecreate(500, 300);\n\timagecolorallocate($image, 255, 255, 255);\n\t$texter-\u003estartFrom(50, 90)-\u003ewidth(400)-\u003eon($image)-\u003ealign('center')-\u003efontSize(30)-\u003ecolor('333333');\n\t$texter-\u003etext('আমার সোনার বাংলা, আমি তোমায় ভালবাসি Lorem ipsum dolor sit amet.....')-\u003ewrite();\n```\n **It will give you something like this:**\n![Result](https://i.imgur.com/esw9Msr.jpg \"Result\")\n\n## Installation\nYou can easily install **Texter** via composer or you can manually download the package and include them in your code.\n### Composer\n```shell\n\tcomposer require nazmulpcc/Texter\n```\n\n### Manual\n- Download/Clone this repo.\n- Download/Clone [mirazmac/Unicode2Bijoy](https://github.com/mirazmac/Unicode2Bijoy) .\n- Include **Texter.php** and **Unicode2Bijoy.php** in your code and you are ready to go.\n\n## Documentation\nEach method is fairly well documented in the source code. A few important methods:  \n- **startFrom(x, y):** Set up the co-ordinates from which Texter will start writing.  \n- **width($w):** Width of the boundary inside which Texter will write text.  \n- **align($position):** Set the horizontal alignment to left, right or center/centre. Default is left.  \n- **on($image)** / **image($image):** Set the image on which Texter will write. Image is passed by reference.  \n- **fontSize($size):** Set the font size. $size can be point or pixel, like ```$texter-\u003efontSize('15pt')``` or ```$texter-\u003efontSize('15px')```. If 'pt' or 'px' is absent, the gd default is used.  \n- **color($hex):** / **color($red, $green, $blue):** Both hex and RGB are accepted as text color.\n- **text($text):** Add text to be written.  \n- **lineHeight($height):** The line height. $height can be in pixel or as a percentage of the text height.  \n- **write():** Call this guy to do the job or if you want to start a new line.  \nAll public functions can be chained up. So you can always do things like:  \n```php\n    $texter-\u003estartFrom(10, 10)\n                -\u003ecolor(0, 0, 0)\n                -\u003ealign('center')\n                -\u003ewidth(500)\n                -\u003etext('Hellow World')\n                -\u003ewrite();\n```  \n**Note:** Before you write a piece of text, you must at least set the starting points(**startFrom**), **width**, and **image**.  \n\n## About Texter\nI 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.\n\n## To-Do\n- Add vertical alignment feature.\n- Support for Text shadow.\n- Add some debugging functions\netc.  \n\n## License\nThis project is lincensed under [DBAD](http://www.dbad-license.org) license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnazmulpcc%2Ftexter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnazmulpcc%2Ftexter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnazmulpcc%2Ftexter/lists"}