# CWEB, Plain TeX: how to switch from cmr8 to another font that supports foreign language characters?

I'm using egreg's code to use UTF-8 in Plain TeX so I can use Donald Knuth and Silvio Levy's CWEB. However, not every TeX font supports foreign language characters such as \"{y} or ç or ã.

So this code...

\input cwebmac
\input utfplainmac
\input plain-t1

\N{1}{1} Introdução. Lorem ipsum dolor...


... produces this result:

The problem is shown by the log file:

Missing character: There is no ç in font cmr8!
Missing character: There is no ã in font cmr8!


How could I switch cmr8 to another font that does have these characters?

• You could try pinging @egreg on that answer so that this gets his attention — there may be a solution without switching away from cmr8. (I think this may be something about uppercase... haven't looked deeply.) Feb 20, 2019 at 16:34
• Also, CWEB redefines a bunch of things, and has some strict rules about what can go inside section names... this may be violating some of that. (Have you considered using XeTeX / LuaTeX instead of the above?) Feb 21, 2019 at 0:36

You have to define a suitable font for \eightrm, but also setup some uppercase conversions; here I define only those necessary for the examples.

There was also an unfortunate typo in utfplainmac.tex, with \c{A} instead of the correct \c{C}. Fix it in the file.

\input cwebmac
\input utfplainmac
\input plain-t1

\font\eightrm=ecrm0800

\uccode"A7="87 % ç is <C3><A7>, Ç is <C3><87>
\uccode"A3="83 % ã is <C3><A3>, Ã is <C3><83>

\N{1}{1} Introdução. Lorem ipsum dolor...

\bye


There is an alternative using pdfcsplain:

\input cwebmac
\input utf8lat1
\input lmfonts

\N{1}{1} Introdução. Lorem ipsum dolor...

\end


\font\eightrm=<your font>