Hi Everybody,
I hope someone can help with this, it's taken so long to get this close but I just can't figure out the last small (but show stopping) detail.
I start with a string of text and a font-face entered/selected via a form. I am using imagettfbbox to determine the overall dimensions and the descent (height below the baseline) value of the string using the selected font.
Then I create an image using those dimensions and create the same text in that image using the same font (again, using imagettfbbox).
I position the imagettfbbox at x = 0 and y = overall height minus the descent value (I believe that that is how I calculate the baseline position of the string).
The goal is to create an image with all of the string visible but with no extra white space. It almost works.
I have found one character (so far) that has a problem with height using a normal font (§).
I have found several characters that cause a problem depending on whether I use a normal, italic or bold.
These characters seem to be cut off in the x axis if they are at the beginning or at the end of the string.
I'm guessing that I'm making a mistake somewhere when I calculate the dimension/descent.
You can see the output here: Click Here
Here is the code for the form page:
<?php
// Path to fonts (this will need to be changed to reflect the …