Quick project, need PHP and GD library expert.
1) Dynamically resize text string, display using ttf font with GD library
2) Create "text box", create function to allow placement in 9 spots within the image.
See attached zip file for complete specification.
Thanks.
## Deliverables
This project consists of the following functions...
1) Dynamically resize text string, display using ttf font with GD library
2) Create "text box", create function to allow placement in 9 spots within the image.
Item #1 Specification:
==========================
I'm using PHP and GD library to resize an image, then placing a random string of text (ttf font) using GD functions within a "text box" on the image. The "text box" width should be calculated, then passed to the function I need created which will change the font size to allow the text to fit within a designated number of lines in this text box.
This function needs to be able to work with many different ttf fonts and random text strings of varying lengths. The variable $max_text_rows will need to be passed to the function, so the text string will not exceed this number of rows based on the text box width. If it does exceed the rows and width at the default font size, then the font size needs to be decreased until it fits within the specified $max_text_rows.
In addition, the function should also determine if the string of text fits within one line, that it checks to see if it is filling the full width of the text box. If it isn't, then increase the font size so the text goes the full width.
I have not created this "text box" specifically. The idea behind the text box is that it will typically only cover two-thirds (2/3) of the image width and may be anywhere on the image. You will need to do this in conjunction with item #2 below.
Item #2 Specification:
==========================
Create a "text box" that takes up two-thirds of the image width, then based on which position is passed to the function, place the text box in that position. This "text box" is where the text string will be inserted based on item #1 above. The possible text box placement positions should be;
top-left
top-center
top-right
middle-left
middle-center
middle-right
bottom-left
bottom-center
bottom-right
The 2/3 width of the text box should be setup to allow this width to be changed and will be dependent on the overall image width. For example; when the script is run, sometimes the text box may need to cover 100% of the image width, whereas other times it might be 1/2 instead of the default 2/3.
My initial script with all functionality except for items #1 and items #2 is attached in the zip file assigned to this project.
Thanks in advance for your bid.