diff options
author | Hans Hagen <pragma@wxs.nl> | 2009-12-22 13:15:00 +0100 |
---|---|---|
committer | Hans Hagen <pragma@wxs.nl> | 2009-12-22 13:15:00 +0100 |
commit | 608f6a9dca87c2073c2a74c7eb961ec3077f9f76 (patch) | |
tree | a31b00d3cdd021407c4731c23cff31ebfa6fb4e7 /tex/generic | |
parent | fde411dd869e9b19c98ef73c38fea591a468262f (diff) | |
download | context-608f6a9dca87c2073c2a74c7eb961ec3077f9f76.tar.gz |
beta 2009.12.22 13:15
Diffstat (limited to 'tex/generic')
-rw-r--r-- | tex/generic/context/luatex-fonts-merged.lua | 101 |
1 files changed, 52 insertions, 49 deletions
diff --git a/tex/generic/context/luatex-fonts-merged.lua b/tex/generic/context/luatex-fonts-merged.lua index 959033e31..52c46884c 100644 --- a/tex/generic/context/luatex-fonts-merged.lua +++ b/tex/generic/context/luatex-fonts-merged.lua @@ -1,6 +1,6 @@ -- merged file : c:/data/develop/context/texmf/tex/generic/context/luatex-fonts-merged.lua -- parent file : c:/data/develop/context/texmf/tex/generic/context/luatex-fonts.lua --- merge date : 12/18/09 11:16:33 +-- merge date : 12/22/09 13:19:25 do -- begin closure to overcome local limits and interference @@ -3541,6 +3541,7 @@ function tfm.do_scale(tfmtable, scaledpoints) scaledpoints = (- scaledpoints/1000) * tfmtable.designsize -- already in sp end local delta = scaledpoints/(tfmtable.units or 1000) -- brr, some open type fonts have 2048 + local hdelta, vdelta = delta, delta local t = { } -- unicoded unique descriptions shared cidinfo characters changed parameters indices for k,v in next, tfmtable do @@ -3550,6 +3551,15 @@ function tfm.do_scale(tfmtable, scaledpoints) t[k] = v end end + local stretch = tfmtable.stretch or 0 + if stretch ~= 0 and stretch ~= 1 then + hdelta = hdelta * stretch + t.extend = stretch * 1000 + end + local slant = tfmtable.slant or 0 + if slant ~= 0 then + t.slant = t.slant * 1000 + end -- status local isvirtual = tfmtable.type == "virtual" or tfmtable.virtualized local hasmath = (tfmtable.math_parameters ~= nil and next(tfmtable.math_parameters) ~= nil) or (tfmtable.MathConstants ~= nil and next(tfmtable.MathConstants) ~= nil) @@ -3577,12 +3587,12 @@ t.colorscheme = tfmtable.colorscheme local tfmp = tfmtable.parameters -- let's check for indexes -- tp.slant = (tfmp.slant or tfmp[1] or 0) - tp.space = (tfmp.space or tfmp[2] or 0)*delta - tp.space_stretch = (tfmp.space_stretch or tfmp[3] or 0)*delta - tp.space_shrink = (tfmp.space_shrink or tfmp[4] or 0)*delta - tp.x_height = (tfmp.x_height or tfmp[5] or 0)*delta - tp.quad = (tfmp.quad or tfmp[6] or 0)*delta - tp.extra_space = (tfmp.extra_space or tfmp[7] or 0)*delta + tp.space = (tfmp.space or tfmp[2] or 0)*hdelta + tp.space_stretch = (tfmp.space_stretch or tfmp[3] or 0)*hdelta + tp.space_shrink = (tfmp.space_shrink or tfmp[4] or 0)*hdelta + tp.x_height = (tfmp.x_height or tfmp[5] or 0)*vdelta + tp.quad = (tfmp.quad or tfmp[6] or 0)*hdelta + tp.extra_space = (tfmp.extra_space or tfmp[7] or 0)*hdelta local protrusionfactor = (tp.quad ~= 0 and 1000/tp.quad) or 0 local tc = t.characters local characters = tfmtable.characters @@ -3599,11 +3609,11 @@ t.colorscheme = tfmtable.colorscheme local sharedkerns, basekerns = tfm.check_base_kerns(tfmtable) -- loop over descriptions (afm and otf have descriptions, tfm not) -- there is no need (yet) to assign a value to chr.tonunicode - local scaledwidth = defaultwidth * delta - local scaledheight = defaultheight * delta - local scaleddepth = defaultdepth * delta + local scaledwidth = defaultwidth * hdelta + local scaledheight = defaultheight * vdelta + local scaleddepth = defaultdepth * vdelta local stackmath = tfmtable.ignore_stack_math ~= true -local private = fonts.private + local private = fonts.private for k,v in next, characters do local chr, description, index if ischanged then @@ -3624,9 +3634,9 @@ local private = fonts.private local width = description.width local height = description.height local depth = description.depth - if width then width = delta*width else width = scaledwidth end - if height then height = delta*height else height = scaledheight end - -- if depth then depth = delta*depth else depth = scaleddepth end + if width then width = hdelta*width else width = scaledwidth end + if height then height = vdelta*height else height = scaledheight end + -- if depth then depth = vdelta*depth else depth = scaleddepth end if depth and depth ~= 0 then depth = delta*depth if nameneeded then @@ -3690,7 +3700,7 @@ local private = fonts.private if hasitalic then local vi = description.italic or v.italic if vi and vi ~= 0 then - chr.italic = vi*delta + chr.italic = vi*hdelta end end -- to be tested @@ -3706,19 +3716,19 @@ local private = fonts.private for i=1,#vv do local vvi = vv[i] t[i] = { - ["start"] = (vvi["start"] or 0)*delta, - ["end"] = (vvi["end"] or 0)*delta, - ["advance"] = (vvi["advance"] or 0)*delta, + ["start"] = (vvi["start"] or 0)*vdelta, + ["end"] = (vvi["end"] or 0)*vdelta, + ["advance"] = (vvi["advance"] or 0)*vdelta, ["extender"] = vvi["extender"], ["glyph"] = vvi["glyph"], } end chr.vert_variants = t ---~ local ic = v.vert_italic_correction ---~ if ic then ---~ chr.italic = ic * delta ---~ print(format("0x%05X -> %s",k,chr.italic)) ---~ end + --~ local ic = v.vert_italic_correction + --~ if ic then + --~ chr.italic = ic * hdelta + --~ print(format("0x%05X -> %s",k,chr.italic)) + --~ end else local hv = v.horiz_variants if hv then @@ -3726,9 +3736,9 @@ local private = fonts.private for i=1,#hv do local hvi = hv[i] t[i] = { - ["start"] = (hvi["start"] or 0)*delta, - ["end"] = (hvi["end"] or 0)*delta, - ["advance"] = (hvi["advance"] or 0)*delta, + ["start"] = (hvi["start"] or 0)*hdelta, + ["end"] = (hvi["end"] or 0)*hdelta, + ["advance"] = (hvi["advance"] or 0)*hdelta, ["extender"] = hvi["extender"], ["glyph"] = hvi["glyph"], } @@ -3739,31 +3749,23 @@ local private = fonts.private end local vt = description.top_accent if vt then - chr.top_accent = delta*vt + chr.top_accent = vdelta*vt end if stackmath then local mk = v.mathkerns if mk then local kerns = { } - -- for k, v in next, mk do - -- local kk = { } - -- for i=1,#v do - -- local vi = v[i] - -- kk[i] = { height = delta*vi.height, kern = delta*vi.kern } - -- end - -- kerns[k] = kk - -- end local v = mk.top_right if v then local k = { } for i=1,#v do local vi = v[i] - k[i] = { height = delta*vi.height, kern = delta*vi.kern } + k[i] = { height = vdelta*vi.height, kern = vdelta*vi.kern } end kerns.top_right = k end local v = mk.top_left if v then local k = { } for i=1,#v do local vi = v[i] - k[i] = { height = delta*vi.height, kern = delta*vi.kern } + k[i] = { height = vdelta*vi.height, kern = vdelta*vi.kern } end kerns.top_left = k end local v = mk.bottom_left if v then local k = { } for i=1,#v do local vi = v[i] - k[i] = { height = delta*vi.height, kern = delta*vi.kern } + k[i] = { height = vdelta*vi.height, kern = vdelta*vi.kern } end kerns.bottom_left = k end local v = mk.bottom_right if v then local k = { } for i=1,#v do local vi = v[i] - k[i] = { height = delta*vi.height, kern = delta*vi.kern } + k[i] = { height = vdelta*vi.height, kern = vdelta*vi.kern } end kerns.bottom_right = k end chr.mathkern = kerns -- singular end @@ -3776,13 +3778,13 @@ local private = fonts.private local base = basekerns[vk] -- hashed by table id, not content if not base then base = {} - for k,v in next, vk do base[k] = v*delta end + for k,v in next, vk do base[k] = v*hdelta end basekerns[vk] = base end chr.kerns = base else local tt = {} - for k,v in next, vk do tt[k] = v*delta end + for k,v in next, vk do tt[k] = v*hdelta end chr.kerns = tt end end @@ -3816,8 +3818,10 @@ local private = fonts.private for i=1,#vc do local ivc = vc[i] local key = ivc[1] - if key == "right" or key == "down" then - tt[#tt+1] = { key, ivc[2]*delta } + if key == "right" then + tt[#tt+1] = { key, ivc[2]*hdelta } + elseif key == "down" then + tt[#tt+1] = { key, ivc[2]*vdelta } else -- not comment tt[#tt+1] = ivc -- shared since in cache and untouched end @@ -3829,13 +3833,12 @@ local private = fonts.private end end tc[k] = chr ---~ if k == 0x222B then ---~ print(t.fontname,table.serialize(chr)) ---~ end end -- t.encodingbytes, t.filename, t.fullname, t.name: elsewhere t.size = scaledpoints t.factor = delta + t.hfactor = hdelta + t.vfactor = vdelta if t.fonts then t.fonts = table.fastcopy(t.fonts) -- maybe we virtualize more afterwards end @@ -3843,7 +3846,7 @@ local private = fonts.private -- mathematics.extras.copy(t) -- can be done elsewhere if needed local ma = tfm.mathactions for i=1,#ma do - ma[i](t,tfmtable,delta) + ma[i](t,tfmtable,delta,hdelta,vdelta) -- what delta? end end -- needed for \high cum suis @@ -5349,7 +5352,7 @@ otf.features.default = otf.features.default or { } otf.enhancers = otf.enhancers or { } otf.glists = { "gsub", "gpos" } -otf.version = 2.640 -- 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 @@ -6797,7 +6800,7 @@ function otf.copy_to_tfm(data,cache_id) -- we can save a copy when we reorder th tfm.cidinfo.registry = tfm.cidinfo.registry or "" tfm.type = "real" tfm.stretch = 0 -- stretch - tfm.slant = 0 -- slant + tfm.slant = 0 -- data.slant tfm.direction = 0 tfm.boundarychar_label = 0 tfm.boundarychar = 65536 |