summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Gesang <pgesang@ix.urz.uni-heidelberg.de>2011-03-17 11:38:14 +0100
committerPhilipp Gesang <pgesang@ix.urz.uni-heidelberg.de>2011-03-17 11:38:14 +0100
commitc8e4a45475a3972191ebff2925210181c5f4cd6c (patch)
tree90bc643d44ea247b687b2b5a919957cc0dfa7fbb
parent8f9320953471eccea9eafd68a4dbd382d1db0171 (diff)
downloadt-letterspace-c8e4a45475a3972191ebff2925210181c5f4cd6c.tar.gz
optionally suppress kerning (for capitals)
-rw-r--r--t-letterspace.mkiv10
1 files changed, 10 insertions, 0 deletions
diff --git a/t-letterspace.mkiv b/t-letterspace.mkiv
index 7ef824f..509e4aa 100644
--- a/t-letterspace.mkiv
+++ b/t-letterspace.mkiv
@@ -21,6 +21,7 @@
\setinterfacevariable {letterspace} {letterspace}
\setinterfacevariable {spacefactor} {spacefactor}
\setinterfacevariable {spaceskip} {spaceskip}
+ \setinterfacevariable {suppresskern}{suppresskern}
\stopinterface
\unprotect
@@ -66,6 +67,9 @@
\dododoletterspace%
}
+\definefontfeature [letterspace:kerning] [kern=yes]
+\def\letterspace_truevalues{true,yep,yes}
+
\def\dododoletterspace#1{%
\def\currentobject{#1}%
\dontleavehmode
@@ -74,6 +78,11 @@
\setcharacterkerning[letterspace:current]%
\advance \spaceskip \letterspaceparameter{spaceskip}%
\advance \xspaceskip \letterspaceparameter{spaceskip}%
+ \doifinset{\letterspaceparameter{suppresskern}}{\letterspace_truevalues}{%
+ %\addfontfeaturetofont{letterspace:nokern}%
+ %\setff{letterspace:nokern}%
+ \subtractfontfeaturefromfont{letterspace:kerning}%
+ }
}%
\ifhmode\ifnum\lastnodetype=\@@gluenode
\unskip{\letterspace_setstuff\ }%
@@ -149,6 +158,7 @@
\setupletterspace [
\v!spacefactor=.125,
\v!spaceskip=.5em,
+ \v!suppresskern=false,
]
\defineletterspace[\v!letterspace]