Google Chrome 字符错误 - 错误?

Google Chrome wrong character - bug?

我做了这个简单的 HTML 来告诉你是什么困扰着我..

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

<html>

    <style>
        @font-face {
            font-family: "ubuntu-light";
            src: url(Font/ubuntu/Ubuntu-L.ttf) format("truetype");
        }

        h1 {
            font-family: "ubuntu-light";
        }
    </style>

    <body>
        <h1>Ubuntu font test</h1>
        <h1>Š š Ž ž Č č</h1>
    </body>
</html>

您可以在这里获取字体:http://font.ubuntu.com

所以关键是,如果我在 Safari 或 Firefox 中打开页面,页面会正确打开,但是如果我在 Chrome 中打开它,字母 Š 和 š 显示不正确。

我试着把它放在我的风格中,但没有用:

body {
    -webkit-animation-duration: 0.5s;
    -webkit-animation-name: fontfix;
    -webkit-animation-iteration-count: 1;
    -webkit-animation-timing-function: linear;
    -webkit-animation-delay: 0.5s;
}

@-webkit-keyframes fontfix {
from {opacity: 1;}
to {opacity: 1;}
}

我也试过用这种风格创建一个CSS文件,然后用JS在页面的末尾调用它,但它不起作用。

我在 Apache 中有 "AddDefaultCharset utf-8"。在 Google Chrome 中,我将编码设置为中欧和 UTF-8,但什么都没有..

这确实是一个错误,请参阅启动板上的描述:Bug #1334363 “Wrong characters appear in some Mac apps ([‘] → [⁸], [’] → [⁹], [–] → [ẃ], [—] → [Ẅ])” : Bugs : Ubuntu Font Family

原因似乎是 Unicode cmap 子表损坏。

如果您使用 Ubuntu 的精简版本,例如 Google 字体提供的子集版本,例如具有以下样式,则可以避免此错误:

@import url(http://fonts.googleapis.com/css?family=Ubuntu:300&subset=latin);

但是,在安装了Ubuntu字体的计算机上,字符仍然看起来不对。

如果你想在你自己的电脑上修复显示 如果你不需要完整的 Ubuntu 字体,你可以从Google 字体。为此,请在 Safari 中访问以下 Google 字体样式表,复制 TTF 文件的链接并下载它们(在其他浏览器中,Google 字体样式表将使用您无法安装的 WOFF 字体生成在 Mac OS X):

http://fonts.googleapis.com/css?family=Ubuntu:300,400,500,700,300italic,400italic,500italic,700italic|Ubuntu+Condensed&subset=latin,latin-ext