-- LOADING JAPANESE FONTS
------------------------------------------------------------------------
-local load_jfont_metric
+local load_jfont_metric, check_callback_order
do
local cstemp
local global_flag -- true if \globaljfont, false if \jfont
return
end
if not f then return end
- update_jfm_cache(j, f.size)
+ update_jfm_cache(j, f.size); check_callback_order()
local sz = metrics[j].size_cache[f.size]
local fmtable = { jfm = j, size = f.size, var = jfm_var,
with_kanjiskip = jfm_ksp,
end
do
+ local ltb = luatexbase
+ local to_be_checked = { 'pre_linebreak_filter', 'hpack_filter' }
+ check_callback_order = function()
+ for i,n in pairs(to_be_checked) do
+ local lotf_cb = ltb.priority_in_callback(n, 'luaotfload.letterspace')
+ local ltj_cb = ltb.priority_in_callback(n, 'ltj.main')
+ if lotf_cb then
+ 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.priority_in_callback(n, 'luaotfload.node_processor') + 1)
+ end
+ end
+ end
+ end
+end
+
+do
local get_dir_count = ltjd.get_dir_count
local dir_tate = luatexja.dir_table.dir_tate
local tex_get_attr = tex.getattribute
local jf_feature_list = P'{' * jf_feature_expr^0 * P'}' + jf_feature_expr^0
local jf_list = C((1-slash)^1) * (slash * Cf(Ct'' * jf_feature_list, rawset))^-1
local jf_value = (1 - semicolon)^1
- local function rem(name,value,sep)
+ local function rem(name,value)
if name=='jfm' then
local flag, t; jfm_name, t = lpegmatch(jf_list, value)
if type(t)=='table' then
return ''
end
local jf_remainder = Cs( ( ( B(S':;') *
- C(P'jfm' * P'var'^-1) * ws * equals * ws * C(jf_value) * C(semicolon^-1) ) / rem +1 )^0 )
+ C(P'jfm' * P'var'^-1) * ws * equals * ws * C(jf_value) * semicolon^-1 ) / rem +1 )^0 )
local parser=luaotfload.parsers.font_request
function is_feature_specified(s,fname)
%#!luatex
-\input luatexja.sty
+\input lua-visual-debug.sty
+\input luatexja-otf.sty
\catcode`\@=11
\jfont \testA=\ltj@stdmcfont:jfm=ujis/hoge,piyo at 9.62216pt
\jfont \testB=\ltj@stdmcfont:jfm=ujis/{piyo,,,,,+hoge,,,,};jp90 at 9.62216pt
\jfont \testC=\ltj@stdgtfont:jfm=ujis/,,,,;+jp90 at 9.62216pt
%\jfont \testD=\ltj@stdgtfont:jfm=/abcd;+trad at 9.62216pt % error
\jfont \testE=\ltj@stdmcfont:jfm=ujis/piyo,hoge=2,+foo,-bar,mog=6,,l=true,g=false;jp90 at 9.62216pt
-\jfont \testE=\ltj@stdmcfont:jp90;jfm=ujis/{-bar,-g,foo,hoge=2,l,mog=6,piyo} at 9.62216pt
+\jfont \testE=\ltj@stdmcfont:jp90;jfm=ujis/{-bar,-g,foo,hoge=2,l,mog=6,piyo};color=6faf5f at 9.62216pt
+\def\DISP#1{{\noindent\tentt \string#1: \meaning#1}\par}
+\DISP\testA
+\DISP\testB
+\DISP\testC
+\DISP\testD
+\DISP\testE
\ltjsetparameter{differentjfm=both}
-{\testA (あ葛鴎)}{\testB (い葛鴎)}{\testC (う葛鴎)}(え葛鴎){\tengt(あ葛鴎)}\par
+{\testA (あ葛鴎)}{\testB (い葛鴎)}{\testC (う葛鴎)}(え葛鴎){\tengt(あ葛鴎)}{\testE あおうえお}\par
\ltjsetparameter{differentjfm=paverage}
-{\testA (あ葛鴎)}{\testB (い葛鴎)}{\testC (う葛鴎)}(え葛鴎){\tengt(あ葛鴎)}\par
+{\testA (あ葛鴎)}{\testB (い葛鴎)}{\testC (う葛鴎)}(え葛鴎){\tengt(あ葛鴎)}{\testE あおうえお}\par
+
+\medskip
+\hrule
+\medskip
+\font\testOA=lmroman10-regular:letterspace=0.01
+\jfont\testF=\ltj@stdmcfont:jfm=ujis;letterspace=50 at 9.62216pt
+{\testOA \testF
+ A quick brown fox 跳』\inhibitglue (躍)(した:) over the のろ……まな 犬.
+}
+
+\directlua{
+ local ltb = luatexbase
+ print(table.serialize(ltb.callback_descriptions('pre_linebreak_filter')))
+ print(table.serialize(ltb.callback_descriptions('hpack_filter')))
+}
+
+{\testOA \testF
+ A quick brown fox 跳』\inhibitglue (躍)(した:) over the のろ……まな 犬.
+ A quick fox 跳』\inhibitglue (躍)(した:) over the のろ……まな 犬.ああああああ
+
+}
+
\bye