dompdf font family issue

2019-07-23 20:23发布

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?

4条回答
看我几分像从前
2楼-- · 2019-07-23 20:36

Remove the quotes around helvetica.

查看更多
别忘想泡老子
3楼-- · 2019-07-23 20:38

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.

查看更多
\"骚年 ilove
4楼-- · 2019-07-23 20:52

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.

<div id="container" style="font-family:sans-serif;">
....
</div>
查看更多
贼婆χ
5楼-- · 2019-07-23 20:54

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.

查看更多
登录 后发表回答