0

Consider this short latex document:

\documentclass[12pt, a4paper]{article}

\usepackage{libertine}
\usepackage[margin=20pt]{geometry}

\begin{document}
\makeatletter

\noindent
\normalsize The quick brown fox jumped over the lazy dog \f@size pt\\
\Large The quick brown fox jumped over the lazy dog \f@size pt\\
\Huge The quick brown fox jumped over the lazy dog \f@size pt
\end{document}

This produces something like this (I've manually adjusted the line spacing as I couldn't get it to fit the comparison): the quick brown fox written in 3 font sizes

However, if I try to reproduce this document in Typst or LibreOffice using my local copy of the Linux Libertine font which I downloaded from https://sourceforge.net/projects/linuxlibertine/, it looks different! It looks like this:

the quick brown fox written in 3 font sizes

The difference is subtle, but if you ask me, the Latex version looks better. Somehow it looks like the Latex version has an ever so slightly higher font weight? Especially noticable on the thickness of the lowest line on the "d" character.

For reference, the Typst document source is:

#set page(margin: 20pt)
#set text(font: "Linux Libertine")

#text(size: 12pt, "The quick brown fox jumped over the lazy dog 12pt")\
#text(size: 17.28pt, "The quick brown fox jumped over the lazy dog 17.28pt")\
#text(size: 24.88pt, "The quick brown fox jumped over the lazy dog 24.88pt")

But to be clear, the same result is in LibreOffice, so I think it's more to do with the fact that Typst and LibreOffice use my local copy of the font, while Latex... does something else? Why does it look different?

If it matters, I'm on Windows 10.

Also, by extracting the font from the PDF document that Latex produced with FontForge, I can see that it is called "Linux Libertine T" and is version 5.3.0, the same version as my local copy of the font.

Is there any way I can achieve the (in my opinion, superior) same look as Latex does with a local copy of the font?

4
  • Perhaps you can create the PDF, then extract the font to use it locally.
    – Werner
    Sep 8, 2023 at 20:45
  • Unfortunately Latex subsets the font so I can't really extract it from the PDF as it is missing most glyphs. Sep 8, 2023 at 20:56
  • Okay, so how about using fonttable so it includes all the glyphs?
    – Werner
    Sep 8, 2023 at 21:02
  • 1
    if you used pdftex you would be using Type 1 fonts derived from the opentype original Sep 8, 2023 at 21:02

2 Answers 2

1

You don't say whether you're using latex/pdflatex or xelatex/lualatex and whether the "local" copies are the TTF or the OTF versions. These choices might be responsible for the differences you're observing. If you think the LaTeX package has better fonts, you can access those fonts in the relevant texmf tree and install them as "local" fonts.

5
  • I'm using pdflatex (via latexmk I think and MiKTeX). My local copy says it's version 5.3.0 with "OpenType Layout, TrueType Outlines". Sep 8, 2023 at 21:14
  • Ah, if I download the libertine package and check the fonts in the fonts\opentype\public\libertine directory, it says version 5.3.0 and "OpenType Layout, PostScript Outlines". And when I use that in Typst/LibreOffice, it looks better! Followup question I guess is, why do "PostScript Outlines" look better? Sep 8, 2023 at 21:17
  • And another, why doesn't the Linux Libertine page provide these (seemingly higher quality in my opinion at least) postcript outlines in their own download? Sep 8, 2023 at 21:27
  • There are still some very small differences I think, but it's almost imperceptible. Possibly due to hinting? Sep 8, 2023 at 21:36
  • The README for the libertine package says "Three of the Libertine fonts were modified by Michael Sharpe (msharpe at ucsd.edu) using fontforge to correct minor problems, including adding three missing ligatures (fl, ffl, ffi) to the bold-italic font. The type 1 fonts were created using cfftot1 or fontforge."
    – user22108
    Sep 9, 2023 at 13:13
0

Some general considerations, too long for a comment:

  1. When you \usepackage{font-name} you actually load a LaTeX *.sty file, which contains further instructions regarding what font files will actually be used.

  2. If you are compiling with lualatex (and maybe xetex, not sure), you would load the fontspec package, which has easy methods for directly selecting exactly which font files you wish to use, if you have a preference. You do not necessarily need to \usepackage{font-name}, although many font packages have special instructions for math characters, and so forth.

  3. If a font has less-than-magnificent hinting, it may look poor on a computer screen (even in PDF), but print well on paper. Many fonts are auto-hinted. It is my understanding that auto-hinting for fonts with PostScript outlines (usually file extension *.otf) tends to be better than for fonts with TrueType outlines (extension *.ttf).

  4. Hinted or not, PostScript outlines and TrueType outlines require different levels of design expertise. My own experience is that PostScript is easier, from the designer point of view. It may be that the PostScript version of a font looks better than the TrueType version, even if by the same designer, because there is less effort required to do it with PostScript outlines. Automatic conversion between the two forms can introduce approximations, which would be more visible in the thinnest areas.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .