Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

special chars issue in firefox and IE using webfonts with utf8

I have a problem with the char ü using UTF-8 encoding and the fonts "Lato" and "Open Sans".

Using safari and chrome is no problem but when I'm Firefox on Windows or Mac or IE the problem can be seen here:

enter image description here

"Lato" and "Open Sans" are web fonts from Google - Helvetica is a local font.

Tested it also on BrowserStack - same issue.

So how can I fix that?

like image 984
CodeBrauer Avatar asked Oct 31 '13 10:10

CodeBrauer


People also ask

Why does Firefox display gibberish instead of the font I want?

This issue can be caused by an old bitmap version of the Helvetica or Geneva font or (bitmap) fonts that Firefox can't display in that size. Firefox can't display some old bitmap fonts in a larger size and displays gibberish instead.

How do I fix a font that doesn't work in Firefox?

You can test that by zooming out (View > Zoom > Zoom Out, Ctrl -) to make the text smaller. Uninstall (remove) all variants of that not working font to make Firefox use another font or see if you can find a True type version that doesn't show the problem.

What font do you use for the symbols on your website?

The font that Firefox and Opera manage to choose to render the symbols for me is Meiryo (a Japanese font installed with Windows Vista and later). On IE and WebKit it falls back to the much more limited selection of symbols available in Arial, leaving most of the characters missing.

Why can't I see the Helvetica font in Firefox?

Uninstall (remove) all variants of that not working font to make Firefox use another font or see if you can find a True type version that doesn't show the problem. There have also been fonts with a Chinese name reported that identify themselves as Helvetica, so check that as well.


1 Answers

The reason is that you have the letter “ü” represented in a decomposed form, as “u” followed by a combining diaeresis, e.g. in

<strong style="color: #CE5A5A;">Von der Gründung im Musikpark zur Marktführerschaft</strong>

Replace “ü” (U+0075 LATIN SMALL LETTER U U+0308 COMBINING DIAERESIS) by “ü” U+00FC LATIN SMALL LETTER U WITH DIAERESIS. They may well look exactly the same, but they may not – in this case, they will not, since Lato does not contain U+0308, so browsers pick it from Arial or another font, causing typographic disaster.

If you check the page with the W3C HTML5 validator, you will get a few warnings “ Text run is not in Unicode Normalization Form C.” At least one of them refers to “ä” in decomposed form (in “lädt”, which is badly displayed too), and it should be fixed too.

When you use decomposed forms for characters that exist in Unicode in precomposed form, too, such as “ä” and “ü”, the text is not in Normalization Form C (NFC). This is not invalid as such, but it is uncommon, and may cause problems like this, and it is general W3C policy (though not stated in HTML5 CR) to favor NFC.

like image 133
Jukka K. Korpela Avatar answered Oct 21 '22 01:10

Jukka K. Korpela