HTML help: Vertical Layout

T

TheJkWhoSaysNi

Guest
your best bet is to create the text as an image, vertically. then it will be supported by all browsers.
 
S

(Shovel)

Guest
You mentioned that the text is dynamic content. The best bet for that, for full browser compat, is to use PHP to generate the image for you.

That, so far as I can see, is the only way I can see it being multi platform. Maybe a Java applet?
 
M

Mr. 47

Guest
you need quite a rare PHP plugin to do images, a summit libery
 
J

Jonty

Guest
So long as you don't need a lot of special eye candy, I believe BarrysWorld has all the necessary libraries installed for dynamic image creation on the fly.

Kind Regards
 
J

Jonty

Guest
Hello again

I took the liberty of writing you a little test code. This should help you get some idea of what to do, although naturally this is fairly basic and would need modifying.

Step One Create a new, blank PHP file, and insert the following code into it . . .

Code:
<?php
[i]// Retrieve the text to be outputted[/i]
$MyText = "Hello world!";
[i]// Define the output type[/i]
header("Content-type: image/png");
[i]// Create a new image (x,y)[/i]
$MyImage = @imagecreate(30, 100);
[i]// Define the background colour (RGB value)[/i]
$MyBackgroundColour = imagecolorallocate($MyImage, 0, 51, 102);
[i]// Define the text colour (RGB value)[/i]
$MyTextColour = imagecolorallocate($MyImage, 255, 255, 255);
[i]// Render the text vertically[/i]
imagestringup($MyImage, 2, 7, 95, $MyText, $MyTextColour);
[i]// Output the result to the browser as a PNG image[/i]
imagepng($MyImage);
[i]// Free up any associated resources[/i]
imagedestroy($MyImage);
?>

Step Two Upload the PHP file, and target it as the <img /> tag's src attribute, i.e.

Code:
[img]http://www.someurl.somesuffix/image.php[/img]

The fun really starts when you begin passing text strings to the PHP file, and trying to beautify the whole thing. For the last word in PHP image creation, check out http://www.php.net/image

Kind Regards
 
M

Mr. 47

Guest
wow, i've been meaning to test image creation for some time, just never botherd to learn how to do it...
 
J

Jonty

Guest
Originally posted by Mr. 47
wow, i've been meaning to test image creation for some time, just never botherd to learn how to do it...

:) To be honest, it is quite easy, but as with most things it becomes more complex the fancier you try and make things.

Anyway, just wanted to say that some of the more advanced libraries may not be installed on BarrysWorld, but as far as I am aware this shouldn't impact on anyone's plans unless you're wanting to create some very sophisticated images.

Kind Regards

Jonty

P.S. Naturally BarrysWorld is the hostess with the mostess [ ;) ] so if you really need a specific PHP library, and it's publicly acknowledged on the PHP.net site, and the library itself is nice and stable, then there is a chance it may be installed. Naturally DBs has the last word.
 
S

Shocko

Guest
Wow, good stuff :) How server-intensive is a script like that?

I've always been under the impression that the php image functions are very cpu-heavy... Does using png rather jpeg compression help there?
 
J

Jonty

Guest
To be honest I couldn't tell you, but I think DBs would have kicked my door down and taken a baseball bat to my head if this kind of thing place a high load on the server ;)

Again, whether using PNG or JPEG really makes a difference, I don't know. I presume that JPEG would be more CPU intensive, but you do have the option of setting a compression parameter when outputting.

Anyway, in short, if the images are relatively simple and small in size, then I doubt there should be any problems ( . . . famous last words ;) ).

Kind Regards
 
M

M4nimal

Guest
Jonty:

THANK YOU very much man, I really appreciate this... I will be testing to see if I can get this to work.

Once again, I really appreciate this man.

Regards
m4

ps: nice site dude!
 
J

Jonty

Guest
My pleasure. If you need any more help then please do post again and we'll see what we can do :)

Kind Regards

Jonty

P.S. Thanks for the comments on my site ;) As it gets completed it will hopefully get better :)
 

Users who are viewing this thread

Top Bottom