summaryrefslogtreecommitdiff
path: root/otfl-font-otf.lua
diff options
context:
space:
mode:
authorKhaled Hosny <khaledhosny@eglug.org>2009-12-29 15:50:46 +0200
committerKhaled Hosny <khaledhosny@eglug.org>2009-12-29 18:40:22 +0200
commitd4cccf105bb508150dc765c93bb47bf6f9a87f81 (patch)
tree4ab23fe5b33bc6ab12c69e0a254947cb26ecb36a /otfl-font-otf.lua
parentff44e48362f55213318316d53efa5376e06345df (diff)
downloadluaotfload-d4cccf105bb508150dc765c93bb47bf6f9a87f81.tar.gz
Updating to latest ConTeXt beta (2009.12.26)
Diffstat (limited to 'otfl-font-otf.lua')
-rw-r--r--otfl-font-otf.lua33
1 files changed, 28 insertions, 5 deletions
diff --git a/otfl-font-otf.lua b/otfl-font-otf.lua
index 6900b84..e2f0f5b 100644
--- a/otfl-font-otf.lua
+++ b/otfl-font-otf.lua
@@ -83,7 +83,7 @@ otf.features.default = otf.features.default or { }
otf.enhancers = otf.enhancers or { }
otf.glists = { "gsub", "gpos" }
-otf.version = 2.636 -- beware: also sync font-mis.lua
+otf.version = 2.641 -- beware: also sync font-mis.lua
otf.pack = true -- beware: also sync font-mis.lua
otf.syncspace = true
otf.notdef = false
@@ -214,6 +214,7 @@ local enhancers = {
"share widths",
"strip not needed data",
"migrate metadata",
+ "check math parameters",
}
function otf.load(filename,format,sub,featurefile)
@@ -238,8 +239,12 @@ function otf.load(filename,format,sub,featurefile)
ff, messages = fontloader.open(filename)
end
if trace_loading and messages and #messages > 0 then
- for m=1,#messages do
- logs.report("load otf","warning: %s",messages[m])
+ if type(messages) == "string" then
+ logs.report("load otf","warning: %s",messages)
+ else
+ for m=1,#messages do
+ logs.report("load otf","warning: %s",tostring(messages[m]))
+ end
end
end
if ff then
@@ -1166,6 +1171,26 @@ otf.enhancers["migrate metadata"] = function(data,filename)
metadata.charwidth = pfminfo and pfminfo.avgwidth
end
+local private_math_parameters = {
+ "FractionDelimiterSize",
+ "FractionDelimiterDisplayStyleSize",
+}
+
+otf.enhancers["check math parameters"] = function(data,filename)
+ local mathdata = data.metadata.math
+ if mathdata then
+ for m=1,#private_math_parameters do
+ local pmp = private_math_parameters[m]
+ if not mathdata[pmp] then
+ if trace_loading then
+ logs.report("load otf", "setting math parameter '%s' to 0", pmp)
+ end
+ mathdata[pmp] = 0
+ end
+ end
+ end
+end
+
otf.enhancers["flatten glyph lookups"] = function(data,filename)
for k, v in next, data.glyphs do
if v.lookups then
@@ -1505,8 +1530,6 @@ function otf.copy_to_tfm(data,cache_id) -- we can save a copy when we reorder th
tfm.cidinfo = data.cidinfo
tfm.cidinfo.registry = tfm.cidinfo.registry or ""
tfm.type = "real"
- tfm.stretch = 0 -- stretch
- tfm.slant = 0 -- slant
tfm.direction = 0
tfm.boundarychar_label = 0
tfm.boundarychar = 65536