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
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It only takes a minute to sign up.
Sign up to join this communityAssuming 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
luaotfload
simplifies the loading of OpenType fonts. That's all. It has nothing to do with LaTeX
Dec 31, 2022 at 8:16
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.
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.
pplr8t
, italicpplri8t
, boldpplb8t
and bold-italicpplbi8t
and smallcapspplbc8t
for font names, e.g.,\font\tenpalatino=pplr8t at 10pt
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 paperLaTeX
engine to run plain TeX. Just a beginer and want to learn LaTeX begining from TeX.