Is it possible to determine from the application whether the user's browser supports any character by its code (unicode) or, for example, does it support Cyrillic? And in general, I did not quite understand the fonts. What does it depend on? From the fonts installed in the system, probably?

    1 answer 1

    If we are talking about Cyrillic, the browser supports it. But fonts to display may not be.

    You can check, probably, by drawing the text on the canvas and comparing the drawing with the required letter (which is nontrivial), but this requires a browser that can <canvas> , i.e. HTML5. I don’t believe, to be honest, that modern browsers come with OSs that don’t drag Cyrillic fonts with you. If it were about CJK - is another matter, but European languages, as a rule, are able to do everything now.

    As a solution, if there are too many problematic clients, drag a @font-face through the CSS @font-face . There will be exactly the characters.

    • These characters will be output to canvas . Browsers that do not support HTML5 are not considered initially. Symbols: one of them is Cyrillic, the other - "Ć". It is necessary that the characters are displayed correctly and if this is not possible, do not display them, but do another action. Everything works locally for me, but I’m not sure that users who do not use the Cyrillic alphabet will work. For example, I have some characters from other languages ​​not displayed, instead of these squares. - angry
    • everything will work, all bravseri support Cyrillic - L. Vadim
    • With fonts, too, sometimes there are problems . - Qwertiy