diff options
| author | Hans Hagen <pragma@wxs.nl> | 2019-10-08 22:03:39 +0200 | 
|---|---|---|
| committer | Context Git Mirror Bot <phg@phi-gamma.net> | 2019-10-08 22:03:39 +0200 | 
| commit | 4855f5a841edc1db318818c89f30d12227f4740f (patch) | |
| tree | 7363859424627c919f54251ac62e75f12909eb06 /tex/context/base/mkiv/lpdf-lmt.lua | |
| parent | f3157085de19cbc6cee3ade6d9e4e705675196a3 (diff) | |
| download | context-4855f5a841edc1db318818c89f30d12227f4740f.tar.gz | |
2019-10-08 19:24:00
Diffstat (limited to 'tex/context/base/mkiv/lpdf-lmt.lua')
| -rw-r--r-- | tex/context/base/mkiv/lpdf-lmt.lua | 19 | 
1 files changed, 13 insertions, 6 deletions
| diff --git a/tex/context/base/mkiv/lpdf-lmt.lua b/tex/context/base/mkiv/lpdf-lmt.lua index 8b40ee15c..b46274b34 100644 --- a/tex/context/base/mkiv/lpdf-lmt.lua +++ b/tex/context/base/mkiv/lpdf-lmt.lua @@ -499,21 +499,27 @@ local flushcharacter  do          cur_tmrx = tmrx      end -    local f_hex = formatters["%04X"] +    local f_hex_4 = formatters["%04X"] +    local f_hex_2 = formatters["%02X"] -    local h_hex = setmetatableindex(function(t,k) -- we already have this somewhere +    local h_hex_4 = setmetatableindex(function(t,k) -- we already have this somewhere          if k < 256 then -- maybe 512              -- not sparse in this range              for i=0,255 do -                t[i] = f_hex(i) +                t[i] = f_hex_4(i)              end              return t[k]          else -            local v = f_hex(k) +            local v = f_hex_4(k)              t[k] = v              return v          end      end) +    local h_hex_2 = setmetatableindex(function(t,k) -- we already have this somewhere +        local v = k < 256 and f_hex_2(k) or "00" +        t[k] = v +        return v +    end)      flushcharacter = function(current,pos_h,pos_v,pos_r,font,char,data,naturalwidth,factor,width,f,e)          if need_tf or font ~= f_cur or f_pdf ~= f_pdf_cur or fs ~= fs_cur or mode == "page" then @@ -566,8 +572,9 @@ local flushcharacter  do                  cw = cw - tj_delta              end          end +          if mode == "chararray" then -            begin_charmode(font) +            begin_charmode()          end      --  cw = cw + naturalwidth @@ -575,7 +582,7 @@ local flushcharacter  do          local index = data.index or char -        b = b + 1 ; buffer[b] = h_hex[index] +        b = b + 1 ; buffer[b] = font > 0 and h_hex_4[index] or h_hex_2[index]          if not pdfcharacters[index] then              pdfcharacters[index] = true | 
