2

.Woffフォント(Ubuntu)をダウンロードしました。これに関連するコードは次のとおりです。

  @font-face {
  font-family: 'Ubuntu';
  font-style: normal;
  font-weight: 400;
  src: local('Ubuntu'), url(http://themes.googleusercontent.com/static/fonts/ubuntu/v4/_xyN3apAT_yRRDeqB3sPRg.woff) format('woff');
}

ダウンロードして、cssフォルダーに直接配置しました。

src値を次のように変更しました。

src: local('Ubuntu'), url(ubuntu.woff) format('woff');

(フォントの名前をUbuntu.woffに変更しました)しかし、フォントがローカルURLで機能しないため、Chromeが提供するパスを確認しました(whatever / whatever / css / Ubuntu.woffにあるフォントが見つかりません)。道。なぜそれが機能しないのか誰かが知っていますか?

4

2 に答える 2

1

I tried the same thing with another .woff Google web font, but on Windows. Apparently windows said the file format was not valid.

于 2012-09-10T09:20:59.147 に答える
1

I was able to find some Woff to TTF converter on the Internet, fixing the issue this way was a great alternative.

于 2013-01-03T13:50:20.290 に答える