dompdf 字体系列问题
我正在使用 Bamboo Invoice 作为发票生成器,并且我正在尝试自定义发票模板,但无论我做什么,字体似乎都无法调整。
目前我已经
body {
margin: 0.5in;
font-family: 'helvetica';
font-size: 10pt;}
阅读过它,并且 helvetica 是一种已安装的字体,因此它应该可以
确保我将其更改为“courier”;它也在 lib/fonts 目录中,但字体保持不变。
有什么帮助吗?
I'm using Bamboo invoice as an invoice generator, and I'm trying to customize the invoice template, but no matter what I do, the font just won't seem to adjust.
currently I have
body {
margin: 0.5in;
font-family: 'helvetica';
font-size: 10pt;}
I've read up on it, and helvetica is an installed font, so it should work
to make sure I changed it to 'courier'; which is also in the lib/fonts directory, but the font remains the same.
Any help?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
有点晚了,但仍然适用于谷歌访问者
我对 DomPDF 也有类似的问题,但由于 BambooInvoice 使用它......无论如何,DomPDF 在 CSS 中的字体系列定义方面遇到了麻烦。我将内联样式应用于顶部 div 框来解决该问题。
Kinda late, but still applicable for google visitors
I had a similar problem with DomPDF, but since BambooInvoice uses it... Anyway DomPDF has trouble with the font-family definition in the CSS. I applied inline style to the top div box to solve the problem.
我通过删除作为“css-reset”应用于几乎所有元素的
font:继承
来解决我的问题,作为第一个声明。显然这不会被后来的声明覆盖,和/或继承不能正常工作。I solved my problem by removing a
font: inherit
that was applied as a 'css-reset' to almost all elements as a first declariation. Apparently this is not overridden by later declarations, and/or inherit doesn't work properly.当尝试使用 font-family 或 font-size 时,我在 DomPDF 6b3 上遇到了类似的问题。最后发现使用font而不是那些似乎有效。
I had similar problem with DomPDF 6b3 when trying to use font-family or font-size. Finally discovered that using font instead of those seems to be working.
删除
helvetica
周围的引号。Remove the quotes around
helvetica
.