View Full Version : [JS] Check if a font is installed
Calon
30-12-2008, 03:42 PM
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..
font-family: Arial, System;
Is there any way to check if system is being used if Arial isn't being used?
Invent
30-12-2008, 03:46 PM
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.
Agnostic Bear
30-12-2008, 03:47 PM
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.
Invent
30-12-2008, 03:48 PM
You'd have to have a lot of values, I admit that :P 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-to-detect-if-a-font-is-installed-only-using-javascript/
Calon
01-01-2009, 12:18 AM
You'd have to have a lot of values, I admit that :P 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-to-detect-if-a-font-is-installed-only-using-javascript/
Jesus christ! Thank you, I've been looking for ages. :P
Want to hide these adverts? Register an account for free!
Powered by vBulletin® Version 4.2.5 Copyright © 2026 vBulletin Solutions Inc. All rights reserved.