PDA

View Full Version : how to make it change text if user doesnt have it?



sphinx1994
Apr 16th, 2009, 04:44 PM
Hello,

On my site, I use the font : Arabic Typesetting now on my laptop it displays fine, but on my other pc it displays horribly because my other pc obviously doesnt have that font, is their a way that i can make it so that if the viewer doesnt have Arabic Typesetting it will change to arial and change font size, because i currently have Arabic Typesetting on large, but if it changed to arial large is massive, i used this code:


.style3 {
color: #FFFFFF;
font-family: "Arabic Typesetting", Arial; //if user doesnt have arabic font, do arial font..
font-size: large; // large is massive on arial =()

}


it works my pc that doesnt have the arabic font, it now does arial but it is massive, does anyone know what i can do?

Thanks

venegal
Apr 16th, 2009, 05:02 PM
You can use Javascript to detect if the font is installed and change font-size accordingly.
http://www.lalit.org/lab/javascript-css-font-detect

sphinx1994
Apr 16th, 2009, 05:08 PM
is javascript required? couldn't you have something like this?


.style3 {
color: #FFFFFF;
font-family: "Arabic Typesetting", Arial;
Arabic Typesetting font-size: large;
Arial font-size: small;

}

It's wrong but it's an example?

VIPStephan
Apr 16th, 2009, 05:11 PM
It's wrong but it's an example?

Itís an example but itís not possible that way.

sphinx1994
Apr 16th, 2009, 05:12 PM
so i need javascript to do it?

venegal
Apr 16th, 2009, 05:16 PM
Yes, CSS doesn't work that way.