Page 1 of 1

PHP Novice Question: Fonts in PHP

Posted: Tue Oct 03, 2006 7:30 am
by phpnovice27
Hi all,

I'm new to PHP - very new so I have a novice question. All I want to do is use Arial font for some text that I'm displaying in a php file. The function that I'm using to display that text is 'imagestring'. Does anyone know the easiest way that I can display text in Arial font with that function (or perhaps i need to use some other function). What I was hoping is that I could use a CSS file to format the text displayed in the php file using the imagestring function. I don't know if that is possible, suppose that's another question I have. I'm a novice when it comes to CSS as well.

Hope you guys can help.

Cheers

Posted: Tue Oct 03, 2006 7:36 am
by volka
PHP doesn't render the text, it only provides the html document and sends it to the browser. So this is a question about html and/or css.
Take a look at http://www.w3schools.com/css/css_font.asp

Posted: Tue Oct 03, 2006 7:37 am
by feyd
imagestring() has a sister function called imagettftext()

Posted: Tue Oct 03, 2006 10:29 am
by Luke
just checking... you know you can use print or echo to output text instead of drawing text on an image, right?

Posted: Wed Oct 04, 2006 7:12 am
by phpnovice27
well i want the text to appear at a particular location that is why i am using imagestring.

So am I right to say that PHP just produces html and if we use CSS on that html then that php rendered html will get formatted? If this is true then my problem changes. I have put the php file's output in an iframe. My question now changes to: how do I apply CSS to an iframe - if that will indeed format the php file's output?

Thanks