font-weight:打火机"风格似乎不适用于飞碟中较轻的字体。有解决方案吗

时间:2013-10-21 05:34:57

标签: pdf-generation flying-saucer

我在源代码中包含了OpenSans-Light.ttf。如果我添加font-weight: lighterfont-weight: 200,则不会在PDF上应用。始终应用常规字体样式。

非常感谢任何解决方案/解决方法。

3 个答案:

答案 0 :(得分:2)

一种解决方法是使用.light {font-family:Open Sans Light}

以下是您获得的一个示例: enter image description here


另一个给出相同结果的解决方案是使用这样的字体:

@font-face {
  font-family: 'Open Sans';
  src: url("font/OpenSans-Regular.ttf");
  -fs-pdf-font-embed: embed;
  -fs-pdf-font-encoding: Identity-H;
}
@font-face {
  font-family: 'Open Sans';
  src: url("font/OpenSans-Light.ttf");
  font-weight:200;
  -fs-pdf-font-embed: embed;
  -fs-pdf-font-encoding: Identity-H;
}
.normal{font-family:Open Sans;}
.lighter{font-family:Open Sans;font-weight:200}

答案 1 :(得分:2)

mPDF不支持字体的多个权重 - 只是普通和粗体

http://www.mpdf1.com/forum/discussion/1369/open-sans-problems-with-bold-font-weight/p1

答案 2 :(得分:1)

正如@Lyuba所述,Evdokimova pdf generation engine可能不支持与给定字体相关的所有属性。

我相信所有这些都适用于web_safe字体。 您可以找到有关他们的更多信息here

相关问题