Page 1 of 1
Font List
Posted: Sat Jul 05, 2003 11:51 am
by SBukoski
I have a question on fonts. Is it possible via Server Side scripts, or anything for that matter, to determine What fonts are installed on a users machine? The reason I ask is because I was throwing around the idea to be able to have the user more customize the appearance of the pages. To be fully customizable I wanted them to be able to select the FONT, but didn't want to create a blanket list. Especially since some fonts may not be on that users system.
Any ideas?
Thanks...
I'm searching for the same answer
Posted: Fri Aug 08, 2003 11:00 pm
by caboom
I am browsing the forum for this answer also. I am thinking maybe of reading the c:\WINDOWS\FONT directory of the local machine, and then looping the file names into a <option> of a html select tag.
what do you think is it possible?
Something like this
Posted: Fri Aug 08, 2003 11:35 pm
by caboom
Here is something like what i mean but I'm NOT getting the readout I want
<select name="font">
<?php
$current_dir="C:\\WINDOWS\\FONTS\\";
$dir=opendir($current_dir);
while ($file=readdir($dir)) {
echo "<option value=\"".$file."\">".$file."</option>\n";
}
closedir($dir);
?>
</select>
Posted: Sat Aug 09, 2003 12:54 am
by qartis
PHP is server-side. If you could read a client's hard drive, that would be pretty insecure. When you run opendir() on a directory, the server's hard drive is scanned for that directory.
I know you can dynamically and automatically load fonts onto a user's computer using CSS, so it may be possible to read their fonts too. If you can, it will be via browser transactions, not PHP. A CSS guru will be able to answer this question in a few seconds, so I'm not much use there.
maybe javascript
Posted: Sat Aug 09, 2003 10:20 am
by caboom
yes your right qartis... I was having a dumb moment there. I'm making a php script that allows a client to change the content of a web page by simply filling out a text area form. I want them to be able to click and choose the font they desire from a option drop down box. If they choose a font that is not on the server, that is there problem I'm not worried about that. Javascript is client side, maybe Javascript can read a clients machine directory.
Yes ? NO?
Maybe it would be easier to just make a static list.... but I was curious to see if this can be done.