X-Git-Url: http://git.osdn.jp/view?a=blobdiff_plain;f=src%2Fltj-jfmglue.lua;h=330de54fbd355826346ef9cf65dcb6b2e7e59d0d;hb=1379fbf6aae445cdce3906e7b83cc1c8550e78d5;hp=680c6aa0f5ee6f5777a051fc93db84f21db90374;hpb=13a0202f984e6b75332f4f3c137e05e57ea79cd7;p=luatex-ja%2Fluatexja.git diff --git a/src/ltj-jfmglue.lua b/src/ltj-jfmglue.lua index 680c6aa..330de54 100644 --- a/src/ltj-jfmglue.lua +++ b/src/ltj-jfmglue.lua @@ -9,6 +9,7 @@ luatexbase.provides_module({ module('luatexja.jfmglue', package.seeall) local err, warn, info, log = luatexbase .errwarinf(_NAME) +luatexja.load_module('base'); local ltjb = luatexja.base luatexja.load_module('stack'); local ltjs = luatexja.stack luatexja.load_module('jfont'); local ltjf = luatexja.jfont luatexja.load_module('direction'); local ltjd = luatexja.direction @@ -34,7 +35,7 @@ local insert_before = Dnode.insert_before local insert_after = Dnode.insert_after local node_next = (Dnode ~= node) and Dnode.getnext or node.next local round = tex.round -local ltjd_make_dir_node = ltjd.make_dir_node +local ltjd_make_dir_whatsit = ltjd.make_dir_whatsit local ltjf_font_metric_table = ltjf.font_metric_table local ltjf_find_char_class = ltjf.find_char_class local node_new = Dnode.new @@ -44,9 +45,6 @@ local node_tail = Dnode.tail local node_free = Dnode.free local node_end_of_math = Dnode.end_of_math -local dir_tate = 3 -local dir_yoko = 4 - local id_glyph = node.id('glyph') local id_hlist = node.id('hlist') local id_vlist = node.id('vlist') @@ -106,11 +104,21 @@ local function fast_find_char_class(c,m) end -- 文字クラスの決定 -local function slow_find_char_class(c, m, oc) - local xc = c or oc - local cls = ltjf_find_char_class(oc, m) - if xc ~= oc and cls==0 then cls = ltjf_find_char_class(-xc, m) end - return cls, xc +local slow_find_char_class +do + local start_time_measure = ltjb.start_time_measure + local stop_time_measure = ltjb.stop_time_measure + slow_find_char_class = function (c, m, oc) + start_time_measure('slow_find_chr') + local cls = ltjf_find_char_class(oc, m) + if not c and cls==0 then + stop_time_measure('slow_find_chr') + return ltjf_find_char_class(-c, m), oc + else + stop_time_measure('slow_find_chr') + return cls, oc + end + end end local zero_glue = node_new(id_glue) @@ -197,7 +205,6 @@ local function check_box(box_ptr, box_end) end if pid==id_kern then local pa = get_attr_icflag(p) - --if pa==IC_PROCESSED or pa == PACKED then if pa==IC_PROCESSED then -- do nothing elseif getsubtype(p)==2 then @@ -288,11 +295,17 @@ local function check_next_ickern(lp) end local function calc_np_pbox(lp, last) + local first, lpa, nc = (not Np.first), KINSOKU, nil Np.first = Np.first or lp; Np.id = id_pbox - local lpa, nc = KINSOKU, nil set_attr(lp, attr_icflag, get_attr_icflag(lp)); while lp ~=last and (lpa>=PACKED) and (lpa