css font-face加载ttf字体文件失败

css font-face加载ttf字体文件失败

OTS parsing error: OS/2: Failed to parse table

代码如下:

@font-face{
    font-family: 'PlainWhite';
    src: url('res/font/PlainWhite.ttf') format('truetype')
}

错误如下:

图片描述

阅读 11.1k
2 个回答

1.贴出错误相关的代码

  1. 贴出错误信息
  2. 贴出你的字体等引用的配置信息

这样的问题,没人能回答

stackoverflow上有答案;
https://stackoverflow.com/que...
字体格式需要兼容,你需要多个字体以便应对多种场所,用https://transfonter.org/这个...。css加上这些

@font-face {
  font-family: 'MyWebFont';
  src: url('webfont.eot'); /* IE9 Compat Modes */
  src: url('webfont.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
       url('webfont.woff2') format('woff2'), /* Super Modern Browsers */
       url('webfont.woff') format('woff'), /* Pretty Modern Browsers */
       url('webfont.ttf')  format('truetype'), /* Safari, Android, iOS */
       url('webfont.svg#svgFontName') format('svg'); /* Legacy iOS */
}
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题