summaryrefslogtreecommitdiff
path: root/systems/doc/pdftex/samplepdftex/efcode.tex
blob: 2a8f1320b13e3271c3a47b6d956b97a89ffaa856 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
% $Id: efcode.tex 883 2022-06-08 17:30:43Z karl $
% Public domain. Originally written by Han The THanh.
% Example \efcode ("expansion factor code") settings
% for per-glyph tuning of font expansions.
% 
% Also includes a basic macro to enable font expansion, adjusting for
% LuaTeX and pdfTeX.
% 
% As written, this file does nothing but make definitions.
% Adapt and adjust for your needs.
%
% Much more in the LaTeX microtype package (https://ctan.org/pkg/microtype).

\newcount\temploopefcode
\def\resetefcode#1{% reset all to 1000
    \temploopefcode=0
    \loop
        \efcode#1\temploopefcode=1000
        \advance\temploopefcode 1
    \ifnum\temploopefcode < 256 \repeat
}

\def\setefcode#1{%
    \efcode#1`\2=700
    \efcode#1`\3=700
    \efcode#1`\6=700
    \efcode#1`\8=700
    \efcode#1`\9=700
    \efcode#1`\A=500
    \efcode#1`\B=700
    \efcode#1`\C=700
    \efcode#1`\D=500
    \efcode#1`\E=700
    \efcode#1`\F=700
    \efcode#1`\G=500
    \efcode#1`\H=700
    \efcode#1`\K=700
    \efcode#1`\M=700
    \efcode#1`\N=700
    \efcode#1`\O=500
    \efcode#1`\P=700
    \efcode#1`\Q=500
    \efcode#1`\R=700
    \efcode#1`\S=700
    \efcode#1`\U=700
    \efcode#1`\W=700
    \efcode#1`\Z=700
    \efcode#1`\a=700
    \efcode#1`\b=700
    \efcode#1`\c=700
    \efcode#1`\d=700
    \efcode#1`\e=700
    \efcode#1`\g=700
    \efcode#1`\h=700
    \efcode#1`\k=700
    \efcode#1`\m=700
    \efcode#1`\n=700
    \efcode#1`\o=700
    \efcode#1`\p=700
    \efcode#1`\q=700
    \efcode#1`\s=700
    \efcode#1`\u=700
    \efcode#1`\w=700
    \efcode#1`\z=700
}

% emacs-page
% Different primitives for LuaTeX and pdfTeX.
% This fragment courtesy of Robert Schlicht,
% https://tex.stackexchange.com/questions/646769. Public domain.
% 
\input iftex.sty
\ifluatex
  \adjustspacing=2
  \def\mtplnfontexpand#1{%
    \expandglyphsinfont #1 20 20 1\relax}
\else
  \pdfadjustspacing=2
  \def\mtplnfontexpand#1{%
    \pdffontexpand #1 20 20 1 autoexpand\relax}
\fi 
% enable for these fonts.
%\mtplnfontexpand\tenrm
%\mtplnfontexpand\tensl
%\mtplnfontexpand\tenbf

%\hsize=2.2in
%\input story
%\bye