我正在使用 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>
产生:
但是当我将其转换为 EPUB 时,我只获得整个文档的第一个字体:
我检查了 EPUB。字体已正确嵌入,并且包含 CSS。不会与我的系统字体发生冲突,因为我使用“test”作为字符串来识别字体。
EPUB 有什么问题吗?我是否声明字体错误?
最佳答案
这个blog post about epub fonts可能有帮助
关于html - epub 中忽略多个 @font-face,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12148614/