[Tex/LaTex] How to compile thicker OTF version of Latin Modern fonts

computer-modernfontforgefontslatin-modernmetafont

Computer Modern fonts, when printed from a pdf generated by pdflatex, tend to produce rather thin lines. The way to solve that problem has been described here through the use of the blacker parameter.

MathJax also uses Computer Modern, and makes the fonts thicker by the blacker parameter as shown in this script. MathJax then splits the font into multiple parts, available here in OTF form. These OTF files are created from FontForge scripts generated here.

When dealing with non-English texts, and using Latin Modern, I use luatex and the OTF version of Latin Modern fonts which can be downloaded from this link. I would like to be able to generate thicker versions of the Latin Modern fonts in OTF format, so that I can use them by luatex to generate pdf documents.

There has been discussion on how to compile LM fonts from sources at tex.stackexchange, focusing specifically on how to generate the pfb and tfm files. The creators of Latin Modern provide tips on how they generated the OTF fonts in Sec 4.3 of the paper titled Latin Modern fonts: how less means more. They mention that they used the Adobe Font Development Kit for Open-Type to generate the OTF fonts, also highlighting that FontForge could be another option.

I can see that MathJax is able to create thicker OTF versions of Computer Modern by FontForge (though I don't understand how it is done). How can a similar task be achieved in the case of the Latin Modern fonts? Does anyone have the scripts available to achieve this task? To be more specific, I am looking for an answer as the one in how to compile LM fonts from sources, for the case of OTF font generation from the metatype Latin Modern sources.

Update on Jul 2, 2020

Apoorv Potnis commented and informed me of the following blog post and the associated code that uses FontForge to make Latin Modern slightly thicker.

Update on Jul 4, 2020

Thanks to the answers by Henri Menke, Davislor and user187802 for the different fake bold approaches.

The solution provided in Context is detailed in Chp 11 of On and on document from the Context wiki. The modernlatin font is defined using boldened-xy features which are specified by using the effect feature in LuaTeX. The same approach also seems to work under LuaLaTeX, which additionally has the embolden option that gets used when FakeBold is specified in fontspec. I used the following sample file to see how different options look on screen and on paper when printed. Printed results for fake bold options (FakeBold and effect=...) were different based on which pdf viewer I used (evince vs Acrobat). The modified otf version resulted in similar results for both viewers.

\documentclass[10pt,oneside,letterpaper]{article}

\usepackage{fontspec}
\newfontfeature{boldened-00}{effect={width=0.00,auto=yes}}
\newfontfeature{boldened-05}{effect={width=0.05,auto=yes}}
\newfontfeature{boldened-10}{effect={width=0.10,auto=yes}}
\newfontfeature{boldened-15}{effect={width=0.15,auto=yes}}

\setmainfont{Latin Modern Roman}
\usepackage{blindtext}

\begin{document}
\section*{Default}
\blindtext

\section*{Modified Font File}
% Modified font file, see https://github.com/jagd/fakebold/releases/tag/v1.1
\fontspec{lmroman10-regular.otf}[Path="./"]
\blindtext

\newpage
\section*{FakeBold - 0}
\fontspec{Latin Modern Roman}[FakeBold=1.0]
\blindtext
\section*{Font Feature - 0}
\fontspec{Latin Modern Roman}[boldened-00]
\blindtext

\newpage
\section*{FakeBold - 05}
\fontspec{Latin Modern Roman}[FakeBold=1.05]
\blindtext
\section*{Font Feature - 05}
\fontspec{Latin Modern Roman}[boldened-05]
\blindtext


\newpage
\section*{FakeBold - 10}
\fontspec{Latin Modern Roman}[FakeBold=1.10]
\blindtext
\section*{Font Feature - 10}
\fontspec{Latin Modern Roman}[boldened-10]
\blindtext

\newpage
\section*{FakeBold - 15}
\fontspec{Latin Modern Roman}[FakeBold=1.15]
\blindtext
\section*{Font Feature - 15}
\fontspec{Latin Modern Roman}[boldened-15]
\blindtext
\end{document}

Best Answer

As mentioned in the comments, one can take a look at this blog post by C. Wu. There, the author of the post discusses how to compile a thicker version of the Latin Modern font. One can download a compiled version of the thicker LM fonts and use it with XeLaTeX or LuaLaTeX. Download link from GitHub.

With normal LM:

normal

Thicker LM:

thicker

The screenshots were taken on Okular pdf reader and the document was compiled with XeLaTeX. The thicker one looks much beautiful in my opinion.

Note: I do not own any Apple hardware and do not own any device with macOS or iOS, so I cannot tell for sure. But what I've noticed is that screenshots from Apple devices seem to have thicker (blacker?) glyphs, possibly due to Apple's Font rendering. So, the end result might look different on macOS. Different PDF readers also render a bit differently, e.g. Foxit and Nitro readers have slightly thicker strokes compared to Adobe Acrobat, Okular, Evince, and others.

Edit: Not a part of the answer but just general information. There exists a package NewComputerModern – Computer Modern fonts including matching non-latin alphabets. This is a new font wherein the Book weight is supposed to look a bit thicker compared to Computer Modern. It looks like this:NewCM

Related Question