OSDN Git Service

remove trailing spaces
authorHironori Kitagawa <h_kitagawa2001@yahoo.co.jp>
Sun, 21 Aug 2022 22:34:28 +0000 (07:34 +0900)
committerHironori Kitagawa <h_kitagawa2001@yahoo.co.jp>
Sun, 21 Aug 2022 22:34:28 +0000 (07:34 +0900)
24 files changed:
src/jfm-CCT.lua
src/jfm-banjiao.lua
src/jfm-jis.lua
src/jfm-kaiming.lua
src/jfm-min.lua
src/jfm-quanjiao.lua
src/jfm-ujis.lua
src/jfm-ujisv.lua
src/ltj-adjust.lua
src/ltj-base.lua
src/ltj-charrange.lua
src/ltj-compat.lua
src/ltj-debug.lua
src/ltj-direction.lua
src/ltj-jfmglue.lua
src/ltj-jfont.lua
src/ltj-lineskip.lua
src/ltj-lotf_aux.lua
src/ltj-math.lua
src/ltj-otf.lua
src/ltj-rmlgbm.lua
src/ltj-ruby.lua
src/ltj-setwidth.lua
src/luatexja.lua

index c41f6da..5d861ba 100644 (file)
@@ -13,7 +13,7 @@ luatexja.jfont.define_jfm {
 
   [1] = { -- fw. opening punctuations
     chars = {
-      0x2018, 0x201C, 0x3008, 0x300A, 0x300C, 0x300E, 0x3010, 0x3014, 0x3016, 
+      0x2018, 0x201C, 0x3008, 0x300A, 0x300C, 0x300E, 0x3010, 0x3014, 0x3016,
       0x3018, 0x301D, 0xFF08, 0xFF3B, 0xFF5B, 0xFF5F
     },
     align = 'right', left = 0.0, down = 0.0,
@@ -25,9 +25,9 @@ luatexja.jfont.define_jfm {
 
   [2] = { -- fw. closing/colon punctuations
     chars = {
-      0x2019, 0x201D, 0x3001, 0x3009, 0x300B, 0x300D, 0x300F, 0x3011, 0x3015, 
+      0x2019, 0x201D, 0x3001, 0x3009, 0x300B, 0x300D, 0x300F, 0x3011, 0x3015,
       0x3017, 0x3019, 0x301F, 0xFF09, 0xFF0C, 0xFF3D, 0xFF5D, 0xFF60,
-      0xFF1A, 0xFF1B  
+      0xFF1A, 0xFF1B
     },
     align = 'left', left = 0.0, down = 0.0,
     width = 0.5, height = 0.88, depth = 0.12, italic=0.0,
index 783e836..b30d040 100644 (file)
@@ -13,7 +13,7 @@ luatexja.jfont.define_jfm {
 
   [1] = { -- fw. opening punctuations
     chars = {
-      0x2018, 0x201C, 0x3008, 0x300A, 0x300C, 0x300E, 0x3010, 0x3014, 0x3016, 
+      0x2018, 0x201C, 0x3008, 0x300A, 0x300C, 0x300E, 0x3010, 0x3014, 0x3016,
       0x3018, 0x301D, 0xFF08, 0xFF3B, 0xFF5B, 0xFF5F
     },
     align = 'right', left = 0.0, down = 0.0,
@@ -25,7 +25,7 @@ luatexja.jfont.define_jfm {
 
   [2] = { -- fw. closing/colon/dot punctuations, except 4 & 7
     chars = {
-      0x2019, 0x201D, 0x3009, 0x300B, 0x300D, 0x300F, 0x3011, 0x3015, 
+      0x2019, 0x201D, 0x3009, 0x300B, 0x300D, 0x300F, 0x3011, 0x3015,
       0x3017, 0x3019, 0x301F, 0xFF09, 0xFF0C, 0xFF3D, 0xFF5D, 0xFF60,
       0xFF0E, 0xFF1A, 0xFF1B, 0xFF01, 0xFF1F
     },
index 642a247..818e3ab 100644 (file)
@@ -21,7 +21,7 @@ luatexja.jfont.define_jfm {
 
    [1] = { -- 開き括弧類
       chars = {
-        '‘', '“', '〈', '《', '「', '『', '【', '〔', '〖', 
+        '‘', '“', '〈', '《', '「', '『', '【', '〔', '〖',
         '〘', '〝', '(', '[', '{', '⦅'
       },
       align = 'right', left = 0.0, down = 0.0,
@@ -33,7 +33,7 @@ luatexja.jfont.define_jfm {
 
    [2] = { -- 閉じ括弧類
       chars = {
-        '’', '”', '、', '〉', '》', '」', '』', '】', '〕', 
+        '’', '”', '、', '〉', '》', '」', '』', '】', '〕',
         '〗', '〙', '〟', ')', ',', ']', '}', '⦆'
       },
       align = 'left', left = 0.0, down = 0.0,
index 63ac222..a046488 100644 (file)
@@ -13,7 +13,7 @@ luatexja.jfont.define_jfm {
 
   [1] = { -- fw. opening punctuations
     chars = {
-      0x2018, 0x201C, 0x3008, 0x300A, 0x300C, 0x300E, 0x3010, 0x3014, 0x3016, 
+      0x2018, 0x201C, 0x3008, 0x300A, 0x300C, 0x300E, 0x3010, 0x3014, 0x3016,
       0x3018, 0x301D, 0xFF08, 0xFF3B, 0xFF5B, 0xFF5F
     },
     align = 'right', left = 0.0, down = 0.0,
@@ -25,9 +25,9 @@ luatexja.jfont.define_jfm {
 
   [2] = { -- fw. closing/colon/dot punctuations, except 4 & 7
     chars = {
-      0x2019, 0x201D, 0x3009, 0x300B, 0x300D, 0x300F, 0x3011, 0x3015, 
+      0x2019, 0x201D, 0x3009, 0x300B, 0x300D, 0x300F, 0x3011, 0x3015,
       0x3017, 0x3019, 0x301F, 0xFF09, 0xFF0C, 0xFF3D, 0xFF5D, 0xFF60,
-      0xFF0E, 0xFF1A, 0xFF1B  
+      0xFF0E, 0xFF1A, 0xFF1B
     },
     align = 'left', left = 0.0, down = 0.0,
     width = 0.5, height = 0.88, depth = 0.12, italic=0.0,
index b59b532..e07b330 100644 (file)
@@ -68,8 +68,8 @@ luatexja.jfont.define_jfm {
    [3] = {
       chars = {
         '∴', '♀', '♂', '〃', '々', 'ぁ', 'ぃ', 'ぅ', 'ぇ', 'ぉ', 'っ', 'ゃ', 'ゅ ',
-        'ょ', 'ゎ', 'ゕ', 'ゖ', 'ゞ', 'ァ', 'ィ', 'ゥ', 'ェ', 'ォ', 'ッ', 'ャ', 'ュ', 'ョ', 
-        'ヮ', 'ヵ', 'ヶ', 'ㇰ', 'ㇱ', 'ㇲ', 'ㇳ', 'ㇴ', 'ㇵ', 'ㇶ', 'ㇷ', 'ㇸ', 'ㇹ', 'ㇺ', 
+        'ょ', 'ゎ', 'ゕ', 'ゖ', 'ゞ', 'ァ', 'ィ', 'ゥ', 'ェ', 'ォ', 'ッ', 'ャ', 'ュ', 'ョ',
+        'ヮ', 'ヵ', 'ヶ', 'ㇰ', 'ㇱ', 'ㇲ', 'ㇳ', 'ㇴ', 'ㇵ', 'ㇶ', 'ㇷ', 'ㇸ', 'ㇹ', 'ㇺ',
         'ㇻ', 'ㇼ', 'ㇽ', 'ㇾ', 'ㇿ', '$', '¢', '£'
       },
       align = 'middle', left = 0.0, down = 0.0,
@@ -207,7 +207,7 @@ luatexja.jfont.define_jfm {
    },
    [12] = {
       chars = {
-        'ア', 'イ', 'ウ', 'オ', 'ケ', 'ゲ', 'サ', 'ザ', 'ソ', 'ゾ', 'チ', 'ヂ', 'ツ', 
+        'ア', 'イ', 'ウ', 'オ', 'ケ', 'ゲ', 'サ', 'ザ', 'ソ', 'ゾ', 'チ', 'ヂ', 'ツ',
         'ヅ', 'ト', 'ド', 'ナ', 'フ', 'ブ', 'プ', 'ミ', 'メ', 'ラ', 'リ', 'ワ', 'ヲ'
       },
       align = 'left', left = 0.0, down = 0.0,
index 20590b6..2718e1b 100644 (file)
@@ -13,7 +13,7 @@ luatexja.jfont.define_jfm {
 
   [1] = { -- fw. opening punctuations
     chars = {
-      0x2018, 0x201C, 0x3008, 0x300A, 0x300C, 0x300E, 0x3010, 0x3014, 0x3016, 
+      0x2018, 0x201C, 0x3008, 0x300A, 0x300C, 0x300E, 0x3010, 0x3014, 0x3016,
       0x3018, 0x301D, 0xFF08, 0xFF3B, 0xFF5B, 0xFF5F
     },
     align = 'right', left = 0.0, down = 0.0,
@@ -25,7 +25,7 @@ luatexja.jfont.define_jfm {
 
   [2] = { -- fw. closing/colon/dot punctuations, except 4 & 7
     chars = {
-      0x2019, 0x201D, 0x3009, 0x300B, 0x300D, 0x300F, 0x3011, 0x3015, 
+      0x2019, 0x201D, 0x3009, 0x300B, 0x300D, 0x300F, 0x3011, 0x3015,
       0x3017, 0x3019, 0x301F, 0xFF09, 0xFF0C, 0xFF3D, 0xFF5D, 0xFF60,
       0xFF0E, 0xFF1A, 0xFF1B, 0xFF01, 0xFF1F
     },
index 08f567d..2b94eca 100644 (file)
@@ -26,7 +26,7 @@ local t = {
         [207] = { 0, 0, 0, kanjiskip_shrink=1 },
         [8] = { 0, 0, 0, kanjiskip_shrink=1 },
       },
-      kern = { [307] = 0 },     
+      kern = { [307] = 0 },
       round_threshold = 0.01,
    },
 
@@ -250,7 +250,7 @@ local t = {
         [6] = { 0, 0, 0, kanjiskip_shrink=1 },
          [8] = { 0, 0, 0, kanjiskip_shrink=1 },
       },
-      kern = { [307] = 0 },     
+      kern = { [307] = 0 },
    },
 
    [107] = { -- 1/3 角
index 2bfe670..7e87004 100644 (file)
@@ -26,7 +26,7 @@ local t = {
         [207] = { 0, 0, 0, kanjiskip_shrink=1 },
          [8] = { 0, 0, 0, kanjiskip_shrink=1 },
       },
-      kern = { [307] = 0 },     
+      kern = { [307] = 0 },
       round_threshold = 0.01,
    },
 
index a46c17c..8d767bf 100644 (file)
@@ -20,7 +20,7 @@ local getsubtype = node.direct.getsubtype
 local getlang = node.direct.getlang
 local getkern = node.direct.getkern
 local getshift = node.direct.getshift
-local getwidth = node.direct.getwidth    
+local getwidth = node.direct.getwidth
 local getdepth = node.direct.getdepth
 local setfield = node.direct.setfield
 local setpenalty = node.direct.setpenalty
@@ -81,7 +81,7 @@ do
          for i=0,63 do tmp[#tmp+1] = { (i%8)-4, FROM_JFM+i } end
       else -- stretch
          for i=0,63 do tmp[#tmp+1] = { math.floor(i/8)-4, FROM_JFM+i } end
-      end    
+      end
       local pt = priority_table[glue_sign]
       tmp[#tmp+1] = { pt[2]/10, XKANJI_SKIP }
       tmp[#tmp+1] = { pt[2]/10, XKANJI_SKIP_JFM }
@@ -119,13 +119,13 @@ function get_total_stretched(p)
    for q in node_traverse_id(id_glue, ph) do
       local a = getfield(q, 'stretch_order')
       if a==0 then
-         local b = at2pr_st[get_attr_icflag(q)]; 
+         local b = at2pr_st[get_attr_icflag(q)];
          total_st[b] = total_st[b]+getfield(q, 'stretch')
       end
       total_st[a*65536] = total_st[a]+getfield(q, 'stretch')
       local a = getfield(q, 'shrink_order')
       if a==0 then
-         local b = at2pr_sh[get_attr_icflag(q)]; 
+         local b = at2pr_sh[get_attr_icflag(q)];
          total_sh[b] = total_sh[b]+getfield(q, 'shrink')
       end
       total_sh[a*65536] = total_sh[a]+getfield(q, 'shrink')
@@ -172,7 +172,7 @@ local function aw_step1(p, total)
    end
    local eadt = ltjf_font_metric_table[getfont(xc)]
       .char_type[get_attr(xc, attr_jchar_class) or 0].end_adjust
-   if not eadt then 
+   if not eadt then
       return total, false
    end
    local eadt_ratio = {}
@@ -184,8 +184,8 @@ local function aw_step1(p, total)
          eadt_ratio[i] = {i, t/total_sh[65536*total_sh.order], t, v}
       end
    end
-   table.sort(eadt_ratio, 
-   function (a,b) 
+   table.sort(eadt_ratio,
+   function (a,b)
        for i=2,4 do
            local at, bt = abs(a[i]), abs(b[i])
            if at~=bt then return at<bt end
@@ -240,26 +240,26 @@ local function aw_step1_last(p, total)
    end
    local eadt = ltjf_font_metric_table[getfont(xc)]
       .char_type[get_attr(xc, attr_jchar_class) or 0].end_adjust
-   if not eadt then 
+   if not eadt then
       return total, false
    end
    -- 続行条件2: min(eadt[1], 0)<= \parfillskip <= max(eadt[#eadt], 0)
    local pfw = getwidth(pf)
-     + (total>0 and getfield(pf, 'stretch') or -getfield(pf, 'shrink')) *getfield(p, 'glue_set') 
+     + (total>0 and getfield(pf, 'stretch') or -getfield(pf, 'shrink')) *getfield(p, 'glue_set')
    if pfw<min(0,eadt[1]) or max(0,eadt[#eadt])<pfw then return total, false end
    -- \parfillskip を 0 にする
    total = total + getwidth(pf)
    total_st.order, total_sh.order = 0, 0
-   if getfield(pf, 'stretch_order')==0 then 
-      local i = at2pr_st[-1] 
-      total_st[0] = total_st[0] - getfield(pf, 'stretch') 
-      total_st[i] = total_st[i] - getfield(pf, 'stretch') 
+   if getfield(pf, 'stretch_order')==0 then
+      local i = at2pr_st[-1]
+      total_st[0] = total_st[0] - getfield(pf, 'stretch')
+      total_st[i] = total_st[i] - getfield(pf, 'stretch')
       total_st.order = (total_st[0]==0) and -1 or 0
    end
-   if getfield(pf, 'shrink_order')==0 then 
-      local i = at2pr_sh[-1] 
-      total_sh[0] = total_sh[0] - getfield(pf, 'shrink') 
-      total_sh[i] = total_sh[i] - getfield(pf, 'shrink') 
+   if getfield(pf, 'shrink_order')==0 then
+      local i = at2pr_sh[-1]
+      total_sh[0] = total_sh[0] - getfield(pf, 'shrink')
+      total_sh[i] = total_sh[i] - getfield(pf, 'shrink')
       total_sh.order = (total_sh[0]==0) and -1 or 0
    end
    setsubtype(pf, 1); setglue(pf)
@@ -272,8 +272,8 @@ local function aw_step1_last(p, total)
          eadt_ratio[i] = {i, t/total_sh[65536*total_sh.order], t, v}
       end
    end
-   table.sort(eadt_ratio, 
-   function (a,b) 
+   table.sort(eadt_ratio,
+   function (a,b)
        for i=2,4 do
            local at, bt = abs(a[i]), abs(b[i])
            if at~=bt then return at<bt end
@@ -337,14 +337,14 @@ function aw_step2(p, total, added_flag)
    local id =  (total>0) and 1 or 2
    local res = total_stsh[id]
    local pnum = priority_num[id]
-   if total==0 or res.order > 0 then 
+   if total==0 or res.order > 0 then
       -- もともと伸縮の必要なしか,残りの伸縮量は無限大
       if added_flag then return repack(p) end
    end
    total = abs(total)
    for i = 1, pnum do
       if total <= res[i] then
-         local a = at2pr[id]  
+         local a = at2pr[id]
          for j = i+1,pnum do
             clear_stretch(p, j, a, name)
          end
@@ -362,7 +362,7 @@ do
    local insert_before = node.direct.insert_before
    local KINSOKU      = luatexja.icflag_table.KINSOKU
    insert_lineend_kern = function (head, nq, np, Bp)
-      if nq.met then 
+      if nq.met then
          local eadt = nq.met.char_type[nq.class].end_adjust
          if not eadt then return end
          if eadt[1]~=0 then
@@ -416,7 +416,7 @@ do
    local function enable_cb(status_le, status_pr, status_lp, status_ls)
       if (status_le>0 or status_pr>0) and (not is_reg) then
          ltjb.add_to_callback('post_linebreak_filter',
-            adjust_width, 'Adjust width', 
+            adjust_width, 'Adjust width',
             luatexbase.priority_in_callback('post_linebreak_filter', 'ltj.lineskip')-1)
          is_reg = true
       elseif is_reg and (status_le==0 and status_pr==0) then
@@ -519,9 +519,9 @@ do
       end
       w_acc = w_new; x = xn; if x then xn = node_next(x) end
     end
-  end  
+  end
   function ltjl.p_profile(before, after, mirrored, bw)
-    local range, tls 
+    local range, tls
       = init_range(), luatexja.adjust.profile_hgap_factor*tex.get('lineskip', false)
     profile_inner(before, range, 3, true,     tls)
     profile_inner(after,  range, 4, mirrored, tls)
@@ -535,7 +535,7 @@ do
         if bw-h-d<lmin then lmin=bw-h-d end
       end
       if lmin==1/0 then lmin = bw end
-      return lmin, 
+      return lmin,
          bw - lmin - getdepth(before)
             - getfield(after, mirrored and 'depth' or 'height')
     end
index ad5bb81..41caef5 100644 (file)
@@ -7,7 +7,7 @@ local node, table, tex, token = node, table, tex, token
 
 local cat_lp = luatexbase.catcodetables['latex-package']
 
--------------------- 
+--------------------
 local ltjb = {}
 luatexja.base = ltjb
 
@@ -44,7 +44,7 @@ do
   _error_set_message = function (msgcont, main, help)
     err_main = message_cont(main, msgcont):gsub(BEL, LF)
     err_help = (help and help~="") and into_lines(help)
-       or {"Sorry, I don't know how to help in this situation.", 
+       or {"Sorry, I don't know how to help in this situation.",
            "Maybe you should try asking a human?" }
   end
 
@@ -129,7 +129,7 @@ end
 --- Extension to tex.print(). Each argument string may contain
 -- newline characters, in which case the string is output (to
 -- TeX input stream) as multiple lines.
--- @param ... (string) string to output 
+-- @param ... (string) string to output
 local function mprint(...)
    local arg = {...}
    local lines = {}
@@ -202,7 +202,7 @@ do
    local function in_unicode(c, admit_math)
       local low = admit_math and -1 or 0
       if type(c)~='number' or c<low or c>0x10FFFF then
-        local s = 'A character number must be between ' .. tostring(low) 
+        local s = 'A character number must be between ' .. tostring(low)
            .. ' and 0x10ffff.\n'
            .. (admit_math and "(-1 is used for denoting `math boundary')\n" or '')
            .. 'So I changed this one to zero.'
@@ -222,7 +222,7 @@ end
 --   * return value: non-nil iff the cache is up-to-date
 -- save_cache (filename, t): no return value
 -- save_cache_luc (filename, t): no return value
---   save_cache always calls save_cache_luc. 
+--   save_cache always calls save_cache_luc.
 --   But sometimes we want to create only the precompiled cache,
 --   when its 'text' version is already present in LuaTeX-ja distribution.
 
@@ -274,8 +274,8 @@ do
       if s then
         local sa = load(s)
         local f = io.open(fullpath, 'wb')
-        if f and sa then 
-           f:write(dump(sa, true)) 
+        if f and sa then
+           f:write(dump(sa, true))
            texio.write('log', '(save cache: ' .. fullpath .. ')')
             f:close()
         end
@@ -307,17 +307,17 @@ do
            break
         end
       end
-      if (not result) or outdate(result) then 
-        return nil 
-      else 
-        return result 
+      if (not result) or outdate(result) then
+        return nil
+      else
+        return result
       end
    end
-   
+
    local function load_cache(filename, outdate)
       remove_file_if_exist(savepath .. '/' ..  filename .. '.lua')
       local r = load_cache_a(filename ..  luc_suffix, outdate, false)
-      if r then 
+      if r then
         return r
       else
          local r = load_cache_a(filename .. '.lua.gz', outdate, true)
index 3ae4f51..074ba3c 100644 (file)
@@ -28,14 +28,14 @@ do
    for i = 0, 30 do
       local pw = 2^i; kcat_attr_table[i], pow_table[i] = ka, pw
       fn_table[i] = function(p) return get_attr(p, ka)&pw==0 end
-      nfn_table[i] = function(p) return get_attr_node(p, ka)&pw==0 end 
+      nfn_table[i] = function(p) return get_attr_node(p, ka)&pw==0 end
    end
 end
 for i = 31, 31*ATTR_RANGE-1 do
    local ka, pw = luatexbase.attributes['ltj@kcat'..floor(i/31)], 2^(i%31)
    kcat_attr_table[i], pow_table[i] = ka, pw
    fn_table[i] = function(p) return (get_attr(p, ka) or 0)&pw==0 end
-   nfn_table[i] = function(p) return (get_attr_node(p, ka) or 0)&pw==0 end 
+   nfn_table[i] = function(p) return (get_attr_node(p, ka) or 0)&pw==0 end
 end
 fn_table[-1] = function() return false end -- for char --U+007F
 nfn_table[-1] = function() return false end -- for char --U+007F
index dfb19ee..c1ca005 100644 (file)
@@ -51,14 +51,14 @@ local function from_kuten(i)
    if type(i)~='number' then error_invalid_charcode(i); i=0 end
    if (i%256==0)or(i%256>94) then
      tex.write '0'
-   else 
+   else
      tex.write(tostring(jisx0208.table_jisx0208_uptex[math.floor(i/256)*94+(i%256)-94] or 0))
    end
 end
 
 -- \euc: EUC-JP による符号位置 => Unicode 符号位置
 local function from_euc(i)
-   if type(i)~='number' then 
+   if type(i)~='number' then
      error_invalid_charcode(i); i=0
    elseif i>=0x10000 or i<0xa0a0 then
       i=0
index c337c01..b9ebcae 100644 (file)
@@ -79,7 +79,7 @@ end
 local function pformat(fmt, ...)
   if type(fmt) == "string" then
     return do_pformat(fmt, ...)
-  else 
+  else
     return tosource(fmt)
   end
 end
@@ -121,10 +121,10 @@ do
       luatexja.base.start_time_measure = start_time_measure
       luatexja.base.stop_time_measure = stop_time_measure
       luatexbase.add_to_callback('stop_run', print_measure, 'luatexja.time_measure', 1)
-      luatexbase.add_to_callback('pre_linebreak_filter', 
-                                function(p) 
-                                   start_time_measure('tex_linebreak'); return p 
-                                end, 
+      luatexbase.add_to_callback('pre_linebreak_filter',
+                                function(p)
+                                   start_time_measure('tex_linebreak'); return p
+                                end,
                                 'measure_tex_linebreak', 20000)
    end
 end
index f0c67f5..2fa74d6 100644 (file)
@@ -71,7 +71,7 @@ do
    dir_pool = {}
    for _,i in pairs({dir_tate, dir_yoko, dir_dtou, dir_utod}) do
       local w = node_new(id_whatsit, sid_user)
-      dnode.setattributelist(w, nil) 
+      dnode.setattributelist(w, nil)
       set_attr(w, attr_dir, i); set_attr(w, attr_icflag, 0)
       setfield(w, 'user_id', DIR)
       setfield(w, 'type', 110); setnext(w, nil)
@@ -932,7 +932,7 @@ end
 -- adjust
 do
    local id_adjust = node.id 'adjust'
-   local last_node = dnode.last_node 
+   local last_node = dnode.last_node
    local scan_keyword = token.scan_keyword
    function luatexja.direction.adjust_begin()
       if scan_keyword 'pre' then tex.sprint(cat_lp, '\\ltj@@vadjust@pre')
@@ -1000,7 +1000,7 @@ do
       if split_dir_whatsit then split_dir_watsit = nil end
       if p then
          local bh = getlist(p)
-         if getid(bh)==id_whatsit and getsubtype(bh)==sid_user and getfield(bh, 'user_id')==DIR 
+         if getid(bh)==id_whatsit and getsubtype(bh)==sid_user and getfield(bh, 'user_id')==DIR
             and node_next(bh) then
             ltjs.list_dir = get_attr(bh, attr_dir)
             setlist(p, (node_remove(bh,bh)))
@@ -1015,7 +1015,7 @@ do
          end
       end
       sprint(cat_lp, '\\ltj@@orig@vsplit' .. tostring(n))
-   end        
+   end
    local function dir_adjust_vpack(h, gc)
       start_time_measure 'direction_vpack'
       local hd = to_direct(h)
@@ -1057,7 +1057,7 @@ do
    local function dir_adjust_pre_output(h, gc)
       return to_node(create_dir_whatsit_vbox(to_direct(h), gc))
    end
-   ltjb.add_to_callback('pre_output_filter', dir_adjust_pre_output, 
+   ltjb.add_to_callback('pre_output_filter', dir_adjust_pre_output,
                         'ltj.direction', 10000)
 end
 
@@ -1093,7 +1093,7 @@ do
 
    tex.setattribute(attr_dir, dir_yoko)
    local shipout_temp =  node_new(id_hlist)
-   dnode.setattributelist(shipout_temp, nil) 
+   dnode.setattributelist(shipout_temp, nil)
    tex.setattribute(attr_dir, 0)
 
    finalize_inner = function (box)
index bd6151a..515e823 100644 (file)
@@ -42,7 +42,7 @@ do
 end
 local setpenalty = node.direct.setpenalty
 local setkern = node.direct.setkern
-  
+
 local get_attr = node.direct.get_attribute
 local set_attr = node.direct.set_attribute
 local insert_before = node.direct.insert_before
@@ -268,13 +268,13 @@ luatexbase.create_callback("luatexja.jfmglue.whatsit_last_minute", "data",
                            function (stat, Nq, Np) return false end)
 
 -- calc next Np
-local calc_np 
+local calc_np
 do -- 001 -----------------------------------------------
 
 local traverse = node.direct.traverse
 local function check_next_ickern(lp)
    local lx = Np.nuc
-   while lp and getid(lp) == id_kern and ( getsubtype(lp)==0 or 
+   while lp and getid(lp) == id_kern and ( getsubtype(lp)==0 or
      getsubtype(lp)==3 or ITALIC == get_attr_icflag(lp)) do
      set_attr(lp, attr_icflag, IC_PROCESSED)
      lx, lp = lp, node_next(lp)
@@ -320,7 +320,7 @@ do -- 002 ---------------------------------------
    local function calc_np_notdef(lp)
       if not font_getfont(getfont(lp)).characters[getchar(lp)] then
          local ln = node_next(lp)
-         if ltju.specified_feature(getfont(lp), 'notdef') and ln and getid(ln)==id_glyph then 
+         if ltju.specified_feature(getfont(lp), 'notdef') and ln and getid(ln)==id_glyph then
             set_attr(lp, attr_icflag, PROCESSED)
             set_attr(ln, attr_jchar_code, get_attr(lp, attr_jchar_code) or getchar(lp))
             set_attr(ln, attr_jchar_class, get_attr(lp, attr_jchar_class) or 0)
@@ -328,7 +328,7 @@ do -- 002 ---------------------------------------
          end
       end
       return lp
-   end 
+   end
 function calc_np_aux_glyph_common(lp, acc_flag)
    Np.nuc, Np.first = lp, (Np.first or lp)
    if if_lang_ja(lp) then -- JAchar
@@ -506,7 +506,7 @@ calc_np_auxtable = {
    end,
    [id_glue] = function(lp)
       Np.first, Np.nuc, Np.last = (Np.first or lp), lp, lp;
-      Np.id = getid(lp); 
+      Np.id = getid(lp);
       local f = luatexbase.call_callback("luatexja.jfmglue.special_jaglue", lp)
       if f then
          set_attr(lp, attr_icflag, PROCESSED)
@@ -565,7 +565,7 @@ function calc_np(last, lp)
    Np.post, Np.pre, Np.xspc, Np.gk = nil, nil, nil, nil
    Np.first, Np.id, Np.last, Np.met, Np.class= nil, nil, nil, nil
    Np.auto_kspc, Np.auto_xspc, Np.char, Np.nuc = nil, nil, nil, nil
-   -- auto_kspc, auto_xspc: normally true/false, 
+   -- auto_kspc, auto_xspc: normally true/false,
    -- but the number 0 when Np is ''the beginning of the box/paragraph''.
    for k in pairs(Np) do Np[k] = nil end
 
@@ -623,7 +623,7 @@ do
       Nx.post = table_current_stack[POST + c] or 0
       Nx.xspc = table_current_stack[XSP  + c] or 3
       Nx.kcat = table_current_stack[KCAT + c] or 0
-      Nx.auto_kspc, Nx.auto_xspc 
+      Nx.auto_kspc, Nx.auto_xspc
        = not has_attr(x, attr_autospc, 0), not has_attr(x, attr_autoxspc, 0)
       return m, mc, cls
    end
@@ -729,7 +729,7 @@ local function handle_penalty_suppress(post, pre, g)
          setpenalty(p, 10000); head = insert_before(head, Np.first, p)
          Bp[1]=p; set_attr(p, attr_icflag, KINSOKU)
       end
-   else 
+   else
       local a = (pre or 0) + (post or 0)
       for _, v in pairs(Bp) do add_penalty(v,a) end
    end
@@ -754,7 +754,7 @@ local function new_jfm_glue(mc, bc, ac)
    local g = mc[bc][ac]
    if g then
        if g[1] then
-          local k = node_new(id_kern, 1); setkern(k, g[1]) 
+          local k = node_new(id_kern, 1); setkern(k, g[1])
           set_attr(k, attr_icflag, FROM_JFM)
           return k, g.ratio, false, false, false
        else
@@ -857,8 +857,8 @@ do
          if kanjiskip_jfm_flag then
             local g = node_new(id_glue);
             local bk = qm.kanjiskip or null_skip_table
-            setglue(g, bn and (bn*bk[1]) or 0, 
-                       bp and (bp*bk[2]) or 0, 
+            setglue(g, bn and (bn*bk[1]) or 0,
+                       bp and (bp*bk[2]) or 0,
                        bh and (bh*bk[3]) or 0, 0, 0)
             set_attr(g, attr_icflag, KANJI_SKIP_JFM)
             return g
@@ -868,7 +868,7 @@ do
             local sh = bh and (bh*getfield(kanji_skip, 'shrink')) or 0
             setglue(g,
                bn and (bn*getwidth(kanji_skip)) or 0,
-               st, sh, 
+               st, sh,
                (st==0) and 0 or getfield(kanji_skip, 'stretch_order'),
                (sh==0) and 0 or getfield(kanji_skip, 'shrink_order'))
             set_attr(g, attr_icflag, KANJI_SKIP_JFM)
@@ -876,9 +876,9 @@ do
          end
       end
    end
-   
+
    get_kanjiskip = function()
-      if Np.auto_kspc==0 or Nq.auto_kspc==0 then return nil 
+      if Np.auto_kspc==0 or Nq.auto_kspc==0 then return nil
       elseif Np.auto_kspc or Nq.auto_kspc then
          local pm, qm = Np.met, Nq.met
          if (pm.char_type==qm.char_type) and (qm.var==pm.var) then
@@ -886,15 +886,15 @@ do
          else
             local gb = get_kanjiskip_low(false, qm, 1, 1, 1)
             if gb then
-               return calc_ja_ja_aux(gb, 
-                 get_kanjiskip_low(false, pm, 1, 1, 1) or node_copy(kanji_skip), 0, 1) 
+               return calc_ja_ja_aux(gb,
+                 get_kanjiskip_low(false, pm, 1, 1, 1) or node_copy(kanji_skip), 0, 1)
             else
                local ga = get_kanjiskip_low(false, pm, 1, 1, 1)
                return (ga and calc_ja_ja_aux(node_copy(kanji_skip), ga, 0, 1))
                  or node_copy(kanji_skip)
             end
          end
-      else   
+      else
          local g = node_new(id_glue)
          set_attr(g, attr_icflag, kanjiskip_jfm_flag and KANJI_SKIP_JFM or KANJI_SKIP)
          return g
@@ -909,11 +909,11 @@ do
          return g, (Np.auto_kspc or Nq.auto_kspc) and get_kanjiskip_low(true, qm, kn, kp, kh)
       else
          local npn, nqn = Np.nuc, Nq.nuc
-         local gb, db, bn, bp, bh 
+         local gb, db, bn, bp, bh
             = new_jfm_glue(qmc, Nq.class,
                            slow_find_char_class(Np.char,
                                                 qm, getchar(npn)))
-         local ga, da, an, ap, ah 
+         local ga, da, an, ap, ah
             = new_jfm_glue(pmc,
                            slow_find_char_class(Nq.char,
                                                 pm, getchar(nqn)),
@@ -952,7 +952,7 @@ do
             return node_copy(xkanji_skip)
          else
             local g = node_new(id_glue)
-            local w, st, sh, sto, sho = getglue(xkanji_skip) 
+            local w, st, sh, sto, sho = getglue(xkanji_skip)
             setglue(g,
                bn and (bn*w) or 0,
                bp and (bp*st) or 0,
@@ -964,10 +964,10 @@ do
          end
       end
    end
-   
+
    get_xkanjiskip = function(Nn)
       if Np.auto_xspc==0 or Nq.auto_xspc==0 then
-        return nil 
+        return nil
       elseif (Nq.xspc>=2) and (Np.xspc%2==1) and (Nq.auto_xspc or Np.auto_xspc) then
          return get_xkanjiskip_low(true, Nn.met, 1, 1, 1)
       else
@@ -1009,7 +1009,7 @@ local function get_OA_skip(insert_ksp)
    local g, _, kn, kp, kh = new_jfm_glue(
       pm.char_type,
       fast_find_char_class(
-        (((Nq.id==id_glue)or(Nq.id==id_kern)) and 'glue' or 'jcharbdd'), pm), 
+        (((Nq.id==id_glue)or(Nq.id==id_kern)) and 'glue' or 'jcharbdd'), pm),
       Np.class)
    local k
    if insert_ksp then
@@ -1037,7 +1037,7 @@ local function handle_np_jachar(mode)
       local g, k
       if non_ihb_flag then g, k = calc_ja_ja_glue() end -- M->K
       if not g then g = get_kanjiskip() end
-      handle_penalty_normal(Nq.post, Np.pre, g); 
+      handle_penalty_normal(Nq.post, Np.pre, g);
       real_insert(g); real_insert(k)
    elseif Nq.met then  -- qid==id_hlist
       local g, k
@@ -1047,7 +1047,7 @@ local function handle_np_jachar(mode)
    elseif Nq.pre then
       local g, k; if non_ihb_flag then g, k = get_NA_skip() end -- N_A->X
       if not g then g = get_xkanjiskip(Np) end
-      handle_penalty_normal((qid==id_hlist and 0 or Nq.post), Np.pre, g); 
+      handle_penalty_normal((qid==id_hlist and 0 or Nq.post), Np.pre, g);
       real_insert(g); real_insert(k)
    else
       local g = non_ihb_flag and (get_OA_skip()) -- O_A
@@ -1112,7 +1112,7 @@ do
       [id_hlist] = function() after_hlist(Nq) end,
       [id_pbox]  = function() after_hlist(Nq) end,
       [id_disc]  = function() after_hlist(Nq) end,
-      [id_glue]  = function() 
+      [id_glue]  = function()
                       luatexbase.call_callback("luatexja.jfmglue.special_jaglue_after", Nq.nuc)
                    end,
       [id_pbox_w]= function()
@@ -1140,7 +1140,7 @@ local function handle_list_tail(mode, last)
       -- Insert \jcharwidowpenalty
       if widow_Np.first then handle_penalty_jwp() end
    else
-      Np = Nq          
+      Np = Nq
       -- the current list is the contents of a hbox
       local npi, pm = Np.id, Np.met
       if npi == id_jglyph or (npi==id_pbox and pm) then
@@ -1188,7 +1188,7 @@ do
       {}, {}, {first=nil},
       { auto_kspc=nil, auto_xspc=nil, char=nil, class=nil,
         first=nil, id=nil, last=nil, met=nil, nuc=nil,
-        post=nil, pre=nil, xspc=nil, gk=nil }, 
+        post=nil, pre=nil, xspc=nil, gk=nil },
       { auto_kspc=nil, auto_xspc=nil, char=nil, class=nil,
         first=nil, id=nil, last=nil, met=nil, nuc=nil,
         post=nil, pre=nil, xspc=nil, gk=nil },
@@ -1204,8 +1204,8 @@ do
       local is_dir_tate = list_dir==dir_tate
       capsule_glyph = is_dir_tate and ltjw.capsule_glyph_tate or ltjw.capsule_glyph_yoko
       attr_ablshift = is_dir_tate and attr_tablshift or attr_yablshift
-      local TEMP = node_new(id_glue) 
-      -- TEMP is a dummy node, which will be freed at the end of the callback. 
+      local TEMP = node_new(id_glue)
+      -- TEMP is a dummy node, which will be freed at the end of the callback.
       -- Without this node, set_attr(kanji_skip, ...) somehow creates an "orphaned"  attribute list.
       do
           kanji_skip, kanjiskip_jfm_flag = skip_table_to_glue(KSK)
@@ -1219,7 +1219,7 @@ do
          -- the current list is to be line-breaked:
          -- hbox from \parindent is skipped.
          local lp, par_indented, lpi, lps  = head, 'boxbdd', getid(head), getsubtype(head)
-         while lp and 
+         while lp and
             ((lpi==id_whatsit and lps~=sid_user)
                or ((lpi==id_hlist) and (lps==3))
                or (lpi==id_local)) do
@@ -1247,7 +1247,7 @@ function luatexja.jfmglue.main(ahead, mode, dir)
    lp = calc_np(last, lp)
    if Np then
       handle_list_head(par_indented)
-      lp = calc_np(last,lp); 
+      lp = calc_np(last,lp);
       while Np do
          adjust_nq();
          local pid, pm = Np.id, Np.met
@@ -1267,14 +1267,14 @@ function luatexja.jfmglue.main(ahead, mode, dir)
    end
    -- adjust attr_icflag for avoiding error
    if tex_getattr(attr_icflag)~=0 then ensure_tex_attr(attr_icflag, 0) end
-   node_free(kanji_skip); 
+   node_free(kanji_skip);
    node_free(xkanji_skip); node_free(TEMP)
    return head
 end
 end
 
 do
-   local IHB  = luatexja.userid_table.IHB 
+   local IHB  = luatexja.userid_table.IHB
    local BPAR = luatexja.userid_table.BPAR
    local BOXB = luatexja.userid_table.BOXB
    local node_prev = node.direct.getprev
@@ -1327,7 +1327,7 @@ do
             end
             Np.met = Nq.met; Np.pre = 0; Np.post = 0; Np.xspc = 0
             Np.auto_xspc, Np.auto_kspc = 0, 0
-         end         
+         end
          return Np
       else
          return Np
@@ -1388,7 +1388,7 @@ do
        local attr_curjfnt = luatexbase.attributes['ltj@curjfnt']
        local attr_curtfnt = luatexbase.attributes['ltj@curtfnt']
        local dir_tate = luatexja.dir_table.dir_tate
-       local get_dir_count = ltjd.get_dir_count        
+       local get_dir_count = ltjd.get_dir_count
        function get_current_jfont()
            return tex_getattr((get_dir_count()==dir_tate) and attr_curtfnt or attr_curjfnt)
        end
@@ -1415,7 +1415,7 @@ do
            set_attr(g, attr_yablshift, ica)
        else
            set_attr(g, attr_yablshift, PROCESSED_BEGIN_FLAG + ica)
-           set_attr(g, attr_tablshift, get_current_jfont())               
+           set_attr(g, attr_tablshift, get_current_jfont())
        end
        node_write(g)
    end
@@ -1450,10 +1450,10 @@ do
            if lxi>=PROCESSED_BEGIN_FLAG then
                lxi = lxi%PROCESSED_BEGIN_FLAG
                if lxi == KANJI_SKIP then
-                   special_jaglue_after_inner(lx, lxi, KANJI_SKIP_JFM, kanji_skip, 
+                   special_jaglue_after_inner(lx, lxi, KANJI_SKIP_JFM, kanji_skip,
                      ltjf_font_metric_table[get_attr(lx, attr_tablshift)].kanjiskip or null_skip_table)
                else --  lxi == XKANJI_SKIP
-                   special_jaglue_after_inner(lx, lxi, XKANJI_SKIP_JFM, xkanji_skip, 
+                   special_jaglue_after_inner(lx, lxi, XKANJI_SKIP_JFM, xkanji_skip,
                      ltjf_font_metric_table[get_attr(lx, attr_tablshift)].xkanjiskip or null_skip_table)
                end
            else
index a4eb427..28e21dd 100644 (file)
@@ -119,18 +119,18 @@ function luatexja.jfont.define_jfm(to)
                   v.end_adjust = nil
                elseif #(v.end_adjust)==0 then
                   v.end_adjust = nil
-               else 
+               else
                   table.sort(v.end_adjust)
                end
             end
          else
             v.end_adjust = nil
-            if v.end_stretch and v.end_stretch~=0.0 then 
-               v.end_adjust = (v.end_adjust or {}) 
+            if v.end_stretch and v.end_stretch~=0.0 then
+               v.end_adjust = (v.end_adjust or {})
                v.end_adjust[#(v.end_adjust)+1] = v.end_stretch
             end
-            if v.end_shrink and v.end_ahrink~=0.0 then 
-               v.end_adjust = (v.end_adjust or {}) 
+            if v.end_shrink and v.end_ahrink~=0.0 then
+               v.end_adjust = (v.end_adjust or {})
                v.end_adjust[#(v.end_adjust)+1] = -v.end_shrink
             end
             if v.end_adjust then v.end_adjust[#(v.end_adjust)+1] = 0.0 end
@@ -149,8 +149,8 @@ function luatexja.jfont.define_jfm(to)
                elseif xp and type(xp)~='number' then
                   defjfm_res = nil
                else
-                  xp = (xp or 0)*9+36        
-                  if xp<0 or xp>=64 then defjfm_res=nil end 
+                  xp = (xp or 0)*9+36
+                  if xp<0 or xp>=64 then defjfm_res=nil end
                end
                x.priority = xp
             end
@@ -170,8 +170,8 @@ function luatexja.jfont.define_jfm(to)
       end
    end
    if t.version<3 then
-      -- In version 3, 'jcharbdd' is divided into 
-      -- 'alchar': ALchar (or math boundary) 
+      -- In version 3, 'jcharbdd' is divided into
+      -- 'alchar': ALchar (or math boundary)
       -- 'nox_alchar': ALchar (or math boundary), where xkanjiskip won't inserted
       -- 'glue': glue/kern, 'jcharbdd': other cases (和文B, rule, ...)
       t.chars.alchar = t.chars.jcharbdd
@@ -333,7 +333,7 @@ do
       }
       if auto_enable_vrt2 then
          local vert_name = ltju.exist_feature(fn, 'vrt2') and 'vrt2' or 'vert'
-         local rot = fmtable.rotation 
+         local rot = fmtable.rotation
          ltju.enable_feature(fn, vert_name)
          ltju.loop_over_feat(f, {[vert_name]=true}, function (i,k) rot[i] = nil end)
       end
@@ -357,7 +357,7 @@ do
                 to_be_checked[i]=nil
                 if ltj_cb<lotf_cb then
                     local f = ltb.remove_from_callback(n,'luaotfload.letterspace')
-                    ltb.add_to_callback(n, f, 'luaotfload.letterspace', 
+                    ltb.add_to_callback(n, f, 'luaotfload.letterspace',
                         ltb.priority_in_callback(n, 'luaotfload.node_processor') + 1)
                 end
             end
@@ -420,7 +420,7 @@ do
    local parser=luaotfload.parsers.font_request
    function is_feature_specified(s,fname)
      local t = lpegmatch(parser,s); return t and t.features and t.features[fname]
-   end    
+   end
    -- extract jfm_name, jfm_spec and jfm_var
    -- normalize position of 'jfm=' and 'jfmvar=' keys
    local function extract_jfm_spec(name)
@@ -453,7 +453,7 @@ do
       jfm_ksp = (is_feature_specified(name,'ltjksp')~=false)
       if jfm_dir == 'tate' then
          vert_activated = (is_feature_specified(name,'vert')~=false) and (is_feature_specified(name,'vrt2')~=false)
-         auto_enable_vrt2 
+         auto_enable_vrt2
            = (is_feature_specified(name,'vert')==nil) and (is_feature_specified(name,'vrt2')==nil)
       else
          vert_activated, auto_enable_vrt2 = nil, nil
@@ -789,7 +789,7 @@ do
     local lo, hi = 1, #t
     while lo < hi do
       local mi = ceil((lo+hi)/2)
-      if t[mi]<=i then lo=mi else hi=mi-1 end 
+      if t[mi]<=i then lo=mi else hi=mi-1 end
     end
     return lo%2==1
   end
@@ -836,14 +836,14 @@ do
       local bname = tfmdata.psname or nameonly(tfmdata.filename)
       if not font_extra_basename[bname] then
          -- if the cache is present, read it
-         -- 
+         --
          local newtime = file_attributes(tfmdata.filename,"modification")
          local v = "extra_" .. string.lower(bname)
          local dest = load_cache(
             v,
-            function (t) 
+            function (t)
                 return (t.lotf_version~=luaotfload.version)
-                       or (t.version~=cache_ver) or (t.modtime~=newtime) 
+                       or (t.version~=cache_ver) or (t.modtime~=newtime)
             end
          )
          -- if the cache is not found or outdated, save the cache
@@ -877,7 +877,7 @@ do
            dummytable.vorigin, dummytable.vheight = dtvo, dtvh
        end
    end
-   
+
    local function prepare_extra_data_font(id, res, name)
       if type(res)=='table' and (res.psname or res.filename) then
          if (res.embedding=='no') and (type(name)=='string') and (name:sub(1,5)=='psft:') then
@@ -930,19 +930,19 @@ do
      [0x3014]=0xFE39, [0x3015]=0xFE3A, [0x3010]=0xFE3B, [0x3011]=0xFE3C,
      [0x300A]=0xFE3D, [0x300B]=0xFE3E, [0x3008]=0xFE3F, [0x3009]=0xFE40,
      [0x300C]=0xFE41, [0x300D]=0xFE42, [0x300E]=0xFE43, [0x300F]=0xFE44,
-     [0xFF3B]=0xFE47, [0xFF3D]=0xFE48, 
+     [0xFF3B]=0xFE47, [0xFF3D]=0xFE48,
   }
   local vert_jpotf_table, vert_feat = {}, {vert=true}
   local utfbyte, utfsub = utf.byte, utf.sub
   luatexja.jfont.register_vert_replace = function(t)
     for i,v in pairs(t) do
-      local ic = (type(i)=='number') and i or 
+      local ic = (type(i)=='number') and i or
         ((type(i)=='string') and utfbyte(utfsub(i,1,1)) or nil)
       if ic then
-        vert_jpotf_table[ic] = (type(v)=='number') and v or 
+        vert_jpotf_table[ic] = (type(v)=='number') and v or
           ((type(v)=='string') and utfbyte(utfsub(v,1,1)) or nil)
       end
-    end  
+    end
   end
 
 luatexbase.add_to_callback(
index 010e4df..7e1be4f 100644 (file)
@@ -61,7 +61,7 @@ local function adjust_glue(nh)
         local p, n = node_prev(x), node_next(x)
         if p then
         local pid = getid(p)
-           while (id_glue<=pid) and (pid<=id_penalty) and node_prev(p) do 
+           while (id_glue<=pid) and (pid<=id_penalty) and node_prev(p) do
              p = node_prev(p); pid = getid(p)
            end
            if pid==id_hlist and getid(n)==id_hlist then
@@ -87,7 +87,7 @@ local getnest = tex.getnest
 
 local function dir_adjust_append_vlist(b, loc, prev, mirrored)
    local old_b = to_direct(b)
-   local new_b = loc=='box' and 
+   local new_b = loc=='box' and
       make_dir_whatsit(old_b, old_b, get_dir_count(), 'append_vlist') or old_b
    local _, ht, dp = getwhd(new_b)
    if prev > -65536000 then
@@ -102,7 +102,7 @@ local function dir_adjust_append_vlist(b, loc, prev, mirrored)
       end
       if tail then
          if getid(tail)==id_hlist and getid(new_b)==id_hlist then
-            if getdepth(tail)==prev then 
+            if getdepth(tail)==prev then
                lmin, adj = ltj_profiler(tail, new_b, mirrored, bw)
             end
          end
index bd3a602..cc2c613 100644 (file)
@@ -18,7 +18,7 @@ function aux.exist_feature(id, name)
     return provides_feature(id, t.properties.script, t.properties.language, name)
   else return false
   end
-end 
+end
 
 function aux.enable_feature(id, name)
   local t = getfont(id)
@@ -57,7 +57,7 @@ local function get_asc_des(id)
   elseif t.hb then -- HARF
     local hbfont, u = t.hb.shared.font, t.hb.shared.upem
     local h = hbfont:get_h_extents()
-    if h and u then 
+    if h and u then
        a, d = h.ascender and h.ascender/u, h.descender and -h.descender/u
     end
   end
@@ -87,7 +87,7 @@ local function get_vmet_table(tfmdata, dest)
    end
    local rawdata = tfmdata.shared.rawdata
    local ascender = rawdata.metadata.ascender or 0
-   local default_vheight 
+   local default_vheight
      = rawdata.metadata.defaultvheight
        or (rawdata.metadata.descender and (ascender+rawdata.metadata.descender) or units)
    local units = tfmdata.units
@@ -135,10 +135,10 @@ local function loop_over_feat(id, feature_name, func, universal)
     for _,i in pairs(t.resources.sequences) do
       if i.order[1] and feature_name[i.order[1]] then
         local f = i.features and i.features[i.order[1]]
-        if i.type == 'gsub_single' and i.steps 
+        if i.type == 'gsub_single' and i.steps
           and f and (universal or (f[t.properties.script] and f[t.properties.script][t.properties.language])) then
           for _,j in pairs(i.steps) do
-            if type(j)=='table' then 
+            if type(j)=='table' then
               if type(j.coverage)=='table' then
                 for i,k in pairs(j.coverage) do
                   local s = func(i,k); if s then return s end
@@ -155,14 +155,14 @@ aux.loop_over_feat = loop_over_feat
 
 local vert_vrt2 = { vert=true, vrt2=true }
 function aux.replace_vert_variant(id, c)
-  return loop_over_feat(id, vert_vrt2, 
+  return loop_over_feat(id, vert_vrt2,
            function (i,k) if i==c then return k end end)
         or c
 end
 
 
 --for name, func in pairs(aux) do
---  if type(func)=="function" then 
+--  if type(func)=="function" then
 --    aux[name] = function(...)
 --      print('LOTF_AUX', name, ...);
 --      local a = func(...); print('RESULT', a); return a
@@ -174,8 +174,8 @@ local search
 search = function (t, key, prefix)
   if type(t)=="table" then
     prefix = prefix or ''
-    for i,v in pairs(t) do 
-      if i==key then print(prefix..'.'..i, v) 
+    for i,v in pairs(t) do
+      if i==key then print(prefix..'.'..i, v)
       else  search(v,key,prefix..'.'..tostring(i)) end
     end
   end
index 0ada03a..bb3e414 100644 (file)
@@ -74,7 +74,7 @@ local list_dir
 -- vcenter noad は軸に揃えるため,欧文ベースライン補正がかかる
 local function conv_vcenter(sb)
    local h = getlist(sb) ; local hd = getlist(h)
-   if getid(hd)==id_whatsit and getsubtype(hd)==sid_user 
+   if getid(hd)==id_whatsit and getsubtype(hd)==sid_user
       and getfield(hd, 'user_id')==DIR then
       local d = node_next(hd)
       if getid(d)==id_vlist and get_attr(d, attr_dir)>=dir_node_auto then
index 707dcf5..5232349 100644 (file)
@@ -85,7 +85,7 @@ local function get_ucs_from_rmlgbm(c)
    elseif v<0xF0000 then -- 素直に Unicode にマップ可能
       return v
    else -- privete use area
-      local r, aj = nil, ltjr_cidfont_data["Adobe-Japan1"] 
+      local r, aj = nil, ltjr_cidfont_data["Adobe-Japan1"]
       -- 先に ltj_vert_table を見る
       for i,w in pairs(aj.ltj_vert_table) do
          if w==v then r=i; break end
index 49f2018..7145ec1 100644 (file)
@@ -234,7 +234,7 @@ do
          local fontdata = font_getfont(fnum)
          if head and luatexja.jfont.font_metric_table[fnum] and luatexja.jfont.font_metric_table[fnum].vert_activated then
             local vt = fontdata.ltj_vert_table
-            local nh = is_node(head) and to_direct(head) or head 
+            local nh = is_node(head) and to_direct(head) or head
             for n in traverse_id(id_glyph, head) do
                if getfont(n)==fnum then
                  local c = getchar(n); setchar(n, vt[c] or c)
index 86117fe..e580db1 100644 (file)
@@ -140,7 +140,7 @@ function luatexja.ruby.read_old_break_info()
       local real_file = kpse.find_file(fname)
       if real_file then dofile(real_file) end
       cache_handle = io.open(fname, 'w')
-      if cache_handle then 
+      if cache_handle then
          cache_handle:write('local lrob=luatexja.ruby.old_break_info\n')
       end
    end
@@ -708,7 +708,7 @@ luatexbase.add_to_callback('hpack_filter', post_high_hbox, 'ltj.ruby.post_hbox',
 do
    local RIPRE  = luatexja.stack_table_index.RIPRE
    local RIPOST = luatexja.stack_table_index.RIPOST
-   local abs = math.abs 
+   local abs = math.abs
    local function whatsit_callback(Np, lp, Nq)
       if Np.nuc then return Np
       elseif  getfield(lp, 'user_id') == RUBY_PRE then
@@ -782,7 +782,7 @@ do
          end
          local nqnv = getfield(Nq.nuc, 'value')
          local rst = getfield(nqnv, 'value')
-         if Nq.gk then 
+         if Nq.gk then
             if type(Nq.gk)=="table" then
                for _,v in ipairs(Nq.gk) do add_gk(rst, 'before_jfmgk', v) end
             else add_gk(rst, 'before_jfmgk', Nq.gk) end
@@ -819,7 +819,7 @@ do
    local function w (s, Nq, Np)
       if not s and  getfield(Nq.nuc, 'user_id') == RUBY_PRE then
          local rst = getfield(getfield(Nq.nuc, 'value'), 'value')
-         if Np.gk then 
+         if Np.gk then
             if type(Np.gk)=="table" then
                for _,v in ipairs(Np.gk) do add_gk(rst, 'after_jfmgk', v) end
             else add_gk(rst, 'after_jfmgk', Np.gk) end
index ad01a90..bc48fd8 100644 (file)
@@ -193,7 +193,7 @@ local function capsule_glyph_tate(p, met, char_data, head, dir)
           local f = font_getfont(pf)
           local r, l = met.rotation[pc], f.properties and f.properties.language
           if ((r==true) or (type(r)=="table" and not r[l])) and (get_attr(p, attr_vert_ori) or 0)<=0 then
-            return capsule_glyph_tate_rot(p, met, char_data, head, dir, 
+            return capsule_glyph_tate_rot(p, met, char_data, head, dir,
               0.5*(get_ascender(pf)-get_descender(pf)))
           end
       end
@@ -270,7 +270,7 @@ function luatexja.setwidth.apply_ashift_math(head, last, attr_ablshift)
          return
       elseif (get_attr(p, attr_icflag) or 0) ~= PROCESSED then
          if pid==id_hlist or pid==id_vlist then
-            setshift(p, getshift(p) +  (get_attr(p,attr_ablshift) or 0)) 
+            setshift(p, getshift(p) +  (get_attr(p,attr_ablshift) or 0))
          elseif pid==id_rule then
             local v = get_attr(p,attr_ablshift) or 0
             setheight(p, getheight(p)-v); setdepth(p, getdepth(p)+v)
index eb4fdf5..3547090 100644 (file)
@@ -48,9 +48,9 @@ do
       setfield(g,'stretch_order',sto or 0)
       setfield(g,'shrink_order', sho or 0)
    end
-   for _,v in pairs({'char', 'depth', 'dir', 'font', 'height', 'kern', 'lang', 'next', 
+   for _,v in pairs({'char', 'depth', 'dir', 'font', 'height', 'kern', 'lang', 'next',
                       'nucleus', 'offsets', 'penalty', 'shift', 'sub', 'subtype', 'sup'}) do
-         if not dnode['set'..v] then 
+         if not dnode['set'..v] then
              dnode['set'..v] = function(n, ...) return setfield(n, v, ...) end
          end
    end
@@ -60,10 +60,10 @@ do
       return getfield(g,'width'), getfield(g,'stretch'), getfield(g,'shrink'),
              getfield(g,'stretch_order'), getfield(g,'shrink_order')
    end
-   for _,v in pairs({'box', 'components', 'char', 'depth', 'font', 'height', 'kern', 'lang', 
+   for _,v in pairs({'box', 'components', 'char', 'depth', 'font', 'height', 'kern', 'lang',
                      'list', 'next', 'nucleus', 'offsets', 'penalty', 'prev', 'shift', 'sub',
                      'subtype', 'sup', 'whd', 'width', 'dir'}) do
-         if not dnode['get'..v] then 
+         if not dnode['get'..v] then
              dnode['get'..v] = function(n, ...) return getfield(n, v, ...) end
          end
     end
@@ -207,7 +207,7 @@ do
    local function getattr(a, d)
       local r = tex_getattr(a); d = d or 0
       return (r==-0x7FFFFFFF) and d or r
-   end 
+   end
    luatexja.unary_pars = {
       yalbaselineshift = function(t)
          return print_scaled(getattr('ltj@yablshift'))..'pt'
@@ -438,8 +438,8 @@ local function debug_show_node_X(p,print_fn, limit, inner_depth)
    local pt, pic = node_type(p.id), (get_attr(p, attr_icflag) or 0) % icflag_table.PROCESSED_BEGIN_FLAG
    local base = prefix .. string.format('%X', pic) .. ' ' .. pt .. ' ' .. tostring(p.subtype) .. ' '
    if pt == 'glyph' then
-      s = base .. ' ' 
-          .. (p.char<0xF0000 and utfchar(p.char) or '') 
+      s = base .. ' '
+          .. (p.char<0xF0000 and utfchar(p.char) or '')
           .. string.format(' (U+%X) ', p.char)
           .. tostring(p.font) .. ' (' .. print_scaled(p.height) .. '+'
           .. print_scaled(p.depth) .. ')x' .. print_scaled(p.width)