Closed bennettmcelwee closed 13 years ago
Thank you very much Bennett, The test is comprehensive and I could see what the problem is. I will merge it tomorrow (GMT -6) since now I'm just busy with a final paper. Detecting fallback has always been a problem for us. There is no universal, easy workaround to it. Your code will be a great help.
Merged.
WhatFont is awesome -- I have been looking for something like this for ages. Here's a patch to fix an issue I have found.
If the font family contains only fonts that aren't installed, then WhatFont reports that the rendered font is the first one in the list. It should report that the default font is used. I made a test page at http://www.thunderguy.com/public/whatfont-test.html that shows the issue.
My change does the following: If a single font matches the font stack, then check whether the rendered font is really installed. This is necessary because if none of the fonts in the stack are installed then the rendered font will always be the browser's default font, so it will match the font stack even though the font is not installed.