Mat*_*Cat 5 fonts opentype webfonts roboto
我按照google/roboto存储库中的说明进行操作,但没有任何OTF文件可用作webfont.
我能得到的唯一反馈是Chrome说无法解码下载的字体.
OTS说一切都很好.
为什么这样,我如何在网络上使用Roboto opentype功能?
仅供参考我也开了google/roboto#283
以下是生成的字体之一:https://drive.google.com/open?id = 157_ -UBTyswylqY3DOK-mKihd7Vk-vFA_
Apparently the generated OTF font is not encoded properly for the web \xe2\x80\x94 all browsers have different font rendering engines and the decoding of this file fails in Chrome and Firefox, and even Font Squirrel reports The font is corrupt and cannot be converted. Funnily enough works just fine in Safari.
\n\nIf you want to use the Roboto font features you\'ll have to generate your own web fonts. I have created a demo page that demonstrates some of Roboto\'s font features, with various web fonts (woff2, woff, otf, ttf) going through the following steps:
使用 google/roboto 存储库运行后,make您应该在目录中获得 TTF 字体RobotoTTF。这些文件包含 Roboto 的所有字体功能,您可以使用它们来生成网络字体文件。如果您愿意,甚至可以使用 TTF 字体:
@font-face {\n font-family: \'Roboto\';\n font-style: normal;\n font-weight: 400;\n src: local(\'Roboto\'), local(\'Roboto-Regular\'), url(\'./Roboto-Regular.ttf\') format(\'truetype\');\n}\nRun Code Online (Sandbox Code Playgroud)\n\n尽管您的文件大小会很大,并且您绝对应该将它们转换为其他网络字体格式(产生最佳结果并且所有现代浏览器都支持woff2)以显着减小文件大小,因此您的@font-face declaration would be:
@font-face {\n font-family: \'Roboto\';\n font-style: normal;\n font-weight: 400;\n src: local(\'Roboto\'), local(\'Roboto-Regular\'), url(\'./Roboto-Regular.woff2\') format(\'woff2\');\n}\nRun Code Online (Sandbox Code Playgroud)\n\n您仍然可以在生成的 Web 字体中包含和使用字体功能,并在 CSS 代码中使用它们:
\n\n.yourclass {\n font-feature-settings: ...;\n}\nRun Code Online (Sandbox Code Playgroud)\n\n您可以在线和在计算机上使用许多工具。我尝试了以下方法,这些方法可以很好地将 OpenType 功能保留在生成的 Web 字体中:
\n\n顺便说一句,您可能会发现LCDF Typetools很有用,特别是otfinfo用来otfinfo -f Roboto-Regular.ttf列出字体支持的所有功能。
以下是 Roboto 字体的功能列表:
\n\n我希望您会发现这很有帮助。
\n\n**由于与更新的问题无关而被删除
\n| 归档时间: |
|
| 查看次数: |
804 次 |
| 最近记录: |