diff options
author | Hans Hagen <pragma@wxs.nl> | 2008-05-21 15:21:00 +0200 |
---|---|---|
committer | Hans Hagen <pragma@wxs.nl> | 2008-05-21 15:21:00 +0200 |
commit | 1d63a6eae86a6b78d4563ed60521449e4bf89f3c (patch) | |
tree | 5a0db36538992d01458e22ff765bf8258bd16161 /tex/context/base/font-tfm.lua | |
parent | d7e26feb7432f7bd29dd065fa578dc8395fb408f (diff) | |
download | context-1d63a6eae86a6b78d4563ed60521449e4bf89f3c.tar.gz |
stable 2008.05.21 15:21
Diffstat (limited to 'tex/context/base/font-tfm.lua')
-rw-r--r-- | tex/context/base/font-tfm.lua | 45 |
1 files changed, 34 insertions, 11 deletions
diff --git a/tex/context/base/font-tfm.lua b/tex/context/base/font-tfm.lua index 175dd6d10..d0a838bcd 100644 --- a/tex/context/base/font-tfm.lua +++ b/tex/context/base/font-tfm.lua @@ -180,8 +180,10 @@ in the process; numbers are of course copies. Here 65536 equals 1pt. (Due to excessive memory usage in CJK fonts, we no longer pass the boundingbox.)</p> --ldx]]-- +fonts.trace_scaling = false + function fonts.tfm.do_scale(tfmtable, scaledpoints) - local trace = fonts.trace + local trace = fonts.trace_scaling if scaledpoints < 0 then scaledpoints = (- scaledpoints/1000) * tfmtable.designsize -- already in sp end @@ -463,18 +465,18 @@ do local afmdata = tfmdata.shared.afmdata local characters = tfmdata.characters local unicodes = afmdata.luatex.unicodes - local function remap(pattern,name) - local p = pattern:match(name) - if p then - local oldchr, newchr = unicodes[p], unicodes[name] - if oldchr and newchr then - characters[oldchr] = characters[newchr] + local done = false + for i, blob in pairs(characters) do + local name = blob.description.name + if name then + local p = pattern:match(name) + if p then + local oldchr, newchr = unicodes[p], unicodes[name] + if oldchr and newchr then + characters[oldchr] = characters[newchr] + end end end - return p - end - for _, blob in pairs(characters) do - remap(pattern,blob.name) end end end @@ -486,6 +488,27 @@ do fonts.initializers.common.remap(tfmdata,value,smallcaps) end + function fonts.initializers.common.fakecaps(tfmdata,value) + if value then + -- todo: scale down + local afmdata = tfmdata.shared.afmdata + local characters = tfmdata.characters + local unicodes = afmdata.luatex.unicodes + for i, blob in pairs(characters) do + local name = blob.description.name + if name then + local p = name:lower() + if p then + local oldchr, newchr = unicodes[p], unicodes[name] + if oldchr and newchr then + characters[oldchr] = characters[newchr] + end + end + end + end + end + end + end --~ function fonts.initializers.common.install(format,feature) -- 'afm','lineheight' |