PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
I am wondering if anyone has solved this problem already:
I have a rectangle of specific width and height, and I would like to find the maximum font size to properly format (and center) a paragraph in this area [ using GD ]
Right now, my solution is only for one-line paragraphs because it will properly calculate the font size, but the additional lines of text will simply be left-aligned with the first line. Ugly.
I believe that you can get the width of characters in CD, so you'll need to calculate how many words can fit on each line individually, separate them as such. and then center them line by line.