# How can I use these PostScript fonts on Overleaf with plain TeX?

How can I use these fonts on Overleaf with plain TeX?

``````\font\tenpalatino=Palatino at 10pt
\font\bighelvetica=Helvetica at 30pt

This is a test. \tenpalatino This is Palatino font at 10pt. \par
\bighelvetica This is Helvetica font at 30pt.

\bye
``````

• Use standard names like, Roman `pplr8t`, italic `pplri8t`, bold `pplb8t` and bold-italic `pplbi8t` and smallcaps `pplbc8t` for font names, e.g., `\font\tenpalatino=pplr8t at 10pt` Dec 30, 2022 at 4:51
• Which engine are you trying to run? You must give PDFTeX a `tfm` (TeX font metrics) file to set it up; and as the other comment implies, most PostScript font metrics files have peculiar filenames documented in Karl Berry's paper Dec 30, 2022 at 19:49
• @jarnosz I'm using Overleaf with `LaTeX` engine to run plain TeX. Just a beginer and want to learn LaTeX begining from TeX. Dec 31, 2022 at 5:05
• The code above is from a book I'm reading but it doesn't compile so I made this question. Dec 31, 2022 at 5:16
• what's that book's title, if you don't mind? Dec 31, 2022 at 7:16

Assuming that you want some of the Standard Postscript fonts, beware that you must give the [PDF]TeX engine a `tfm` (TeX font metrics) file to set it up; and as stated in the comments to your question, most PostScript font metrics files have peculiar filenames documented in Karl Berry's paper on TUGBoat 11-1990 and the reference guide on the tug website. Given that info, the following should work in any engine, provided you have followed the instructions given in Overleaf to set up a custom TeX engine in your `latexmkrc` file.

``````\font\tenpalatino=pplr8y at 10pt
\font\bighelvetica=phvr8y at 30pt

This is a test. \tenpalatino This is Palatino font at 10pt. \par
\bighelvetica This is Helvetica font at 30pt.

\bye
``````

That convention is already present in Example 7, Section 3 of TeX for the Impatient.

Use `luahbtex` and file names:

``````\input luaotfload.sty
\font\tenpalatino="file:texgyrepagella-regular.otf" at 10pt
\font\bighelvetica="file:texgyreheros-regular.otf" at 30pt

This is a test. \tenpalatino This is Palatino font at 10pt. \par
\bighelvetica This is Helvetica font at 30pt.

\bye
``````

• This suggestion may work, if you are a "LaTeX fundamentalist", who does not mind throwing L3 code into a Plain solution. Dec 31, 2022 at 7:23
• `luaotfload` simplifies the loading of OpenType fonts. That's all. It has nothing to do with LaTeX Dec 31, 2022 at 8:16
• actually, it does: `luaofload.sty` has a call to `ltluatex.tex`, which is part of the LaTeX kernel, to do the rest of the stuff, if you check the luaotfload and latex repositories, and this discussion. Dec 31, 2022 at 8:36
• "Part of the LaTeX kernel" doesn't mean that it is pure LaTeX code... Dec 31, 2022 at 8:43
• @jarnosz OK, luaotfload has something to do with LaTeX. But its great part of the code is borrowed from fontloader from ConTeXt. So, we can say that this has something to do with ConTeXt too. And, sure, it has nothing to do with L3 code. Jan 9 at 13:17

If you're not a plain TeX purist that even refuses to look in LaTeX files, you can see that `palatino.sty` has

``````\renewcommand{\rmdefault}{ppl}
\renewcommand{\sfdefault}{phv}
\renewcommand{\ttdefault}{pcr}
``````

The default output encoding of LaTeX reflects the plain TeX setup for fonts, so you want to look at `ot1ppl.fd`

``````\DeclareFontShape{OT1}{ppl}{m}{n}{<-> pplr7t}{}
\DeclareFontShape{OT1}{ppl}{m}{sc}{<-> pplrc7t}{}
\DeclareFontShape{OT1}{ppl}{m}{sl}{<-> pplro7t}{}
\DeclareFontShape{OT1}{ppl}{m}{it}{<-> pplri7t}{}
\DeclareFontShape{OT1}{ppl}{b}{n}{<-> pplb7t}{}
\DeclareFontShape{OT1}{ppl}{b}{sc}{<-> pplbc7t}{}
\DeclareFontShape{OT1}{ppl}{b}{sl}{<-> pplbo7t}{}
\DeclareFontShape{OT1}{ppl}{b}{it}{<-> pplbi7t}{}
``````

(slightly edited for compactness). You therefore want

``````\font\tenpalatino=pplr7t at 10pt
``````

because this correspond to medium weight (`m`) and normal (`n`) shape. The standard design size for PostScript fonts is 10pt, so you may even omit `at 10pt`.

Similarly, looking in `ot1phv` shows that the declaration you need is

``````\font\bighelvetica=phvr7t at 30pt
``````

Full example, also showing accents.

``````\font\tenpalatino=pplr7t at 10pt
\font\bighelvetica=phvr7t at 30pt

This is a t\^est. \tenpalatino This is Palatino f\'ont at 10pt. \par
\bighelvetica This is Helvetica f\"o\~nt at 30pt.

\bye
``````

Beware that these fonts don't contain Greek letters, so you need to define them separately if you want to use them in math.

• @jarnosz A class of people that I think doesn’t exist. Dec 31, 2022 at 9:03
• @jarnosz So, where's the rudeness? My dictionary says “a person who adheres strictly to the basic principles of any subject or discipline”. Dec 31, 2022 at 9:16
• @jarnosz I don't think that applies, but I changed the wording nonetheless. Dec 31, 2022 at 17:11