Web Analytics Made Easy -
StatCounter how to make it change text if user doesnt have it? - CodingForum

Announcement

Collapse
No announcement yet.

how to make it change text if user doesnt have it?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • how to make it change text if user doesnt have it?

    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:

    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

  • #2
    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
    .My new Javascript tutorial site: http://reallifejs.com/
    .Latest article: Calculators — Tiny jQuery calculator, Full-fledged OOP calculator, Big number calculator
    .Latest quick-bit: Including jQuery — Environment-aware minification and CDNs with local fallback

    Comment


    • #3
      is javascript required? couldn't you have something like this?

      Code:
      .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?

      Comment


      • #4
        Originally posted by sphinx1994 View Post
        It's wrong but it's an example?
        It’s an example but it’s not possible that way.
        Stop solving problems you don’t yet have!

        Comment


        • #5
          so i need javascript to do it?

          Comment


          • #6
            Yes, CSS doesn't work that way.
            .My new Javascript tutorial site: http://reallifejs.com/
            .Latest article: Calculators — Tiny jQuery calculator, Full-fledged OOP calculator, Big number calculator
            .Latest quick-bit: Including jQuery — Environment-aware minification and CDNs with local fallback

            Comment

            Working...
            X