Forum Bugs

Incorrect font weight in Prince 14

davidronk
Running Prince 14.1 on Ubuntu 16 using the sample.html file below yields a pdf that uses Helvetica Bold instead of the specified Helvetica Normal. We haven't modified fonts.css.
The same sample.html file yields a pdf (correctly) using Helvetica Normal with Prince 13.5 on the same machine.
Also the pdf generates correctly on MacOS using Prince 14 and 13

Debug logging shows:
/prince/versions/14/lib/prince/bin/prince -vvv --debug ~/tmp/sample.html
...
prince: debug: font request: Helvetica
prince: debug: font scan: helvetica
prince: debug: found font: helvetica Regular
prince: debug: duplicate font: helvetica Regular
prince: debug: found font: helvetica Italic
prince: debug: found font: helvetica Italic
prince: debug: font scan: helvetica, 4 matches
...
prince: loading font: /usr/share/fonts/truetype/osxcorefonts/HelveticaBold.ttf
prince: debug: loaded resource: /usr/share/fonts/truetype/osxcorefonts/HelveticaBold.ttf
prince: debug: loaded resource: type: no
prince: used font: Helvetica, Bold

Full log: debug_log_prince_14_1.txt‎

sample.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
  <head>
    <style type="text/css">
    *,
    *[style] {
      font-weight: normal !important;
    }
    body, html{
      font-size:9.5pt;
      line-height:12pt;
      font-family: Helvetica;
      font-weight: normal;
    }
    </style>
  </head>
  <body>
    <div>Testing 123...</div>
  </body>
</html>
  1. debug_log_prince_13_5.txt3.6 kB
    Full debug log for Prince 13.5
  2. debug_log_prince_14_1.txt5.7 kB
    Full debug log for prince 14.1
  3. sample_prince14_1.pdf7.1 kB
    Sample using Prince 14.1
  4. sample_prince_13_5.pdf7.3 kB
    Sample using Prince 13.5
mikeday
Thanks, we will investigate this issue.
mikeday
What output do you get when running "fc-list Helvetica"?
davidronk
$ fc-list Helvetica
/usr/share/fonts/truetype/osxcorefonts/HelveticaBoldOblique.ttf: Helvetica:style=Bold Oblique,粗斜體,Fed kursiv,Fett\, Kursiv,Puolilihava kursiivi,Gras italique,Grassetto corsivo,ボールド・イタリック,볼드 이탤릭체,Vet Cursief,Fet kursiv,Negrito Itálico,Жирный курсивный,粗斜体,Negrita cursiva
/usr/share/fonts/truetype/osxcorefonts/Helvetica.ttf: Helvetica:style=Regular,標準體,Ordinær,Normal,Normaali,Regolare,レギュラー,일반체,Regulier,Обычный,常规体
/usr/share/fonts/truetype/osxcorefonts/HelveticaOblique.ttf: Helvetica:style=Oblique,斜體,Kursiv,Kursiivi,Italique,Corsivo,イタリック,이탤릭체,Cursief,Itálico,Курсивный,斜体,Cursiva
/usr/share/fonts/truetype/osxcorefonts/HelveticaBold.ttf: Helvetica:style=Bold,粗體,Fed,Fett,Puolilihava,Gras,Grassetto,ボールド,볼드체,Vet,Fet,Negrito,Жирный,粗体,Negrita
mikeday
That looks normal so far, would you be able to tar up those three .ttf files and email them to me (mikeday@yeslogic.com) so we can try reproducing the problem locally?
mikeday
This turned out to be an issue with one of the fonts, where Helvetica Bold had a weightClass of 400 (normal).
mikeday
We have added a warning for this situation to Prince 14.2.