summaryrefslogtreecommitdiff
path: root/tex/context/base/mkiv/typo-rep.mkiv
blob: c1146997e3365b832fda8cdd562da443d7b2f692 (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
%D \module
%D   [       file=typo-rep,
%D        version=2010.05.23,
%D          title=\CONTEXT\ Typesetting Macros,
%D       subtitle=Stripping,
%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 / Stripping}

% experimental stripping

%D For a while we had stripping of special chars built into the analyzer
%D but Khaled suggested to generalize this so I changed the code into a
%D manipulator there.
%D
%D \starttyping
%D \definefontfeature[default][default][mode=node,formatters=strip]
%D \stoptyping
%D
%D However, in \MKIV\ it makes more sense to also provide it as a more
%D general feature. Here we implement this as experiment. I might
%D cook up a few more variants in both variants.
%D
%D \starttyping
%D \setcharacterstripping[1]
%D \stoptyping

\unprotect

\registerctxluafile{typo-rep}{1.001}

\definesystemattribute[stripping][public]

\unexpanded\def\setcharacterstripping[#1]%
  {\clf_setcharacterstripping{#1}}

\unexpanded\def\resetcharacterstripping
  {\attribute\strippingattribute\attributeunsetvalue}

% maybe .. this might disappear, but is handy for testing

\unexpanded\def\forcecharacterstripping % secret command
  {\ctxlua{fonts.handlers.otf.features.register("formatters",true)}}

\protect \endinput