Debian Codegraph @

texmf-dist/doc/pdftex/samplepdftex/efcode.tex

raw
1 % $Id: efcode.tex 883 2022-06-08 17:30:43Z karl $
2 % Public domain. Originally written by Han The THanh.
3 % Example \efcode ("expansion factor code") settings
4 % for per-glyph tuning of font expansions.
5 %
6 % Also includes a basic macro to enable font expansion, adjusting for
7 % LuaTeX and pdfTeX.
8 %
9 % As written, this file does nothing but make definitions.
10 % Adapt and adjust for your needs.
11 %
12 % Much more in the LaTeX microtype package (https://ctan.org/pkg/microtype).
13
14 \newcount\temploopefcode
15 \def\resetefcode#1{% reset all to 1000
16 \temploopefcode=0
17 \loop
18 \efcode#1\temploopefcode=1000
19 \advance\temploopefcode 1
20 \ifnum\temploopefcode < 256 \repeat
21 }
22
23 \def\setefcode#1{%
24 \efcode#1`\2=700
25 \efcode#1`\3=700
26 \efcode#1`\6=700
27 \efcode#1`\8=700
28 \efcode#1`\9=700
29 \efcode#1`\A=500
30 \efcode#1`\B=700
31 \efcode#1`\C=700
32 \efcode#1`\D=500
33 \efcode#1`\E=700
34 \efcode#1`\F=700
35 \efcode#1`\G=500
36 \efcode#1`\H=700
37 \efcode#1`\K=700
38 \efcode#1`\M=700
39 \efcode#1`\N=700
40 \efcode#1`\O=500
41 \efcode#1`\P=700
42 \efcode#1`\Q=500
43 \efcode#1`\R=700
44 \efcode#1`\S=700
45 \efcode#1`\U=700
46 \efcode#1`\W=700
47 \efcode#1`\Z=700
48 \efcode#1`\a=700
49 \efcode#1`\b=700
50 \efcode#1`\c=700
51 \efcode#1`\d=700
52 \efcode#1`\e=700
53 \efcode#1`\g=700
54 \efcode#1`\h=700
55 \efcode#1`\k=700
56 \efcode#1`\m=700
57 \efcode#1`\n=700
58 \efcode#1`\o=700
59 \efcode#1`\p=700
60 \efcode#1`\q=700
61 \efcode#1`\s=700
62 \efcode#1`\u=700
63 \efcode#1`\w=700
64 \efcode#1`\z=700
65 }
66
67 % emacs-page
68 % Different primitives for LuaTeX and pdfTeX.
69 % This fragment courtesy of Robert Schlicht,
70 % https://tex.stackexchange.com/questions/646769. Public domain.
71 %
72 \input iftex.sty
73 \ifluatex
74 \adjustspacing=2
75 \def\mtplnfontexpand#1{%
76 \expandglyphsinfont #1 20 20 1\relax}
77 \else
78 \pdfadjustspacing=2
79 \def\mtplnfontexpand#1{%
80 \pdffontexpand #1 20 20 1 autoexpand\relax}
81 \fi
82 % enable for these fonts.
83 %\mtplnfontexpand\tenrm
84 %\mtplnfontexpand\tensl
85 %\mtplnfontexpand\tenbf
86
87 %\hsize=2.2in
88 %\input story
89 %\bye