summaryrefslogtreecommitdiff
path: root/tex/context/base/mkiv/font-ots.lua
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2019-12-27 17:59:09 +0100
committerContext Git Mirror Bot <phg@phi-gamma.net>2019-12-27 17:59:09 +0100
commitede5a2aae42ff502be35d800e97271cf0bdc889b (patch)
tree47e50c111004bf97110d2ebdf6b92e3d2767a367 /tex/context/base/mkiv/font-ots.lua
parentd40e81dea53da7bbc91df306814003f7720a167f (diff)
downloadcontext-ede5a2aae42ff502be35d800e97271cf0bdc889b.tar.gz
2019-12-27 16:45:00
Diffstat (limited to 'tex/context/base/mkiv/font-ots.lua')
-rw-r--r--tex/context/base/mkiv/font-ots.lua65
1 files changed, 37 insertions, 28 deletions
diff --git a/tex/context/base/mkiv/font-ots.lua b/tex/context/base/mkiv/font-ots.lua
index c37008d0e..c4f89c156 100644
--- a/tex/context/base/mkiv/font-ots.lua
+++ b/tex/context/base/mkiv/font-ots.lua
@@ -4235,9 +4235,26 @@ registerotffeature {
}
}
+-- Moved here (up) a bit. This doesn't really belong in generic so it will
+-- move to a context module some day.
+
+local function markinitializer(tfmdata,value)
+ local properties = tfmdata.properties
+ properties.checkmarks = value
+end
+
+registerotffeature {
+ name = "checkmarks",
+ description = "check mark widths",
+ default = true,
+ initializers = {
+ node = markinitializer,
+ },
+}
+
-- This can be used for extra handlers, but should be used with care! We implement one
-- here but some more can be found in the osd (script devanagary) file. Now watch out:
--- when a handlers has steps, it is called as the other ones, but when we have no steps,
+-- when a handler has steps, it is called as the other ones, but when we have no steps,
-- we use a different call:
--
-- function(head,dataset,sequence,initialrl,font,attr)
@@ -4248,22 +4265,28 @@ registerotffeature {
otf.handlers = handlers
+if context then
+ return
+else
+ -- todo: move the following code someplace else
+end
+
local setspacekerns = nodes.injections.setspacekerns if not setspacekerns then os.exit() end
-local tag = "kern" -- maybe some day a merge
+local tag = "kern"
-if fontfeatures then
+-- if fontfeatures then
- function handlers.trigger_space_kerns(head,dataset,sequence,initialrl,font,attr)
- local features = fontfeatures[font]
- local enabled = features and features.spacekern and features[tag]
- if enabled then
- setspacekerns(font,sequence)
- end
- return head, enabled
- end
+-- function handlers.trigger_space_kerns(head,dataset,sequence,initialrl,font,attr)
+-- local features = fontfeatures[font]
+-- local enabled = features and features.spacekern and features[tag]
+-- if enabled then
+-- setspacekerns(font,sequence)
+-- end
+-- return head, enabled
+-- end
-else -- generic (no hashes)
+-- else -- generic (no hashes)
function handlers.trigger_space_kerns(head,dataset,sequence,initialrl,font,attr)
local shared = fontdata[font].shared
@@ -4275,7 +4298,7 @@ else -- generic (no hashes)
return head, enabled
end
-end
+-- end
-- There are fonts out there that change the space but we don't do that kind of
-- things in TeX.
@@ -4393,7 +4416,7 @@ local function spaceinitializer(tfmdata,value) -- attr
if rules then
-- not now: analyze (simple) rules
elseif not coverage then
- -- nothng to do
+ -- nothing to do
elseif kind == "gpos_single" then
-- makes no sense in TeX
elseif kind == "gpos_pair" then
@@ -4477,17 +4500,3 @@ registerotffeature {
node = spaceinitializer,
},
}
-
-local function markinitializer(tfmdata,value)
- local properties = tfmdata.properties
- properties.checkmarks = value
-end
-
-registerotffeature {
- name = "checkmarks",
- description = "check mark widths",
- default = true,
- initializers = {
- node = markinitializer,
- },
-}