summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/luaotfload-auxiliary.lua112
-rw-r--r--src/luaotfload-main.lua3
2 files changed, 57 insertions, 58 deletions
diff --git a/src/luaotfload-auxiliary.lua b/src/luaotfload-auxiliary.lua
index 89bf51b..7ea747e 100644
--- a/src/luaotfload-auxiliary.lua
+++ b/src/luaotfload-auxiliary.lua
@@ -417,25 +417,25 @@ least one feature.
local provides_script = function (font_id, asked_script)
asked_script = stringlower(asked_script)
if font_id and font_id > 0 then
- local fontdata = identifiers[font_id].shared.rawdata
- if fontdata then
- local fontname = fontdata.metadata.fontname
- local features = fontdata.resources.features
- for method, featuredata in next, features do
- --- where method: "gpos" | "gsub"
- for feature, data in next, featuredata do
- if data[asked_script] then
- report ("log", 1, "aux",
- "font no %d (%s) defines feature %s for script %s",
- font_id, fontname, feature, asked_script)
- return true
- end
+ local tfmdata = identifiers[font_id] if not tfmdata then return false end
+ local shared = tfmdata.shared if not shared then return false end
+ local fontdata = shared.rawdata if not fontdata then return false end
+ local fontname = fontdata.metadata.fontname
+ local features = fontdata.resources.features
+ for method, featuredata in next, features do
+ --- where method: "gpos" | "gsub"
+ for feature, data in next, featuredata do
+ if data[asked_script] then
+ report ("log", 1, "aux",
+ "font no %d (%s) defines feature %s for script %s",
+ font_id, fontname, feature, asked_script)
+ return true
end
end
- report ("log", 0, "aux",
- "font no %d (%s) defines no feature for script %s",
- font_id, fontname, asked_script)
end
+ report ("log", 0, "aux",
+ "font no %d (%s) defines no feature for script %s",
+ font_id, fontname, asked_script)
end
report ("log", 0, "aux", "no font with id %d", font_id)
return false
@@ -455,29 +455,29 @@ local provides_language = function (font_id, asked_script, asked_language)
asked_script = stringlower(asked_script)
asked_language = stringlower(asked_language)
if font_id and font_id > 0 then
- local fontdata = identifiers[font_id].shared.rawdata
- if fontdata then
- local fontname = fontdata.metadata.fontname
- local features = fontdata.resources.features
- for method, featuredata in next, features do
- --- where method: "gpos" | "gsub"
- for feature, data in next, featuredata do
- local scriptdata = data[asked_script]
- if scriptdata and scriptdata[asked_language] then
- report ("log", 1, "aux",
- "font no %d (%s) defines feature %s "
- .. "for script %s with language %s",
- font_id, fontname, feature,
- asked_script, asked_language)
- return true
- end
+ local tfmdata = identifiers[font_id] if not tfmdata then return false end
+ local shared = tfmdata.shared if not shared then return false end
+ local fontdata = shared.rawdata if not fontdata then return false end
+ local fontname = fontdata.metadata.fontname
+ local features = fontdata.resources.features
+ for method, featuredata in next, features do
+ --- where method: "gpos" | "gsub"
+ for feature, data in next, featuredata do
+ local scriptdata = data[asked_script]
+ if scriptdata and scriptdata[asked_language] then
+ report ("log", 1, "aux",
+ "font no %d (%s) defines feature %s "
+ .. "for script %s with language %s",
+ font_id, fontname, feature,
+ asked_script, asked_language)
+ return true
end
end
- report ("log", 0, "aux",
- "font no %d (%s) defines no feature "
- .. "for script %s with language %s",
- font_id, fontname, asked_script, asked_language)
end
+ report ("log", 0, "aux",
+ "font no %d (%s) defines no feature "
+ .. "for script %s with language %s",
+ font_id, fontname, asked_script, asked_language)
end
report ("log", 0, "aux", "no font with id %d", font_id)
return false
@@ -527,29 +527,29 @@ local provides_feature = function (font_id, asked_script,
asked_feature = lpegmatch(strip_garbage, asked_feature)
if font_id and font_id > 0 then
- local fontdata = identifiers[font_id].shared.rawdata
- if fontdata then
- local features = fontdata.resources.features
- local fontname = fontdata.metadata.fontname
- for method, featuredata in next, features do
- --- where method: "gpos" | "gsub"
- local feature = featuredata[asked_feature]
- if feature then
- local scriptdata = feature[asked_script]
- if scriptdata and scriptdata[asked_language] then
- report ("log", 1, "aux",
- "font no %d (%s) defines feature %s "
- .. "for script %s with language %s",
- font_id, fontname, asked_feature,
- asked_script, asked_language)
- return true
- end
+ local tfmdata = identifiers[font_id] if not tfmdata then return false end
+ local shared = tfmdata.shared if not shared then return false end
+ local fontdata = shared.rawdata if not fontdata then return false end
+ local features = fontdata.resources.features
+ local fontname = fontdata.metadata.fontname
+ for method, featuredata in next, features do
+ --- where method: "gpos" | "gsub"
+ local feature = featuredata[asked_feature]
+ if feature then
+ local scriptdata = feature[asked_script]
+ if scriptdata and scriptdata[asked_language] then
+ report ("log", 1, "aux",
+ "font no %d (%s) defines feature %s "
+ .. "for script %s with language %s",
+ font_id, fontname, asked_feature,
+ asked_script, asked_language)
+ return true
end
end
- report ("log", 0, "aux",
- "font no %d (%s) does not define feature %s for script %s with language %s",
- font_id, fontname, asked_feature, asked_script, asked_language)
end
+ report ("log", 0, "aux",
+ "font no %d (%s) does not define feature %s for script %s with language %s",
+ font_id, fontname, asked_feature, asked_script, asked_language)
end
report ("log", 0, "aux", "no font with id %d", font_id)
return false
diff --git a/src/luaotfload-main.lua b/src/luaotfload-main.lua
index 26d1515..b5cb1d3 100644
--- a/src/luaotfload-main.lua
+++ b/src/luaotfload-main.lua
@@ -691,8 +691,7 @@ do
local mk_info = function (name)
local definer = name == "patch" and patch or read
return function (specification, size, id)
- logreport ("both", 0, "main",
- "active font definer: %q", name)
+ logreport ("both", 0, "main", "active font definer: %q", name)
logreport ("both", 0, "main", " > defining font no. %d", id)
logreport ("both", 0, "main", " > spec %q", specification)
logreport ("both", 0, "main", " > at size %.2f pt", size / 2^16)