OSDN Git Service

changed descriptions of callback
authorHironori Kitagawa <h_kitagawa2001@yahoo.co.jp>
Sat, 30 Jan 2016 11:26:30 +0000 (20:26 +0900)
committerHironori Kitagawa <h_kitagawa2001@yahoo.co.jp>
Sat, 30 Jan 2016 11:26:30 +0000 (20:26 +0900)
src/ltj-otf.lua
src/ltj-pretreat.lua
src/ltjsclasses.dtx
src/luatexja.lua

index 94f4c61..ea92d60 100644 (file)
@@ -159,14 +159,13 @@ local function extract(head)
 end
 
 luatexbase.add_to_callback('hpack_filter', extract,
-                          'ltj.hpack_filter_otf',
+                          'ltj.otf',
    luatexbase.priority_in_callback('pre_linebreak_filter',
-                                  'ltj.pre_linebreak_filter'))
+                                  'ltj.main'))
 luatexbase.add_to_callback('pre_linebreak_filter', extract,
-                          'ltj.pre_linebreak_filter_otf',
+                          'ltj.otf',
    luatexbase.priority_in_callback('pre_linebreak_filter',
-                                  'ltj.pre_linebreak_filter'))
-
+                                  'ltj.main'))
 
 -- additional callbacks
 -- 以下は,LuaTeX-ja に用意された callback のサンプルになっている.
@@ -222,10 +221,10 @@ do
       return p
    end
 
-   local function do_ivs_repr(head)
-      head = to_direct(head)
+   local function do_ivs_repr(h)
+      local head = to_direct(h)
       local p, r = head
-      local is_dir_tate = ltjs.list_dir == dir_tate
+      local is_dir_tate = (ltjs.list_dir == dir_tate)
       local attr_ablshift = is_dir_tate and attr_tablshift or attr_yablshift
       local attr_kblshift = is_dir_tate and attr_tkblshift or attr_ykblshift
       local attr_curfnt =   is_dir_tate and attr_curtfnt or attr_curjfnt
@@ -237,7 +236,7 @@ do
             if q and getid(q)==id_glyph then
                local qc = getchar(q)
                if (qc>=0xFE00 and qc<=0xFE0F) or (qc>=0xE0100 and qc<0xE01F0) then
-                  -- q is a variation selector
+                  -- q is a variation selector
                   if qc>=0xE0100 then qc = qc - 0xE0100 end
                   local pt = ltjf_font_extra_info[pf]
                   pt = pt and pt[getchar(p)];  pt = pt and  pt[qc]
@@ -254,7 +253,7 @@ do
                      head = node_insert_after(head, p, np)
                      head = node_remove(head,p)
                     node_free(p)
-                  end
+                 end
                  p = r
               else
                  p = q
@@ -265,8 +264,8 @@ do
         else
            p = node_next(p)
          end
-      end
-      return to_node(head)
+     end
+     return to_node(head)
    end
 
    enable_ivs = function ()
@@ -275,13 +274,13 @@ do
                              'luatexja.otf.enable_ivs() was already called, so this call is ignored', '')
       else
         luatexbase.add_to_callback('hpack_filter',
-                                   do_ivs_repr,'do_ivs', 
+                                   do_ivs_repr, 'ltj.do_ivs', 
                                    luatexbase.priority_in_callback('hpack_filter',
-                                                                   'ltj.hpack_filter_pre')+1)
+                                                                   'ltj.set_stack_level')+1)
         luatexbase.add_to_callback('pre_linebreak_filter',
-                                   do_ivs_repr, 'do_ivs', 
+                                   do_ivs_repr, 'ltj.do_ivs', 
                                    luatexbase.priority_in_callback('pre_linebreak_filter',
-                                                                   'ltj.pre_linebreak_filter_pre')+1)
+                                                                   'ltj.set_stack_level')+1)
         is_ivs_enabled = true
       end
    end
index 4250775..9b2bc07 100644 (file)
@@ -126,6 +126,7 @@ end
 local ltjs_report_stack_level = ltjs.report_stack_level
 local ltjf_vert_form_table    = ltjf.vert_form_table
 local ltjf_font_metric_table  = ltjf.font_metric_table
+local font_getfont = font.getfont
 local function set_box_stack_level(head, mode)
    local box_set, cl = 0, tex.currentgrouplevel + 1
    for _,p  in pairs(wt) do
@@ -144,12 +145,11 @@ local function set_box_stack_level(head, mode)
            setfield(p, 'font', nf)
            if ltjf_font_metric_table[nf].vert_activated then
               pc = ltjf_vert_form_table [getchar(p)]
-              if font.getfont(nf).characters[pc] then setfield(p, 'char', pc) end
+              if font_getfont(nf).characters[pc] then setfield(p, 'char', pc) end
            end
         end
       end
    end
-   --luatexja.ext_show_node_list(head, 'S> ', print)
    return head
 end
 
@@ -157,11 +157,11 @@ end
 luatexbase.add_to_callback('hpack_filter',
    function (head)
      return set_box_stack_level(head, true)
-   end,'ltj.hpack_filter_pre',1)
+   end,'ltj.set_stack_level',1)
 luatexbase.add_to_callback('pre_linebreak_filter',
   function (head)
      return set_box_stack_level(head, false)
-  end,'ltj.pre_linebreak_filter_pre',1)
+  end,'ltj.set_stack_level',1)
 
 luatexja.pretreat = {
    set_box_stack_level = set_box_stack_level,
index 417f078..a3a3c6e 100644 (file)
@@ -22,7 +22,7 @@
 %  -----------------------------------------
 %
 % \fi
-% \CheckSum{5200}
+% \CheckSum{5202}
 %% \CharacterTable
 %%  {Upper-case    \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
 %%   Lower-case    \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
index 940ed21..1baeb94 100644 (file)
@@ -322,14 +322,14 @@ do
       'pre_linebreak_filter',
       function (head,groupcode)
         return main_process(head, true, tex.textdir, groupcode)
-      end,'ltj.pre_linebreak_filter',
+      end,'ltj.main',
       luatexbase.priority_in_callback('pre_linebreak_filter',
-                                     'luaotfload.node_processor') + 1)
+                                     'luaotfload.node_processor')+1)
    luatexbase.add_to_callback(
       'hpack_filter',
       function (head,groupcode,size,packtype, dir)
         return main_process(head, false, dir, groupcode)
-      end,'ltj.hpack_filter',
+      end,'ltj.main',
       luatexbase.priority_in_callback('hpack_filter',
                                      'luaotfload.node_processor') + 1)
    luatexbase.add_to_callback('pre_linebreak_filter', adjust_icflag, 'ltj.adjust_icflag', 1)