diff options
author | Karl Berry <karl@freefriends.org> | 2014-01-15 00:32:20 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2014-01-15 00:32:20 +0000 |
commit | fd5cb3ef247d97c4aac93eab2ced35daf3f1ab0f (patch) | |
tree | 43eb0191a5a4f0c13cfa4fc6e29a7ef551de3c16 /Master/texmf-dist/tex/luatex/luatexja/luatexja.lua | |
parent | a4268e90f9d9013767d4aee201908389ccc22120 (diff) |
luatexja (14jan14)
git-svn-id: svn://tug.org/texlive/trunk@32678 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/luatex/luatexja/luatexja.lua')
-rw-r--r-- | Master/texmf-dist/tex/luatex/luatexja/luatexja.lua | 66 |
1 files changed, 35 insertions, 31 deletions
diff --git a/Master/texmf-dist/tex/luatex/luatexja/luatexja.lua b/Master/texmf-dist/tex/luatex/luatexja/luatexja.lua index 9a09db9e68c..c6ccda589fb 100644 --- a/Master/texmf-dist/tex/luatex/luatexja/luatexja.lua +++ b/Master/texmf-dist/tex/luatex/luatexja/luatexja.lua @@ -219,41 +219,45 @@ function luatexja.ext_print_global() end -- main process --- mode = true iff main_process is called from pre_linebreak_filter -local function main_process(head, mode, dir) - local p = head - p = ltjj.main(p,mode) - if p then p = ltjw.set_ja_width(p, dir) end - return p +do + -- mode = true iff main_process is called from pre_linebreak_filter + local function main_process(head, mode, dir) + local p = head + p = ltjj.main(p,mode) + if p then p = ltjw.set_ja_width(p, dir) end + return p + end + + -- callbacks + + luatexbase.add_to_callback( + 'pre_linebreak_filter', + function (head,groupcode) + return main_process(head, true, tex.textdir) + end,'ltj.pre_linebreak_filter', + luatexbase.priority_in_callback('pre_linebreak_filter', + 'luaotfload.node_processor') + 1) + luatexbase.add_to_callback( + 'hpack_filter', + function (head,groupcode,size,packtype, dir) + return main_process(head, false, dir) + end,'ltj.hpack_filter', + luatexbase.priority_in_callback('hpack_filter', + 'luaotfload.node_processor') + 1) end --- callbacks - -luatexbase.add_to_callback('pre_linebreak_filter', - function (head,groupcode) - return main_process(head, true, tex.textdir) - end,'ltj.pre_linebreak_filter', - luatexbase.priority_in_callback('pre_linebreak_filter', - 'luaotfload.node_processor') + 1) -luatexbase.add_to_callback('hpack_filter', - function (head,groupcode,size,packtype, dir) - return main_process(head, false, dir) - end,'ltj.hpack_filter', - luatexbase.priority_in_callback('hpack_filter', - 'luaotfload.node_processor') + 1) - -- define_font - -local otfl_fdr = fonts.definers.read -function luatexja.font_callback(name, size, id) - return ltjf.font_callback( - name, size, id, - function (name, size, id) return ltjr.font_callback(name, size, id, otfl_fdr) end - ) +do + local otfl_fdr = fonts.definers.read + local ltjr_font_callback = ltjr.font_callback + function luatexja.font_callback(name, size, id) + return ltjf.font_callback( + name, size, id, + function (name, size, id) return ltjr_font_callback(name, size, id, otfl_fdr) end + ) + end + luatexbase.add_to_callback('define_font',luatexja.font_callback,"luatexja.font_callback", 1) end ---luatexbase.remove_from_callback('define_font',"luaotfload.define_font") -luatexbase.add_to_callback('define_font',luatexja.font_callback,"luatexja.font_callback", 1) - |