summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/luatex/luaotfload/fontloader-font-oti.lua
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2015-12-23 23:45:40 +0000
committerKarl Berry <karl@freefriends.org>2015-12-23 23:45:40 +0000
commit46395f08db1fd908b63f6ca929f985ed12468dcc (patch)
tree26408d81693ab74a3f80dac383d06a4e49c56b8f /Master/texmf-dist/tex/luatex/luaotfload/fontloader-font-oti.lua
parentb361149a3534bd565a40b031860524b7d7e56c76 (diff)
luaotfload (23dec15)
git-svn-id: svn://tug.org/texlive/trunk@39184 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/luatex/luaotfload/fontloader-font-oti.lua')
-rw-r--r--Master/texmf-dist/tex/luatex/luaotfload/fontloader-font-oti.lua69
1 files changed, 68 insertions, 1 deletions
diff --git a/Master/texmf-dist/tex/luatex/luaotfload/fontloader-font-oti.lua b/Master/texmf-dist/tex/luatex/luaotfload/fontloader-font-oti.lua
index 06c2a42fac2..bacd001a5e8 100644
--- a/Master/texmf-dist/tex/luatex/luaotfload/fontloader-font-oti.lua
+++ b/Master/texmf-dist/tex/luatex/luaotfload/fontloader-font-oti.lua
@@ -13,9 +13,11 @@ local constructors = fonts.constructors
local otf = constructors.newhandler("otf")
local otffeatures = constructors.newfeatures("otf")
-local otftables = otf.tables
local registerotffeature = otffeatures.register
+local otftables = otf.tables or { }
+otf.tables = otftables
+
local allocate = utilities.storage.allocate
registerotffeature {
@@ -89,3 +91,68 @@ registerotffeature {
}
}
+-- here (as also in generic
+
+otftables.featuretypes = allocate {
+ gpos_single = "position",
+ gpos_pair = "position",
+ gpos_cursive = "position",
+ gpos_mark2base = "position",
+ gpos_mark2ligature = "position",
+ gpos_mark2mark = "position",
+ gpos_context = "position",
+ gpos_contextchain = "position",
+ gsub_single = "substitution",
+ gsub_multiple = "substitution",
+ gsub_alternate = "substitution",
+ gsub_ligature = "substitution",
+ gsub_context = "substitution",
+ gsub_contextchain = "substitution",
+ gsub_reversecontextchain = "substitution",
+ gsub_reversesub = "substitution",
+}
+
+function otffeatures.checkeddefaultscript(featuretype,autoscript,scripts)
+ if featuretype == "position" then
+ local default = scripts.dflt
+ if default then
+ if autoscript == "position" or autoscript == true then
+ return default
+ else
+ report_otf("script feature %s not applied, enable default positioning")
+ end
+ else
+ -- no positioning at all
+ end
+ elseif featuretype == "substitution" then
+ local default = scripts.dflt
+ if default then
+ if autoscript == "substitution" or autoscript == true then
+ return default
+ end
+ end
+ end
+end
+
+function otffeatures.checkeddefaultlanguage(featuretype,autolanguage,languages)
+ if featuretype == "position" then
+ local default = languages.dflt
+ if default then
+ if autolanguage == "position" or autolanguage == true then
+ return default
+ else
+ report_otf("language feature %s not applied, enable default positioning")
+ end
+ else
+ -- no positioning at all
+ end
+ elseif featuretype == "substitution" then
+ local default = languages.dflt
+ if default then
+ if autolanguage == "substitution" or autolanguage == true then
+ return default
+ end
+ end
+ end
+end
+