2

My setup: TeX Live
How can I remap slot 39 to slot 13?

I tried to do it by creating a virtual font:

tftopl cmtt10.tfm > cmtt10.vpl
patch <<EOF
--- cmtt10.vpl
+++ cmtt10.vpl
@@ -1,3 +1,4 @@
+(MAPFONT D 0 (FONTNAME cmtt10))
 (FAMILY CMTT)
 (FACE O 352)
 (CODINGSCHEME TEX TYPEWRITER TEXT)
@@ -192,6 +193,7 @@
 (CHARACTER O 47
    (CHARWD R 0.524996)
    (CHARHT R 0.611112)
+   (MAP (SETCHAR O 15))
    )
 (CHARACTER O 50
    (CHARWD R 0.524996)
EOF
vptovf cmtt10.vpl
rm cmtt10.tfm cmtt10.vpl

Create test.tex:

\tt '
\bye

tex test.tex

EDIT: Indeed, as cfr suggested, there is infinite recursion:

dvicopy test.dvi expand.dvi

DVI: font 29 = cmtt10.
DVI: font 0 = cmr10.
DVI: processing page 1.
DVI: font 29 = cmtt10.
TFM: font 0 = cmtt10.
VF file: '',
   for font 0 = cmtt10.
VF: font 0 = cmtt10.
 !Infinite VF recursion?
level=10 font = cmtt10 char=13
level=9 font = cmtt10 char=13
level=8 font = cmtt10 char=13
level=7 font = cmtt10 char=13
level=6 font = cmtt10 char=13
level=5 font = cmtt10 char=13
level=4 font = cmtt10 char=13
level=3 font = cmtt10 char=13
level=2 font = cmtt10 char=13
level=1 font = cmtt10 char=13
level=0 font = cmtt10 char=39
 !Sorry, DVIcopy capacity exceeded [recursion=10].
2
  • tftopl creates .pl files. Are you sure you can treat them as .vpl? I've made my fair share of virtual fonts but I've never tried to do it this way. – cfr Mar 19 '15 at 3:06
  • Also, I would be sceptical about mapping a font X as part of the specification of font X. Is that dangerously circular? – cfr Mar 19 '15 at 3:17
2

This works as required ( differs from above only by cmtt10 changed to mycmtt10)

tftopl cmtt10.tfm > mycmtt10.vpl
patch <<EOF
--- mycmtt10.vpl
+++ mycmtt10.vpl
@@ -1,3 +1,4 @@
+(MAPFONT D 0 (FONTNAME cmtt10))
 (FAMILY CMTT)
 (FACE O 352)
 (CODINGSCHEME TEX TYPEWRITER TEXT)
@@ -192,6 +193,7 @@
 (CHARACTER O 47
    (CHARWD R 0.524996)
    (CHARHT R 0.611112)
+   (MAP (SETCHAR O 15))
    )
 (CHARACTER O 50
    (CHARWD R 0.524996)
EOF
vptovf mycmtt10.vpl
rm mycmtt10.vpl

For portability compile with:

tex -jobname test '\font\tentt=mycmtt10 \input test.tex'

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.