slyme 27 Junior Poster in Training

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 …
diafol commented: Good question +14
slyme 27 Junior Poster in Training

Hi, thanks for looking at this post.

I have searched and experimented and after hours of getting really close I have finally admitted to my self that I'm going to have to stop and ask directions!

So, I want the browser address http://drivingmeinsane/Join to be re-written to http://drivingmeinsane/?page=Join

I've come really close ... here's my best effort:

Options +FollowSymlinks
RewriteEngine on
RewriteBase /
RewriteRule ^(Join|Sponsor|Contact)/?$ ?page=$1

Two problems:

1) (Join Us|Sponsor Us|Contact Us) does not work.
2) I don't really want to list all of the possible variables because it will be a dynamic list that can change.

I have tried replacing (Join Us|Sponsor Us|Contact Us) with all sorts, for example (.*) but to no avail.

Can anyone help please?

Thanks,

Simon.

almostbob commented: Does the heart good, to see somebody do the work and then ask for help, instead of just ask do it for me +12
slyme 27 Junior Poster in Training

Ardav is correct Motorider, you do not have a variable function so that's not the problem.

Here's what I would do at this point:

Using phpMyAdmin or some MySQL tool I would simply run the select query and check for results. If that doesn't help, I would then replace all of the code inside the if statement with:

$search_result = 'form submitted';

Then I would submit the form just to check that side of it is working (which it should be).

One of these tests should highlight the problem. Perhaps you could add an if statement inside the database query to return 'no records found' if the search result is genuinely empty.

Let us know how it goes ...

Simon.

Motorider commented: He helped me out tremendously +1