diff options
author | Hans Hagen <pragma@wxs.nl> | 2017-04-08 12:28:54 +0200 |
---|---|---|
committer | Context Git Mirror Bot <phg42.2a@gmail.com> | 2017-04-08 12:28:54 +0200 |
commit | ea2466fe69bd082d379e95e1567f3de0b76de243 (patch) | |
tree | 70f1bdcf7d402f2ae013caebf5f4cef5f6c2baed /tex/context/base/mkiv/font-cff.lua | |
parent | e32f57c9c5968f0c09130f6e24e28a96d6e1393d (diff) | |
download | context-ea2466fe69bd082d379e95e1567f3de0b76de243.tar.gz |
2017-04-08 12:15:00
Diffstat (limited to 'tex/context/base/mkiv/font-cff.lua')
-rw-r--r-- | tex/context/base/mkiv/font-cff.lua | 53 |
1 files changed, 46 insertions, 7 deletions
diff --git a/tex/context/base/mkiv/font-cff.lua b/tex/context/base/mkiv/font-cff.lua index eb0a2c1be..a799a67f5 100644 --- a/tex/context/base/mkiv/font-cff.lua +++ b/tex/context/base/mkiv/font-cff.lua @@ -982,6 +982,43 @@ do top = 0 end +-- local function xxcurveto(swap) +-- local last = top % 4 ~= 0 and stack[top] +-- if last then +-- top = top - 1 +-- end +-- for i=1,top,4 do +-- local ax, ay, bx, by +-- if swap then +-- ax = x + stack[i] +-- ay = y +-- bx = ax + stack[i+1] +-- by = ay + stack[i+2] +-- y = by + stack[i+3] +-- if last and i+3 == top then +-- x = bx + last +-- else +-- x = bx +-- end +-- swap = false +-- else +-- ax = x +-- ay = y + stack[i] +-- bx = ax + stack[i+1] +-- by = ay + stack[i+2] +-- x = bx + stack[i+3] +-- if last and i+3 == top then +-- y = by + last +-- else +-- y = by +-- end +-- swap = true +-- end +-- xycurveto(ax,ay,bx,by,x,y) +-- end +-- top = 0 +-- end + local function xxcurveto(swap) local last = top % 4 ~= 0 and stack[top] if last then @@ -1019,6 +1056,7 @@ do top = 0 end + local function hvcurveto() if trace_charstrings then showstate("hvcurveto") @@ -1595,28 +1633,25 @@ do while i <= n do local t = tab[i] if t >= 32 then + top = top + 1 if t <= 246 then -- -107 .. +107 - top = top + 1 stack[top] = t - 139 i = i + 1 elseif t <= 250 then -- +108 .. +1131 - top = top + 1 -- stack[top] = (t-247)*256 + tab[i+1] + 108 -- stack[top] = t*256 - 247*256 + tab[i+1] + 108 stack[top] = t*256 - 63124 + tab[i+1] i = i + 2 elseif t <= 254 then -- -1131 .. -108 - top = top + 1 -- stack[top] = -(t-251)*256 - tab[i+1] - 108 -- stack[top] = -t*256 + 251*256 - tab[i+1] - 108 stack[top] = -t*256 + 64148 - tab[i+1] i = i + 2 else local n = 0x100 * tab[i+1] + tab[i+2] - top = top + 1 if n >= 0x8000 then -- stack[top] = n - 0xFFFF - 1 + (0x100 * tab[i+3] + tab[i+4])/0xFFFF stack[top] = n - 0x10000 + (0x100 * tab[i+3] + tab[i+4])/0xFFFF @@ -1683,15 +1718,17 @@ do if a then local s = a(t) if s then - i = i + s + i = i + s + 1 + else + i = i + 1 end else if trace_charstrings then showvalue("<action>",t) end top = 0 + i = i + 1 end - i = i + 1 end end end @@ -1770,7 +1807,9 @@ do report("data : % t",tab) end - updateregions(vsindex) + if regions then + updateregions(vsindex) + end process(tab) |