blob: 809c7a252450bd694caa7460bb750068c65e95fb (
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
|
%D \module
%D [ file=typo-itc,
%D version=2011.10.08,
%D title=\CONTEXT\ Typesetting Macros,
%D subtitle=Italic Correction,
%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.
\writestatus{loading}{ConTeXt Typesetting Macros / Italics Corrections}
\unprotect
%D The brave might try:
%D
%D \starttyping
%D \definefontfeature[default][default][itlc=yes,notextitalics=yes]
%D \setupitaliccorrection[global,always]
%D \stoptyping
\registerctxluafile{typo-itc}{1.001}
\definesystemattribute[italics][public]
% \let\/=/
% \let\emphasiscorrection\donothing
\ifdefined \normalitaliccorrection \else
\let\normalitaliccorrection\italiccorrection
\fi
\unexpanded\def\italiccorrection
{\ifnum\attribute\italicsattribute<\plusone\normalitaliccorrection\fi}
\let\/\italiccorrection
% 1 = end of word
% 2 = end of word and end of a list
\unexpanded\def\setitaliccorrection[#code]% rather low level (might go away)
{\ctxlua{typesetters.italics.set(\number#code)}}
\unexpanded\def\resetitaliccorrection% rather low level (might go away)
{\ctxlua{typesetters.italics.reset()}}
% global : no attributes, just always (faster and less memory)
% text : only text
% always : text and boxes
% none : -
\unexpanded\def\setupitaliccorrection[#settings]%
{\ctxcommand{setupitaliccorrection("#settings")}}
\appendtoks
\attribute\italicsattribute\attributeunsetvalue
\to \everymathematics
\protect \endinput
|