Options for pairing Concrete Roman with a .ttf font

Jim Hefferon jim.hefferon at gmail.com
Wed Sep 15 00:01:52 CEST 2021


Hello,

I have a document (from 2016-ish) that paired Concrete Roman and Euler math
with a web-downloaded .ttf for code listings (it used fontspec to access
that file, and compiled with xelatex).  I find that when I installed a 2021
TeXLive  on a fresh Ubuntu 20, it does not compile.  Can I ask if there is,
today, a way to use ccr with an arbitrary .ttf font?

I have been struggling with this for an embarasingly long time, and I'd be
delighted to be corrected (I apologize if some of what I say doesn't make
any sense), but I find the following.

1) When I put this in the preamble

\usepackage{beton,eulervm}
\usepackage{fontspec}

it results in in the ccr choice being forgotten.  By that I mean  that in
the PDF, Properties> Fonts does not say concrete.

2) I tried then to go all in with fontspec, to install ccr into my font
manager.   I clicked on "+" and added
/usr/local/texlive/2021/texmf-dist/fonts/type1/public/cm-super/sform10.pfb,
and then ran this file.

\documentclass{article}
\usepackage{fontspec}
\IfFontExistsTF{Computer Modern Concrete}{\typeout{!!!! Yes, it
exists}}{\typeout{!!!! No, it doesn't exist}}

%% \setmainfont{sform10.pfb}[
%%   Path = /usr/local/texlive/2021/texmf-dist/fonts/type1/public/cm-super/]
%% \setmainfont{sform10.pfb}[Path =
/usr/local/texlive/2021/texmf-dist/fonts/type1/public/cm-super/]
\setmainfont{Computer Modern Concrete}

\usepackage{lipsum}
\begin{document}
\lipsum[1-10]
\end{document}

I ran xelatex (with a diagnostic because I don't understand the error
message).

$ xelatex -output-driver="xdvipdfmx -vv" test.tex
This is XeTeX, Version 3.141592653-2.6-0.999993 (TeX Live 2021) (preloaded
format=xelatex)
 restricted \write18 enabled.
entering extended mode
(./test.tex
LaTeX2e <2021-06-01> patch level 1
L3 programming layer <2021-08-27>
(/usr/local/texlive/2021/texmf-dist/tex/latex/base/article.cls
Document Class: article 2021/02/12 v1.4n Standard LaTeX document class
(/usr/local/texlive/2021/texmf-dist/tex/latex/base/size10.clo))
(/usr/local/texlive/2021/texmf-dist/tex/latex/fontspec/fontspec.sty
(/usr/local/texlive/2021/texmf-dist/tex/latex/l3packages/xparse/xparse.sty
(/usr/local/texlive/2021/texmf-dist/tex/latex/l3kernel/expl3.sty
(/usr/local/texlive/2021/texmf-dist/tex/latex/l3backend/l3backend-xetex.def
(|extractbb --version))))
(/usr/local/texlive/2021/texmf-dist/tex/latex/fontspec/fontspec-xetex.sty
(/usr/local/texlive/2021/texmf-dist/tex/latex/base/fontenc.sty)
(/usr/local/texlive/2021/texmf-dist/tex/latex/fontspec/fontspec.cfg)))
!!!! Yes, it exists
(/usr/local/texlive/2021/texmf-dist/tex/latex/lipsum/lipsum.sty
(/usr/local/texlive/2021/texmf-dist/tex/latex/l3packages/l3keys2e/l3keys2e.sty)
(/usr/local/texlive/2021/texmf-dist/tex/latex/lipsum/lipsum.ltd.tex))
(./test.aux) (/usr/local/texlive/2021/texmf-dist/tex/latex/base/ts1cmr.fd)

Package lipsum Warning: Hyphenation patterns for 'latin' cannot be used
(lipsum)                because babel is not loaded. The default document
(lipsum)                language will be used for hyphenation instead.
(lipsum)
(lipsum)                This message won't be shown again.


Overfull \hbox (5.30357pt too wide) in paragraph at lines 26--26
[]\TU/ComputerModernConcrete(0)/m/n/10 Nulla malesuada porttitor diam.
Donec fe
lis erat, congue
[1] [2] [3] (./test.aux) )
<FONTMAP:/usr/local/texlive/2021/texmf-var/fonts/map/pdftex/updmap/pdftex.map><FONTMAP:/usr/local/texlive/2021/texmf-var/fonts/map/dvipdfmx/updmap/kanjix.map><FONTMAP:/usr/local/texlive/2021/texmf-dist/fonts/map/dvipdfmx/ckx.map>No
dvi filename specified, reading standard input.
No pdf filename specified, writing to standard output.
DVI Comment:  XeTeX output 2021.09.14:1723
stdin -> test.pdf
<AGL:texglyphlist.txt><AGL:pdfglyphlist.txt><AGL:glyphlist.txt>[1</usr/local/share/fonts/type1/cm-super/sform5.pfb at 9.96pt
<NATIVE-FONTMAP:/usr/local/share/fonts/type1/cm-super/sform5.pfb/0/H/65536/0/0>
fontmap: /usr/local/share/fonts/type1/cm-super/sform5.pfb/0/H/65536/0/0 ->
/usr/local/share/fonts/type1/cm-super/sform5(Identity-H)
>
xdvipdfmx:fatal: Invalid font: -1 (0)

No output PDF file written.
(see the transcript file for additional information)
Error 256 (driver return code) generating output;
file test.pdf may not be valid.
Transcript written on test.log.

(What could "xdvipdfmx:fatal: Invalid font: -1 (0)" possibly mean?)

3) I even tried converting the .ttf via otftotfm so I could just use
pdflatex, but frankly how to get the T1 encoding baffled me.

Is there a reasonable way to get concrete along with a random .ttf?  If the
answer is "no" then that would save me a lot of struggle, so that would be
useful to me also.

Regards,
Jim

-- 
"Does not the Captain seek your advice sir?"
"Not always," said Stephen.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://tug.org/pipermail/texhax/attachments/20210914/9012c526/attachment.html>


More information about the texhax mailing list.