Discover Habbo's history
Treat yourself with a Secret Santa gift.... of a random Wiki page for you to start exploring Habbo's history!
Happy holidays!
Celebrate with us at Habbox on the hotel, on our Forum and right here!
Join Habbox!
One of us! One of us! Click here to see the roles you could take as part of the Habbox community!


Results 1 to 5 of 5
  1. #1
    Join Date
    Jul 2008
    Location
    Hastings, UK.
    Posts
    2,050
    Tokens
    0

    Latest Awards:

    Default [JS] Check if a font is installed

    I was wondering if there's any way to check if a font is installed, which could work with the CSS, I really only know how to use things like prototype so this is way out of anything I know about JS, but..

    Code:
    font-family: Arial, System;
    Is there any way to check if system is being used if Arial isn't being used?

  2. #2
    Join Date
    May 2005
    Location
    San Francisco, CA
    Posts
    7,160
    Tokens
    2,331

    Latest Awards:

    Default

    You could check the offsetWidth of the first font to see if it matches what has been displayed on the page. If the widths of the font and what's on the page are the same, then the font has been rendered properly and the end-user has the font installed.

  3. #3
    Join Date
    Oct 2006
    Location
    Peterborough, UK
    Posts
    3,855
    Tokens
    216

    Latest Awards:

    Default

    Quote Originally Posted by Invent View Post
    You could check the offsetWidth of the first font to see if it matches what has been displayed on the page. If the widths of the font and what's on the page are the same, then the font has been rendered properly and the end-user has the font installed.
    Impossible, Cleartype, non cleartype, the 110290092019302891309123012840198410984 different types of rendering on Linux, the different types of rendering on Mac, it's impossible to tell.


    visit my internet web site on the internet
    http://dong.engineer/
    it is just videos by bill wurtz videos you have been warned

  4. #4
    Join Date
    May 2005
    Location
    San Francisco, CA
    Posts
    7,160
    Tokens
    2,331

    Latest Awards:

    Default

    You'd have to have a lot of values, I admit that But that's one of the only ways I can imagine it being possible using 100% Javascript.

    Though, I just found this; http://remysharp.com/2008/07/08/how-...ng-javascript/

  5. #5
    Join Date
    Jul 2008
    Location
    Hastings, UK.
    Posts
    2,050
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by Invent View Post
    You'd have to have a lot of values, I admit that But that's one of the only ways I can imagine it being possible using 100% Javascript.

    Though, I just found this; http://remysharp.com/2008/07/08/how-...ng-javascript/
    Jesus christ! Thank you, I've been looking for ages.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •