我的客户希望tu在HTML电子邮件中使用自定义字体。我知道这在浏览器中存在一些兼容性问题,但是我的感觉是,大多数电子邮件客户端通常会正确显示它,其他电子邮件客户端可能会使用后备字体,而其他黑客也可以使用这些黑客(例如通常的Outlook)。
https://litmus.com/blog/typography-tips-for-email-designers
我无法理解的是:如果我有自定义字体,可以作为自己的字体提供者立即将其用作网络字体吗?还是需要进行任何转换,或者进行某种配置?有可能吗?我知道的唯一的Webfont提供者是Google字体。
最佳答案
要使用自定义的网络字体,您需要对其进行转换(例如https://www.web-font-generator.com/);将其解压缩到您的css文件中,然后将这些行添加到您的css文件(或带有的html文件)中,即可使用:
@font-face {
font-family: 'proxima_nova_rgbold';
src: url('../fonts/proximanova-bold-webfont.eot');
src: url('../fonts/proximanova-bold-webfont.eot?#iefix') format('embedded-opentype'),
url('../fonts/proximanova-bold-webfont.woff2') format('woff2'),
url('../fonts/proximanova-bold-webfont.woff') format('woff'),
url('../fonts/proximanova-bold-webfont.ttf') format('truetype'),
url('../fonts/proximanova-bold-webfont.svg#proxima_nova_rgbold') format('svg');
font-weight: normal;
font-style: normal;
}