如何修复“自托管字体”无法加载

时间:2019-04-11 20:10:08

标签: css

正在设置网站,但自定义字体未加载。

字体(徽标)显示在不同的桌面浏览器上,但从未显示在移动浏览器上。我尽力了。这是我在CSS文件中尝试过的两种不同版本:

@font-face {
  font-family: 'Haettenschweiler';
  src: url('hs-regular.eot'); /* IE9 Compat Modes */
  src: url('hs-regular?#iefix') format('embedded-opentype'), /* IE6-IE8 */
       url('hs-regular.woff2') format('woff2'), /* Super Modern Browsers */
       url('hs-regular.woff') format('woff'), /* Pretty Modern Browsers */
       url('hs-regular.ttf')  format('truetype'), /* Safari, Android, iOS */
       url('hs-regular.svg#svgFontName') format('svg'); /* Legacy iOS */
}

AND

@font-face {
  font-family: 'Haettenschweiler';
  src: url('../fonts/hs-regular-webfont.eot');
  src: url('../fonts/hs-regular-webfont.eot?#iefix') format('embedded-opentype'),
       url('../fonts/hs-regular-webfont.woff2') format('woff2'),
       url('../fonts/hs-regular-webfont.woff') format('woff'),
       url('../fonts/hs-regular-webfont.ttf') format('truetype'),
       url('../fonts/hs-regular-webfont.svg#geomanistregular') format('svg');
  font-weight: normal;
  font-style: normal;
}

同样,桌面站点将按要求加载。但不是移动的。

0 个答案:

没有答案