diff options
author | Elie Roux <elie.roux@telecom-bretagne.eu> | 2009-06-10 20:21:00 +0300 |
---|---|---|
committer | Elie Roux <elie.roux@telecom-bretagne.eu> | 2009-06-10 20:21:00 +0300 |
commit | 1ef10e57241a65e8ce2aeefdd83874e8999b7b44 (patch) | |
tree | 713769db5cdf9115e2824aa09e8f65cd795667f7 /otfl-font-tfm.lua | |
parent | 5821436af1c522206c3faf90e0813415445ea6c7 (diff) | |
download | luaotfload-1ef10e57241a65e8ce2aeefdd83874e8999b7b44.tar.gz |
syncing with latest ConTeXt version (more feautures, less bugs), thanks to Khaled Hosny
Diffstat (limited to 'otfl-font-tfm.lua')
-rw-r--r-- | otfl-font-tfm.lua | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/otfl-font-tfm.lua b/otfl-font-tfm.lua index ab8a4db..9210fee 100644 --- a/otfl-font-tfm.lua +++ b/otfl-font-tfm.lua @@ -101,10 +101,8 @@ function tfm.read_from_tfm(specification) end tfm.enhance(tfmdata,specification) end - else - if trace_defining then - logs.report("define font","loading tfm with name %s fails",specification.name) - end + elseif trace_defining then + logs.report("define font","loading tfm with name %s fails",specification.name) end return tfmdata end @@ -226,6 +224,10 @@ end local charactercache = { } +-- The scaler is only used for otf and afm and virtual fonts. If +-- a virtual font has italic correction make sur eto set the +-- has_italic flag. Some more flags will be added in the future. + function tfm.do_scale(tfmtable, scaledpoints) tfm.prepare_base_kerns(tfmtable) -- optimalization if scaledpoints < 0 then @@ -246,6 +248,7 @@ function tfm.do_scale(tfmtable, scaledpoints) local hasmath = tfmtable.math_parameters ~= nil or tfmtable.MathConstants ~= nil local nodemode = tfmtable.mode == "node" local hasquality = tfmtable.auto_expand or tfmtable.auto_protrude + local hasitalic = tfmtable.has_italic -- t.parameters = { } t.characters = { } @@ -372,9 +375,11 @@ function tfm.do_scale(tfmtable, scaledpoints) end end -- todo: hasitalic - local vi = description.italic or v.italic - if vi then - chr.italic = vi*delta + if hasitalic then + local vi = description.italic or v.italic + if vi and vi ~= 0 then + chr.italic = vi*delta + end end -- to be tested if hasmath then @@ -531,10 +536,14 @@ function tfm.do_scale(tfmtable, scaledpoints) if not tp[22] then tp[22] = 0 end -- mathaxisheight if t.MathConstants then t.MathConstants.AccentBaseHeight = nil end -- safeguard t.tounicode = 1 + t.cidinfo = tfmtable.cidinfo -- we have t.name=metricfile and t.fullname=RealName and t.filename=diskfilename -- when collapsing fonts, luatex looks as both t.name and t.fullname as ttc files -- can have multiple subfonts --~ collectgarbage("collect") +--~ t.fontname = t.fontname or t.fullname +--~ t.name = t.name or t.fontname +--~ print(t.fullname,table.serialize(characters[string.byte('W')].kerns)) return t, delta end |