Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Marking fallback characters

  • This topic is empty.
Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #199361
    inktrap
    Participant

    Would it be possible to highlight characters that are missing in the current font and automatically get substituted by the browser?

    #199363
    Paulie_D
    Member

    Interesting..not sure how but it sounds useful.

    #199491
    inktrap
    Participant

    Well, is it possible to detect what font is actually used in rendering?

    #199506
    Paulie_D
    Member

    Well, is it possible to detect what font is actually used in rendering?

    You set the fonts…shouldn’t you know?

    #199611
    inktrap
    Participant

    I do know; I was talking about detecting fallback fonts. Would finding out what font the browser uses even be possible with Javascript?

    #199615
    Paulie_D
    Member

    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.

    #199619
    inktrap
    Participant

    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.

    #202980
    duncan.mckenna
    Participant

    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.

    #267690
    jpeg729
    Participant

    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.

    #267691
    jpeg729
    Participant

    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”.

Viewing 10 posts - 1 through 10 (of 10 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.