typo-itc.mkvi /size: 1674 b    last modification: 2021-10-28 13:50
1%D \module
2%D   [       file=typo-itc,
3%D        version=2011.10.08,
4%D          title=\CONTEXT\ Typesetting Macros,
5%D       subtitle=Italic Correction,
6%D         author=Hans Hagen,
7%D           date=\currentdate,
8%D      copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
9%C
10%C This module is part of the \CONTEXT\ macro||package and is
11%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
12%C details.
13
14\writestatus{loading}{ConTeXt Typesetting Macros / Italics Corrections}
15
16\unprotect
17
18%D The brave might try:
19%D
20%D \starttyping
21%D \definefontfeature[default][default][itlc=yes,textitalics=yes]
22%D \setupitaliccorrection[global,always]
23%D \stoptyping
24
25\registerctxluafile{typo-itc}{}
26
27\definesystemattribute[italics]    [public]
28\definesystemattribute[mathitalics][public]
29
30% \let\/=/
31% \let\emphasiscorrection\donothing
32
33\ifdefined \normalitaliccorrection \else
34    \let\normalitaliccorrection\italiccorrection
35\fi
36
37\unexpanded\def\italiccorrection
38  {\ifnum\c_attr_italics<\plusone\normalitaliccorrection\fi}
39
40\pushoverloadmode
41
42\let\/\italiccorrection
43
44\popoverloadmode
45
46% 1 = end of word
47% 2 = end of word and end of a list
48
49\unexpanded\def\setitaliccorrection[#code]% rather low level (might go away)
50  {\clf_setitaliccorrection#code\relax}
51
52\unexpanded\def\resetitaliccorrection% rather low level (might go away)
53  {\clf_resetitaliccorrection}
54
55% global : no attributes, just always (faster and less memory)
56% text   : only text
57% always : text and boxes
58% none   : -
59
60\unexpanded\def\setupitaliccorrection[#settings]%
61  {\clf_setupitaliccorrection{#settings}}
62
63\appendtoks
64    \c_attr_italics\attributeunsetvalue
65\to \everymathematics
66
67\protect \endinput
68