LaTeX: How to use handwriting fonts in your TeX document.

This document, Instructions for Adding the Einstein Font to LaTeX was kindly provided by Nihal Mehta. It is specific to the Albert Einstein Font, yet all fonts of the Handwriting Library can be used in LaTeX. In the download section of the Einstein Font you will also find a sample TeX and PDF file to get you started. Reminder: Font names change with each update. When updating the font files in your project, you will need to adjust the names manually.

TeX-Screenshot---working-with-handwriting-font-in-TeX---Albert-Einstein-Font

The Albert Einstein font is meticulously crafted through an in-
depth analysis of Albert Einstein’s original handwritten letters, manuscripts,
and notes. Every stroke, curvature, and spacing was carefully studied to
authentically capture the essence and personality of Einstein’s distinctive
handwriting style, creating a font that serves as both a tribute and a practical
tool for recreating his iconic script.

Adding Handwriting Fonts to a LaTeX Document
  1. Create folder Handwriting-Fonts within your project
  2. Upload the fonts to the Handwriting-Fonts folder:
    • FONT – 1879 Albert Einstein – Style 40 Regular (2024 June).otf
    • FONT – 1879 Albert Einstein – Style 80 Extra Bold (2024 June).otf
    • The folder structure will look like:
      Project Folder

      ├── Handwriting-Fonts
      │ ├── FONT – 1879 Albert Einstein – Style 80 Extra Bold (2024 June).otf
      │ └── FONT – 1879 Albert Einstein – Style 40 Regular (2024 June).otf
      ├── main.tex
  3. Add the fontspec package to the preamble of the LATEXdocument:
    \usepackage{fontspec}
Entire Document in Handwriting

Add the specification of the Font as the
main font in the preamble:

\setmainfont{AlbertEinstein}[
Path=./Handwriting-Fonts/,
Extension = .otf,
UprightFont=* - Style 40 Regular (2024 June).otf,
BoldFont=* - Style 80 Extra Bold (2024 June).otf,
%ItalicFont=*-Italic,
%BoldIt

Write the content as usual; it’ll render in the Albert Einstein font

Switching Between Handwriting and
Regular Fonts

Define a new alberteinsteinfont font in the preamble:

% Define the Einstein handwriting font
\newfontfamily\alberteinsteinfont{AlbertEinstein}[
Path=./Handwriting-Fonts/,
Extension = .otf,
UprightFont=* - Style 40 Regular (2024 June).otf,
BoldFont=* - Style 80 Extra Bold (2024 June).otf,
]

When you want to switch to the Albert Einstein font, enclose your text as:

{\alberteinsteinfont Text in Albert Einstein's Handwriting}

This will render as:

References:

  1. Overleaf Custom Fonts Info
  2. Albert Einstein Font