fbb font appearance with fontspec

I am currently to try switching from PdfLaTeX to LuaLaTeX, and I am in trouble with fbb fonts. Consider the two following documents, the first one being compiled with PdfLaTeX and the second one with LuaLaTeX.

\documentclass{article}
\usepackage{lipsum}
\usepackage{fbb}

\begin{document}
\lipsum
\end{document}


and

\documentclass{article}
\usepackage{lipsum}
\usepackage{fontspec}
\setmainfont{fbb}
\fontspec{fbb}

\begin{document}
\lipsum
\end{document}


Here are the two outputs (left is the first one) :

The font looks bolder in the second example. What could I change to get the same output with the two examples ?

• fbb isn't meant for lualatex. Don't use it. – Ulrike Fischer Feb 21 '17 at 10:47
• Why that ? And how to know wether a font is meant for LuaLaTex or no ? – mvienney Feb 21 '17 at 10:52
• Sorry I meant the package fbb is not for luatex and I don't know why I thought you were trying to use it for lualatex too ;-). – Ulrike Fischer Feb 21 '17 at 11:16
• By the way : if I use the fbb package with lualatex, it works. – mvienney Feb 21 '17 at 12:41
• It won't explode but not use the correct fonts. Try e.g. in your document ß€ to see one of the problems. – Ulrike Fischer Feb 21 '17 at 12:49

The difference can be explained by the font formats for the font fbb, which PdfLaTeX and LuaLaTeX embed into the documents. When you compile the first document with PdfLaTeX, it embeds the Postscript Type1 font (see the excerpt from the log file):

 1141 hyphenation exceptions out of 8191
28i,4n,33p,832b,113s stack positions out of 5000i,500n,10000p,200000b,80000s
{c:/texlive/2016/texmf-dist/fonts/enc/dvips/fbb/fbb_7yleqe.enc}<c:/texlive/2
016/texmf-dist/fonts/type1/public/fbb/fbb-Regular.pfb>
Output written on fbb1.pdf (2 pages, 43459 bytes).


And LuaLaTeX embeds the OpenType font version:

 23 fonts using 1380439 bytes
35i,4n,68p,329b,273s stack positions out of 5000i,500n,10000p,200000b,100000s
<c:/texlive/2016/texmf-dist/fonts/opentype/public/fbb/fbb-Regular.otf>
Output written on fbb2.pdf (2 pages, 14470 bytes).


The rest is the way your PDF viewer renders the fonts of those two formats. I've tried Adobe Reader and Evince, both show the two documents almost indistinguishably. I'm pretty sure though that if you'd print both documents, you'd get the same printouts.

I compiled with pdflatex and lualatex the following document:

\RequirePackage{luatex85}
\documentclass[varwidth]{standalone}
\usepackage{ifluatex,lipsum}

\ifluatex
\usepackage{fontspec}
\setmainfont{fbb}
\else
\usepackage{fbb}
\fi

\begin{document}

\ifluatex LuaLaTeX \else PDFLaTeX\fi

\lipsum[2]

\end{document}


and then included the two PDF files in another document

\documentclass{article}
\usepackage{graphicx}

\begin{document}
\includegraphics{mvienpdf}

\bigskip

\includegraphics{mvienlua}
\end{document}


The output of pdffonts mvienpdf.pdf is

name                                 type              encoding         emb sub uni object ID
------------------------------------ ----------------- ---------------- --- --- --- ---------
MLNYOG+fbb-Regular                   Type 1            Custom           yes yes no       4  0


The output of pdffonts mvienlua.pdf is

name                                 type              encoding         emb sub uni object ID
------------------------------------ ----------------- ---------------- --- --- --- ---------
OILBXQ+fbb-Regular                   CID Type 0C       Identity-H       yes yes yes      4  0


The picture of the assembled file