特殊字符问题在Firefox和IE浏览器使用utf8的webfonts [英] special chars issue in firefox and IE using webfonts with utf8

查看:209
本文介绍了特殊字符问题在Firefox和IE浏览器使用utf8的webfonts的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用UTF-8编码和字体 Lato 和char ü使用safari和chrome是不成问题的,但是当我是Windows或Mac上的Firefox或者IE的问题可以在这里看到:




$ b

Lato Open Sans 是webfonts来自Google - Helvetica是一种本地字体。



在BrowserStack上也测试过 - 同样的问题。我能修好吗?



问题

解决方案

原因在于您将字母ü以分解形式表示为u 接着是一个结合diaeresis,例如in

 < strong style =color:#CE5A5A;> Von derGründungim Musikpark zurMarktführerschaft< / strong> 

将ü(U + 0075拉丁文小写字母U + 0308合并) U + 00FC拉丁文小写字母U。他们可能看起来完全一样,但他们可能不会 - 在这种情况下,他们不会,因为拉托不包含U + 0308,所以浏览器从Arial或另一种字体中选择,导致印刷灾难。



如果您使用 W3C HTML5验证程序检查页面,您将获得很少有警告文本运行不在Unicode规范化表单C中。其中至少有一个表示分解形式的ä(在ldd中显示不好),也应该修复。 >

当您使用分解后的形式存储在以Unicode形式存在的字符(如ä和ü)中时,文本不在Normalization Form C(NFC) 。这不是无效的,但是这是不常见的,并且可能会导致这样的问题,并且W3C的一般政策(虽然没有在HTML5 CR中声明)有利于NFC。


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:

Lato and Open Sans are webfonts from Google - Helvetica is a local font.

Tested it also on BrowserStack - same issue.

So how can i fix that?

Website with the issue

解决方案

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.

这篇关于特殊字符问题在Firefox和IE浏览器使用utf8的webfonts的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆