Comment 5 for bug 1395176

Revision history for this message
Kovid Goyal (kovid) wrote : Re: calibre bug 1395176

You are embedding the fonts incorrectly. For example, for your italics
file, use the following @font-face rules:

@font-face {
  font-family: "Berling";
  src: url(OEBPS/fonts/BerlingRoman.ttf);
  }
@font-face {
  font-family: "Berling";
  src: url(OEBPS/fonts/berlingi.ttf);
  }
@font-face {
  src: url(fonts/Berling-Roman.ttf);
  panose-1: 2 0 5 3 8 0 0 2 0 4;
  font-family: "Berling";
  }
@font-face {
  src: url(fonts/Berling-Italic.ttf);
  font-style: italic;
  panose-1: 2 0 5 3 8 0 0 9 0 4;
  font-family: "Berling";
  }

Note how the font family for all the fonts is the same. The font-family
in the @font-face rule should always match the actual font-family
declared inside the ttf file.

And then in the CSS for hte actual text, to get italic style, use font-style:italic

While what you are doing is "technically" correct, it is not
recommended. Use the correct form and you should be fine.

I may at some point spend some time seeing if I can get PDF output to
support font family aliasing, but it is unlikely.

 status invalid