Download the PHP package ghostff/php-text-to-image without Composer

On this page you can find all versions of the php package ghostff/php-text-to-image. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package php-text-to-image

PHP-add-text-to-image

Add text to an existing or new image. PHP >= 7.0

Usage

Writing to existing image

Writing to a new image:


TextToImage Documentations

TextToImage::__construct(string $from = '')
Description: Creates TextToImage instance.

Params Description
from The image text will be added to. If not specified a blank image 200x200 will be created

TextToImage::setDimension(int $width, int $height): TextToImage
Description: Set background image dimension. Note: This is not evaluated if $from argument is passed to the constructor

Params Description
width The width of the background image.
height The height of the background image.

TextToImage::setBackgroundColor(int $r = 255, int $g = 255, int $b = 255, int $a = 255): TextToImage
Description: Set the background color of created background image. Note: This is not evaluated if $from argument is passed to the constructor.

Params Description
r Value of red component.
g Value of green component.
b Value of blue component.
a A value between 0 and 255. 255 indicates completely opaque while 0 indicates completely transparent.

TextToImage::addTexts(Text $text, Text ...$texts): TextToImage
Description: Adds text to specified or generated background image.

Params Description
text Text to add to image
texts Further Text to add to image

Multiple text can all be added at once or over steps.


TextToImage::render(string $save_as = null, string $ext = null): string
Description: Renders modified image to a file or return contents.

Params Description
save_as If specified, image content will be saved at the provided path..
ext Image processor. possible values: jpg, jpeg, png or gif.

Text Documentations

Text::__construct(string $from = '') or Text::__from(string $text): Text
Description: Creates Text instance.

Params Description
text The text that will be written on image.

Text::position(int $x, int $y = 0): Text
Description: Sets the position of specified text on image.

Params Description
x The X position.
y The Y position.

Text::font(int $size, string $path = null): Text
Description: Sets the font/size of specified text.

Params Description
size The font size of text.
path The path to font file.

Text::color(int $r = 255, int $g = 255, int $b = 255, int $a = 255): Text
Description: Sets the color of specified text.

Params Description
r Value of red component.
g Value of green component.
b Value of blue component.
a A value between 0 and 255. 255 indicates completely opaque while 0 indicates completely transparent.

Text::shadow(int $position_x = null, int $position_y = null, array $color = []): Text
Description: Adds shadow to specified text.

Params Description
position_x The shadow's X position.
position_y The shadow's Y position.
color Array [r(red), g(green), b(blue), a(alpha)] See color method.

Text::rotate(float $degrees): Text
Description: Rotates specified text to a specific angle.

Params Description
degrees The angle in degrees.

Text::update(Closure $closure): Text
Description: Runtime text update.

Params Description
degrees The function to call before render. If specified, this closure will be called with three arguments TextToImage, Text and GdFont


All versions of php-text-to-image with dependencies

PHP Build Version
Package Version
Requires php Version >=7.0.0
ext-gd Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package ghostff/php-text-to-image contains the following files

Loading the files please wait ....