- This topic is empty.
Viewing 10 posts - 1 through 10 (of 10 total)
Viewing 10 posts - 1 through 10 (of 10 total)
- The forum ‘JavaScript’ is closed to new topics and replies.
The forums ran from 2008-2020 and are now closed and viewable here as an archive.
Home › Forums › JavaScript › Marking fallback characters
Would it be possible to highlight characters that are missing in the current font and automatically get substituted by the browser?
Interesting..not sure how but it sounds useful.
Well, is it possible to detect what font is actually used in rendering?
Well, is it possible to detect what font is actually used in rendering?
You set the fonts…shouldn’t you know?
I do know; I was talking about detecting fallback fonts. Would finding out what font the browser uses even be possible with Javascript?
I don’t understand…why would you need to detect fallback fonts?
If the current font doesn’t have a character it doesn’t fallback on the next one to try and find it.
Fallback fonts are only there in case your primary font fails completely at least AFAIK.
No, actually if there are any missing exotic characters in the current font the browser will replace them with the same characters from another font that has them. You can even see which font is used in the browser’s Inspector. Those are the instances that I’d like to be able to highlight.
Don’t suppose there’s been any update on this? In the same boat.
The only close solution I can find is detecting if a font is installed, not detecting if a glyph is missing.
E.g. http://www.lalit.org/lab/javascript-css-font-detect/
If you want a good indication if a special character is missing visually, you can set the next fallback to serif if you’re using a fancy sans-serif font. E.g:
font-family: "totally-fancy-sans-font", serif;
The missing characters will stick out like a sore thumb.
Many Google Fonts do not have glyphs for accented characters. They fall back to some standard font and you often have to look really closely to see whether “é” with an accent looks out of place compared to the “e” without an accent.
Worse, I actually typed an e-acute in that comment. Chrome DevTools shows the e with the accent, but the font just shows an “e”.