summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/context/base/hand-ini.mkiv
blob: 450794d276f4d142711e53c3edb4310deddd7d5b (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
%D \module
%D   [       file=hand-ini,
%D        version=2008.02.12,
%D          title=\CONTEXT\ Handling Macros,
%D       subtitle=Initialization,
%D         author=Hans Hagen,
%D           date=\currentdate,
%D      copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
%C
%C This module is part of the \CONTEXT\ macro||package and is
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.

%D Handling is implemented differently in \MKIV. Maybe I'll cook up
%D some compatibility hack.

% \definefontfeature[demo][default][mode=node,expansion=quality]
% \definefontfeature[demo][default][mode=node,protrusion=pure]

% experimental setup:
%
%  \showframe \setupalign[hanging] \enabletrackers[fonts.protrusion]
%
%  \definefontfeature[default] [default][mode=node,script=latn]
%  %definefontfeature[whatever][default][mode=node,lfbd=yes,rtbd=yes,script=latn]
%  \definefontfeature[whatever][default][mode=node,protrusion=quality]
%  \definefontfeature[whocares][default][mode=node,protrusion=yes,opbd=yes,script=latn] % left|right|yes
%
%  \definedfont[fxlbi.otf*default]  \input tufte 0123456789 \par \dorecurse{15}{1 2 3 4 5 6 7 8 9 0 } \par
%  \definedfont[fxlbi.otf*whatever] \input tufte 0123456789 \par \dorecurse{15}{1 2 3 4 5 6 7 8 9 0 } \par
%  \definedfont[fxlbi.otf*whocares] \input tufte 0123456789 \par \dorecurse{15}{1 2 3 4 5 6 7 8 9 0 } \par
%
%  %definefontfeature[whocares][default][mode=node,protrusion=2,opbd=yes,script=latn,featurefile=texgyrepagella-regularxx.fea]
%  \definefontfeature[whocares][default][mode=node,protrusion=2,opbd=yes,script=latn]
%
%  \definedfont[texgyrepagella-regularxx.otf*whocares] \input tufte

\unprotect

%D New stuff.

\unexpanded\def\setupfontexpansion {\dodoubleargument\font_expansion_setup }
\unexpanded\def\setupfontprotrusion{\dodoubleargument\font_protrusion_setup}

\def\font_expansion_setup [#1][#2]{\ctxcommand{setupfontexpansion ("#1","#2")}}
\def\font_protrusion_setup[#1][#2]{\ctxcommand{setupfontprotrusion("#1","#2")}}

% \setupfontprotrusion[quality-upright][vector=quality]
% \setupfontprotrusion[quality-slanted][vector=quality,right=1.5]

\let\pdfadjustspacing\relax \newcount\pdfadjustspacing % a little bit protection
\let\pdfprotrudechars\relax \newcount\pdfprotrudechars % a little bit protection

\def\font_expansion_enable  {\normalpdfadjustspacing\plustwo  }
\def\font_expansion_disable {\normalpdfadjustspacing\zerocount}
\def\font_protruding_enable {\normalpdfprotrudechars\plustwo  }
\def\font_protruding_disable{\normalpdfprotrudechars\zerocount}

\appendtoks \font_expansion_disable  \to \everyforgetall % Here or not here?
\appendtoks \font_protruding_disable \to \everyforgetall % Here or not here?

% \def\fonthandlingerror{\writestatus\m!fonts{font handling is replaced by features in mkiv}}
%
% \let\fonthandling\empty
%
% \unexpanded\def\startfonthandling  #1{\fonthandlingerror\fonthandlingerror\gobbleuntil\stopfonthandling} % can't happen
% \unexpanded\def\definefonthandling   {\dotripleempty\dodefinefonthandling}
% \unexpanded\def\setupfonthandling    {\dodoubleempty\dosetupfonthandling }
% \def\dodefinefonthandling[#1][#2][#3]{\fonthandlingerror}
% \def\dosetupfonthandling     [#1][#2]{\fonthandlingerror}
% \def\usehandling                 [#1]{\fonthandlingerror}

\protect \endinput