[Tex/LaTex] How to create new font which is thicker version of Computer Modern

computer-modernfontsmetafont

I'm trying to find a good way to have the LaTex default font "Computer Modern" (CM) a bit thicker (also called "blacker"). I really like this font, especially when it comes to math mode, so answers like "Change the font." don't qualify, sorry. 🙂
The only problem is that CM has very thin lines, so the font looks very light. There are several methods to make CM "thicker" (I'm not talking about the bold series of the font! This one looks different and is not what I am looking for.) which can be found elsewhere on tex.stackexchange:

1) Use FakeBold in XeLaTex:
How to make the math font slightly thicker?

2) Use pdfliteral as suggested here:
Fake bold in LuaLaTeX

3) Use pdfrender as suggested here:
Make entire document heavier using pdfrender

However, the answers given there don't suit here:
1) Needs XeLaTex (I only have PDFLaTex and I cannot install additional software, as I'm not a system administrator.)
Results produced with 2) + 3) look very good. Actually it looks exactly like I intend it to be. However, it only looks good with certain Reader software (Evince and certail versions of Okular). With other Reader software (like other versions of Okular or even the Adobe Reader) the base line of characters is not quite the same or there are white artefacts inside the letters.

I think, the only option to resolve the problems is to create a proper font. (The solutions in 2) and 3) don't create a new font, they are hacks that manipulate the way the original CM font is displayed.) And here is my question:
How do I create a "vectorbased" (not pixelbased) proper font from Computer Modern which has the same "thickness" attributes like the results obtained with pdfrender/pdfliteral in 2) and 3) ?
I don't really know anything about fonts. The basic idea should be to take the original CM font and to do some adjustments to its geometry. There is a German post:

http://www.typografie.info/3/topic/22238-ist-die-computer-modern-wirklich-zu-d%C3%BCnn/

There they talk about a "blacker" parameter in a "metafont source file" of CM. However they produce a pixel-based font and I'm not exactly sure what they are actually doing there.

Upshot: I'd like to have a thick (not bold) CM-like font which looks good with any reader software and it should be usable with PDFLaTex. Thanks for your help.


To give you an impression what I have in mind: Here's a (famous) article whose "oldschool" look I try to resemble with a modified CM font:

http://math.stanford.edu/~lekheng/flt/wiles.pdf

I've magnified it and compared it with my own "pdfliteral" results and my conclusion is that it is indeed a thicker CM (probably due to the fact that it was printed and scanned afterwards as is indicated by the not quite horizontal text lines on some pages).

I now get an idea of how to clearify my question: Using METAFONT, how do I create a new font from the original CM metafont source files (http://www.ctan.org/pkg/cm-mf) but with a higher blackness parameter?

Best Answer

Some options include these (see examples below):

  1. Use "Latin Modern" (\usepackage{lmodern}), the updated version of Computer Modern. It looks a bit less spindly on screen and print than the original, in my opinion. (Example below)

  2. Scale "Computer Modern" as demonstrated below (thanks to this answer)

  3. Use the font "Computer Concrete" (\usepackage{concmath}), which Knuth designed as a thicker version of Computer Modern using METAFONT.

  4. Use a similar but thicker font. For example gfsbodoni (\usepackage[default]{gfsbodoni}) is in the same family of "modern" typefaces but perhaps has a more desirable weight.

  5. Use METAFONT directly and adjust it to your liking. This kind of thing was the original purpose of that program.


(EDIT)

Demonstration of font scaling (#2 above):

Here is a way that you can scale the font. You ask for a smaller font size to be magnified to a larger one; since the smaller sizes have thicker strokes, you get a thicker-looking, but also wider font. You can experiment with the proportions. This example scales cmr7 up to the default 10pt.

(I didn't get the italic working yet, and I don't think the bold is scaled, but hopefully someone else can add to this.)

\documentclass{article}

\usepackage[T1]{fontenc}

\DeclareFontShape{T1}{cmr}{mx}{n}%
    {<->cmr7}{}
\DeclareFontShape{T1}{cmr}{mx}{it}%
    {<->cmr7}{}

\AtBeginDocument{%
    \fontseries{mx}\selectfont%
}

% to create dummy text for testing
\newcommand{\quickfox}{The quick brown fox jumps over the lazy dog}
\newcommand{\Fox}{The Quick Brown Fox}
\newcommand{\Dog}{The Lazy Dog}
\newcommand{\Jumps}{Jumps Over}
\usepackage{lipsum}

\begin{document}

\section{\Fox}
\quickfox?

\subsection{\Dog}
\emph{\quickfox.}

\paragraph{\Jumps}
\lipsum[1]

\end{document}

Thus, cmr7 scaled to 10pt:

enter image description here


For comparison, here is the example with lmodern and no scaling:

enter image description here


This is gfsbodoni:

enter image description here


And this is concmath (Computer Concrete) (as noted in the comments it really is in a different font family despite being derived from Computer Modern):

enter image description here



(EDIT)

Here is a very basic demonstration of how to get started modifying a Metafont. (It's my first time doing it so take this with a grain of salt.)

  1. Find the Metafont source for Computer Modern 10pt, TEXMF-DIST/fonts/source/public/cm/crm10.mf.
  2. COPY this file to a separate working directory where you won't mess up your TeXLive installation.
  3. Go in and change the "thickness" and "breadth" parameters to larger values. Save the file under a new name, e.g., cmthick.mf
    • e.g., line 25: thin_join#:=10/36pt#; % width of extrafine details
  4. Compile the font with METAFONT (see texdoc metafont):
    • mf '\mode=localfont; input cmthick'
    • gftopk cmthick.600gf
  5. Use the new font. Since this was just for demonstration and I don't know what I'm doing, I just did this in Plain TeX. File cmthicktest.tex:

    The quick brown fox jumps over the lazy dog.
    
    \font\cmthick=cmthick
    \cmthick
    
    The quick brown fox jumps over the lazy dog.
    \bye
    
  6. Compiled with tex cmthicktest && dvips cmthicktest && ps2pdf cmthicktest.ps I get the following:

enter image description here

This is just to show that it can be done. I don't know if this is the right way.

Related Question