html - epub 中忽略多个 @font-face

标签 html css fonts epub

我正在使用 calibre 元素中的 ebook-convert 生成带有嵌入字体的 EPUB 文件。当我在 HTML 中声明多个字体时,它工作正常:

<html>
<head>
<style type="text/css">
@font-face{
font-family: "test";
font-style: normal;
font-weight: normal;
font-variant: normal;
src: url(fonts/EBGaramond12-Regular.otf);
}
@font-face{
font-family: "test";
font-style: italic;
font-weight: normal;
font-variant: normal;
src: url(fonts/EBGaramond12-Italic.otf);
}
body{
font-family: "test";
}
</style>
</head>
<body>
This is a test with <i>italic</i>.
</body>
</html>

产生:

fonts in HTML

但是当我将其转换为 EPUB 时,我只获得整个文档的第一个字体:

same code in the EPUB

我检查了 EPUB。字体已正确嵌入,并且包含 CSS。不会与我的系统字体发生冲突,因为我使用“test”作为字符串来识别字体。

EPUB 有什么问题吗?我是否声明字体错误?

最佳答案

这个blog post about epub fonts可能有帮助

关于html - epub 中忽略多个 @font-face,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12148614/

相关文章:

javascript - 获取多个类的属性值

javascript - CSS - 使内容在动画背景前面

java - 如何在 Java Swing 的 JLabel 中设置行间距/高度?

php - @font-face 或自定义字体在 PHP pdf 生成器类中不起作用

javascript - 悬停时连续/无限水平滚动

html - 在没有系统字体的环境中测试网页

html - 使用 CSS 设置图像的纵横比

html - 我们可以使用 Vala 和 Glade Interface Designer 为 Ubuntu 编写应用程序吗?

css - 快速 CSS 悬停问题

javascript - 将网站分为 3 个部分 -> 1 个水平部分和 2 个垂直部分