From 674498b3ebba014a7f4e086fde3972a84e8a9770 Mon Sep 17 00:00:00 2001 From: Khaled Hosny Date: Wed, 9 Nov 2011 01:50:29 +0200 Subject: Sync with ConTeXt beta 2011.11.08 19:35 --- otfl-font-otf.lua | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'otfl-font-otf.lua') diff --git a/otfl-font-otf.lua b/otfl-font-otf.lua index cab6fae..924e9a6 100644 --- a/otfl-font-otf.lua +++ b/otfl-font-otf.lua @@ -12,6 +12,8 @@ if not modules then modules = { } end modules ['font-otf'] = { -- to_table -> totable -- ascent descent +-- more checking against low level calls of functions + local utf = unicode.utf8 local utfbyte = utf.byte @@ -515,7 +517,7 @@ local mt = { } actions["prepare tables"] = function(data,filename,raw) - data.properties.italic_correction = false + data.properties.hasitalics = false end actions["add dimensions"] = function(data,filename) @@ -600,7 +602,7 @@ local function somecopy(old) -- fast one end end --- not setting italic_correction and class (when nil) during +-- not setting hasitalics and class (when nil) during -- table cronstruction can save some mem actions["prepare glyphs"] = function(data,filename,raw) @@ -844,7 +846,7 @@ actions["analyze glyphs"] = function(data,filename,raw) -- maybe integrate this local resources = data.resources local metadata = data.metadata local properties = data.properties - local italic_correction = false + local hasitalics = false local widths = { } local marks = { } for unicode, description in next, descriptions do @@ -856,7 +858,7 @@ actions["analyze glyphs"] = function(data,filename,raw) -- maybe integrate this -- skip else description.italic = italic - italic_correction = true + hasitalics = true end local width = glyph.width widths[width] = (widths[width] or 0) + 1 @@ -869,7 +871,7 @@ actions["analyze glyphs"] = function(data,filename,raw) -- maybe integrate this end end -- flag italic - properties.italic_correction = italic_correction + properties.hasitalics = hasitalics -- flag marks resources.marks = marks -- share most common width for cjk fonts @@ -1309,8 +1311,6 @@ actions["reorganize lookups"] = function(data,filename,raw) end end --- to be checked italic_correction - local function check_variants(unicode,the_variants,splitter,unicodes) local variants = the_variants.variants if variants then -- use splitter @@ -1928,9 +1928,9 @@ local function otftotfm(specification) tfmdata.shared = shared end shared.rawdata = rawdata - shared.features = features -- default + -- shared.features = features -- default shared.dynamics = { } - shared.processes = { } + -- shared.processes = { } tfmdata.changed = { } shared.features = features shared.processes = otf.setfeatures(tfmdata,features) @@ -1949,7 +1949,8 @@ local function read_from_otf(specification) tfmdata.properties.sub = specification.sub -- tfmdata = constructors.scale(tfmdata,specification) - constructors.applymanipulators("otf",tfmdata,specification.features.normal,trace_features,report_otf) + local allfeatures = tfmdata.shared.features or specification.features.normal + constructors.applymanipulators("otf",tfmdata,allfeatures,trace_features,report_otf) constructors.setname(tfmdata,specification) -- only otf? fonts.loggers.register(tfmdata,file.extname(specification.filename),specification) end -- cgit v1.2.3