Dompdf: PDF engines have access to custom font files for headings .

Created on 28 Oct 2016  路  3Comments  路  Source: dompdf/dompdf

I write css style. Like this:

@font-face {
  font-family: PT-Serif-Regular;
  src: url(pt-serif.regular.ttf);
}

body {
  font-family: PT-Serif-Regular, sans-serif;
}

Everything under paragraph is the font that I want.

The problem occurs in the title.

http://prntscr.com/d049et

Is there a difference between paragraphs and headings .

The text under h1 and h2, are not recognizable.

question

Most helpful comment

Since H1 and H2 are styled as bold by default you also have to define the font file to use for that variant of your font family.

@font-face {
  font-family: PT-Serif-Regular;
  font-variant: normal;
  font-weight: bold;
  src: url("pt-serif.regular.ttf") format("truetype");
}

All 3 comments

Since H1 and H2 are styled as bold by default you also have to define the font file to use for that variant of your font family.

@font-face {
  font-family: PT-Serif-Regular;
  font-variant: normal;
  font-weight: bold;
  src: url("pt-serif.regular.ttf") format("truetype");
}

Its work.

http://prntscr.com/d04jcl

Thank you a lot.

Might have to update the documentation about that...

Was this page helpful?
0 / 5 - 0 ratings

Related issues

danielson317 picture danielson317  路  4Comments

AnarchyChampion picture AnarchyChampion  路  3Comments

jewei picture jewei  路  4Comments

OlegKorn picture OlegKorn  路  4Comments

sunscreem picture sunscreem  路  4Comments