Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Being interested by using the Linux Libertine font, I made some test with XeLaTeX and pdfLaTeX. My idea was to find a font that is suitable for use in xelatex, pdflatex and outside of any TeX flavour.

I was surprised to see that bold typefaces were heavier in pdflatex (with the package libertine) than in xelatex (using the \setmainfont command).

Then I tried the following code with xelatex :

\documentclass{report}
\usepackage{fontspec}
\setmainfont{Linux Libertine O}
%\usepackage{libertineotf}
\begin{document}
\chapter{Test}
This is a text (or so it seems).
\textbf{This is a bold text}
\end{document}

By commenting either the \setmainfont or the \usepackage{libertineotf} line, I noticed that the bold (chapter title for instance) where heavier when using the package. The same difference shows when using the libertine package (libertine, not libertineotf) with pdflatex.

Does anyone know if there a reason for that? Is there a way to have both giving the same result?

Thanks

share|improve this question
add comment

1 Answer

Well libertineotf declares which font to use for bold:

 \setmainfont[Extension=.otf,
        BoldFont=LinLibertine_RB,
        ....

And this can be a different font to the one found if you use only \setmainfont.

You can add \XeTeXtracingfonts= 1 to your document to get some more informations in the log-file. And you can compile with xelatex --output-driver="xdvipdfxm -vv" to see on the terminal which fonts are included.

share|improve this answer
1  
Thanks. Indeed: the package libertineotf (and libertine with pdflatex) uses true bold (that's too heavy for me), while the \setmainfont command uses semibold. So that's why the first is heavier than the other. I tried to change bold to semibold (using the command \renewcommand{\bfdefault}{sb} but it doesn't find the proper font (and regular font is used instead). I'll try to investigate if there's an option in libertineotf package to use the proper semibold font in place of the bold. –  user11208 Feb 11 '12 at 6:35
    
@user11208: Change the bold font like libertineotf is doing it. Copy the orginal \setmainfont from the sty and then change the BoldFont-setting. –  Ulrike Fischer Feb 11 '12 at 14:49
1  
it's working with libertineotf, but not with libertine package used in pdflatex documents as it doesn't use otf fonts. But I just found a solution : libertine package provides a command \textsb, so I had just to use \renewcommand{\bfseries}{\textsb}in place of \renewcommand{\bfdefault}{sb}. To be complete, Libertine Semibold is in fact the former bold shape; it was recently embolded to create the current bold shape. –  user11208 Feb 11 '12 at 17:17
    
Apparently you need to have \renewcommand{\bfdefault}{z} for proper semibold text. I have no idea why, but the documentation of newtx states this in an example using libertine (page 4 of the newtxdoc.pdf, version May 31, 2012). –  mSSM Jun 20 '12 at 16:10
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.