diff options
author | Karl Berry <karl@freefriends.org> | 2019-01-07 22:13:27 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2019-01-07 22:13:27 +0000 |
commit | bd1875cde7b10d9c50c1919729a178ffa0ca77d1 (patch) | |
tree | c39000513338bd200b3fb39221b2091798957cb5 /Master/texmf-dist/tex/luatex/luatexja | |
parent | 0a0336d2291164dec0f697dc2941c1bfa06069e1 (diff) |
luatexja (7jan19)
git-svn-id: svn://tug.org/texlive/trunk@49635 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/luatex/luatexja')
7 files changed, 206 insertions, 89 deletions
diff --git a/Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-adjust.sty b/Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-adjust.sty index 57d9835caf5..c4cc54c2f9e 100644 --- a/Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-adjust.sty +++ b/Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-adjust.sty @@ -134,6 +134,8 @@ } \define@key[ltj]{japaram}{linestep_factor}{% \directlua{local d = #1; luatexja.adjust.step_factor=math.abs(d)}\relax} +\define@key[ltj]{japaram}{profile_hgap_factor}{% + \directlua{luatexja.adjust.profile_hgap_factor = math.abs(#1)}\relax} %%------------------ all done diff --git a/Master/texmf-dist/tex/luatex/luatexja/ltj-adjust.lua b/Master/texmf-dist/tex/luatex/luatexja/ltj-adjust.lua index 382e7602a71..3d7e31e0c40 100644 --- a/Master/texmf-dist/tex/luatex/luatexja/ltj-adjust.lua +++ b/Master/texmf-dist/tex/luatex/luatexja/ltj-adjust.lua @@ -445,56 +445,83 @@ luatexja.unary_pars.adjust = function(t) return is_reg and 1 or 0 end +-- ---------------------------------- +do + local max, ins, sort = math.max, table.insert, table.sort + local function insert(package, ind, d, b, e) + local bound = package[2] + bound[b], bound[e]=true, true + ins(package[1], {b,e,[ind]=d}) + end + local function flatten(package) + local bd={} for i,_ in pairs(package[2]) do ins(bd,{i}) end + sort(bd, function (a,b) return a[1]<b[1] end) + local bdc=#bd; local t = package[1] + sort(t, function (a,b) return a[1]<b[1] end) + local bdi =1 + for i=1,#t do + while bd[bdi][1]<t[i][1] do bdi=bdi+1 end + local j = bdi + while j<bdc and bd[j+1][1]<=t[i][2] do + for k,w in pairs(t[i]) do + if k>=3 then + bd[j][k]=bd[j][k] and max(bd[j][k],w) or w + end + end + j=j+1 + end + end + package[2]=nil; package[1]=nil; package.flatten, package.insert=nil, nil + bd[#bd]=nil + return bd + end + function init_range() + return {{},{}, insert=insert, flatten=flatten} + end +end + -- ----------------------------------- luatexja.adjust.step_factor = 0.5 +luatexja.unary_pars.linestep_factor = function(t) + return luatexja.adjust.step_factor +end +luatexja.adjust.profile_hgap_factor = 1 +luatexja.unary_pars.profile_hgap_factor = function(t) + return luatexja.adjust.profile_hgap_factor +end do local insert = table.insert local rangedimensions, max = node.direct.rangedimensions, math.max - function ltjl.p_profile(before, after, mirrored, bw) - local t = {} - do - local w_acc, d_before = getfield(before,'shift'), 0 - local x = getlist(before); local xn = node_next(x) - while x do - local w, d - if xn then w, _, d= rangedimensions(before,x,xn) - else w, _, d= rangedimensions(before,x) end - if d~=d_before then - d_before = d; t[w_acc] = t[w_acc] or {} - if t[w_acc][1] then t[w_acc][1]=max(t[w_acc][1],d) - else t[w_acc][1]=d end - end - w_acc = w_acc + w - x = xn; if x then xn = node_next(x) end - end - end - do - local w_acc, h_before = getfield(after,'shift'), 0 - local x = getlist(after); local xn = node_next(x) - while x do - local w, h, d - if xn then w, h, d = rangedimensions(after,x,xn) - else w, h,d = rangedimensions(after,x) end - if mirrored then h=d end - if h~=h_before then - h_before = h; t[w_acc] = t[w_acc] or {} - if t[w_acc][2] then t[w_acc][2]=max(t[w_acc][2],h) - else t[w_acc][2]=h end - end - w_acc = w_acc + w - x = xn; if x then xn = node_next(x) end + local function profile_inner(box, range, ind, vmirrored, adj) + local w_acc, d_before = getfield(box,'shift'), 0 + local x = getlist(box); local xn = node_next(x) + while x do + local w, h, d + if xn then w, h, d= rangedimensions(box,x,xn) + else w, h, d= rangedimensions(box,x) end + if vmirrored then h=d end + local w_new = w_acc + w + if w>=0 then + range:insert(ind, h, w_acc-adj, w_new) + else + range:insert(ind, h, w_new-adj, w_acc) end + w_acc = w_new; x = xn; if x then xn = node_next(x) end end - local t2 = {} - for i,v in pairs(t) do insert(t2, { i, v[1], v[2] } ) end - table.sort(t2, function(a,b) return a[1]<b[1] end) + end + function ltjl.p_profile(before, after, mirrored, bw) + local range, tls + = init_range(), luatexja.adjust.profile_hgap_factor*tex.lineskip.width + profile_inner(before, range, 3, true, tls) + profile_inner(after, range, 4, mirrored, tls) + range = range:flatten() do local dmax, d, hmax, h, lmin = 0, 0, 0, 0, 1/0 - for i,v in ipairs(t2) do - d, h = (v[2] or d), (v[3] or h) + for i,v in ipairs(range) do + d, h = (v[3] or 0), (v[4] or 0) if d>dmax then dmax=d end if h>hmax then hmax=h end - if (bw-h-d)<lmin then lmin=bw-h-d end + if bw-h-d<lmin then lmin=bw-h-d end end if lmin==1/0 then lmin = bw end return lmin, @@ -513,7 +540,7 @@ do return ltjl.l_dummy(dist, g, adj, normal, bw, loc) end if dist < tex.lineskiplimit then - local f = max(1, bw*ltja.step_factor) + local f = max(1, bw*ltja.step_factor) copy_glue(g, tex.baselineskip, 1, normal - f * floor((dist-tex.lineskip.width)/f)) else copy_glue(g, tex.baselineskip, 2, normal) diff --git a/Master/texmf-dist/tex/luatex/luatexja/ltj-jfont.lua b/Master/texmf-dist/tex/luatex/luatexja/ltj-jfont.lua index 372b39784d2..76ec21262a2 100644 --- a/Master/texmf-dist/tex/luatex/luatexja/ltj-jfont.lua +++ b/Master/texmf-dist/tex/luatex/luatexja/ltj-jfont.lua @@ -3,7 +3,7 @@ -- luatexbase.provides_module({ name = 'luatexja.jfont', - date = '2018/11/01', + date = '2018/12/15', description = 'Loader for Japanese fonts', }) @@ -198,8 +198,9 @@ do return new else return nil end end + local size_cache_num = 1 update_jfm_cache = function (j,sz) - if metrics[j].size_cache[sz] then return end + if metrics[j].size_cache[sz] then return metrics[j].size_cache[sz].index end local t = {} metrics[j].size_cache[sz] = t t.chars = metrics[j].chars @@ -233,6 +234,9 @@ do t.zw = round(metrics[j].zw*sz) t.zh = round(metrics[j].zh*sz) t.size = sz + size_cache_num = size_cache_num + 1 + t.index = size_cache_num + return size_cache_num end end @@ -267,10 +271,11 @@ end -- LOADING JAPANESE FONTS ------------------------------------------------------------------------ +local load_jfont_metric do local cstemp local global_flag -- true if \globaljfont, false if \jfont - local function load_jfont_metric() + load_jfont_metric = function() if jfm_file_name=='' then ltjb.package_error('luatexja', 'no JFM specified', @@ -452,6 +457,18 @@ do luatexbase.create_callback('luatexja.define_font', 'simple', function (n) return n end) otfl_fdr= luatexbase.remove_from_callback('define_font', 'luaotfload.define_font') luatexbase.add_to_callback('define_font',luatexja.font_callback,"luatexja.font_callback", 1) + + local match, sp = string.match, tex.sp + local function load_jfmonly(spec, dir) + local spec, size = match(spec,'(.+)%s+at%s*([%.%w]*)') + size = sp(size); extract_metric(spec) + jfm_dir = dir + local i = load_jfont_metric() + local j = -update_jfm_cache(i, size) + font_metric_table[j]=metrics[i].size_cache[s] + tex.sprint(cat_lp, '\\ltj@cur' .. (dir=='yoko' and 'j' or 't') .. 'fnt' .. tostring(j) .. '\\relax') + end + luatexja.jfont.load_jfmonly = load_jfmonly end ------------------------------------------------------------------------ @@ -640,7 +657,7 @@ do -- EXT function luatexja.jfont.does_alt_set(bbase) aftl_base = alt_font_table_latex[bbase] - tex.sprint(cat_lp, '\\if' .. (aftl_base and 'true' or 'false')) + tex.sprint(cat_lp, aftl_base and '\\@firstofone' or '\\@gobble') end -- EXT function luatexja.jfont.print_aftl_address() diff --git a/Master/texmf-dist/tex/luatex/luatexja/ltj-pretreat.lua b/Master/texmf-dist/tex/luatex/luatexja/ltj-pretreat.lua index 88aad543be6..1729c9e7f03 100644 --- a/Master/texmf-dist/tex/luatex/luatexja/ltj-pretreat.lua +++ b/Master/texmf-dist/tex/luatex/luatexja/ltj-pretreat.lua @@ -103,7 +103,9 @@ do while pid==id_glyph do local pc = getchar(p) if has_attr(p, attr_icflag, 0) and is_ucs_in_japanese_char(p, pc) then - setfont(p, ltjf_replace_altfont(has_attr(p, attr_curjfnt) or getfont(p), pc)) + local pf = has_attr(p, attr_curjfnt) + pf = (pf and pf>0 and pf) or getfont(p) + setfont(p, ltjf_replace_altfont(pf, pc)) setlang(p, lang_ja) ltjs_orig_char_table[p] = pc end diff --git a/Master/texmf-dist/tex/luatex/luatexja/ltj-ruby.lua b/Master/texmf-dist/tex/luatex/luatexja/ltj-ruby.lua index 3dff4e6848c..060b3226ad3 100644 --- a/Master/texmf-dist/tex/luatex/luatexja/ltj-ruby.lua +++ b/Master/texmf-dist/tex/luatex/luatexja/ltj-ruby.lua @@ -208,7 +208,7 @@ do local hh, hd = getfield(box, 'height'), getfield(box, 'depth') local hx = h while hx do - local hic = has_attr(hx, attr_icflag) + local hic = has_attr(hx, attr_icflag) or 0 if (hic == KANJI_SKIP) or (hic == KANJI_SKIP_JFM) or (hic == XKANJI_SKIP) or (hic == XKANJI_SKIP_JFM) or ((hic<=FROM_JFM+63) and (hic>=FROM_JFM)) then diff --git a/Master/texmf-dist/tex/luatex/luatexja/luatexja.sty b/Master/texmf-dist/tex/luatex/luatexja/luatexja.sty index 496e4c86960..0ce05322b59 100644 --- a/Master/texmf-dist/tex/luatex/luatexja/luatexja.sty +++ b/Master/texmf-dist/tex/luatex/luatexja/luatexja.sty @@ -35,13 +35,13 @@ \expandafter\let\csname ifltj@in@latex\expandafter\endcsname \csname iftrue\endcsname \NeedsTeXFormat{LaTeX2e} - \ProvidesPackage{luatexja}[2018/09/30 Japanese Typesetting with Lua(La)TeX] + \ProvidesPackage{luatexja}[2019/01/07 Japanese Typesetting with Lua(La)TeX] \DeclareOption{disablejfam}{\ltj@disablejfamtrue} \DeclareOption*{} \ProcessOptions\relax \fi %</LaTeX> %%%% VERSION -\def\LuaTeXjaversion{20181103.0} +\def\LuaTeXjaversion{20190107.0} \directlua{require('ltj-unicode-ccfix.lua')}% catcode of ideographs diff --git a/Master/texmf-dist/tex/luatex/luatexja/patches/lltjfont.sty b/Master/texmf-dist/tex/luatex/luatexja/patches/lltjfont.sty index 6560f3fa3fe..515f7dfdbfb 100644 --- a/Master/texmf-dist/tex/luatex/luatexja/patches/lltjfont.sty +++ b/Master/texmf-dist/tex/luatex/luatexja/patches/lltjfont.sty @@ -3,7 +3,7 @@ % \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{lltjfont}[2018/10/08 Patch to NFSS2 for LuaTeX-ja] +\ProvidesPackage{lltjfont}[2018/12/15 Patch to NFSS2 for LuaTeX-ja] \def\ltj@chardef@text@cmd#1{% \let\@ifdefinable\@@ifdefinable% @@ -75,13 +75,13 @@ \fi\fi } -\def\ystrut{\relax\hbox{\yoko +\def\ystrut{\relax\hbox{\ltj@@orig@yoko \ifmmode\copy\ystrutbox\else\unhcopy\ystrutbox\fi}} -\def\tstrut{\relax\hbox{\tate +\def\tstrut{\relax\hbox{\ltj@@orig@tate \ifmmode\copy\tstrutbox\else\unhcopy\tstrutbox\fi}} -\def\dstrut{\relax\hbox{\dtou +\def\dstrut{\relax\hbox{\ltj@@orig@dtou \ifmmode\copy\dstrutbox\else\unhcopy\dstrutbox\fi}} -\def\zstrut{\relax\hbox{\utod +\def\zstrut{\relax\hbox{\ltj@@orig@utod \ifmmode\copy\zstrutbox\else\unhcopy\zstrutbox\fi}} {% @@ -243,18 +243,24 @@ \gdef\f@baselineskip{#5pt}} \@onlypreamble\DeclareKanjiSubstitution \@onlypreamble\DeclareErrorKanjiFont + +\newif\ifltjselectfont@force@define \def\DeclareFixedFont#1#2#3#4#5#6{% \begingroup \math@fontsfalse \every@math@size{}% \fontsize{#6}\z@ \directlua{luatexja.jfont.is_kyenc('\luatexluaescapestring{#2}')}\ifin@% + \ltjselectfont@force@definetrue \usekanji{#2}{#3}{#4}{#5}% \global\let#1\getjfont + \ltjselectfont@force@definefalse \else \directlua{luatexja.jfont.is_ktenc('\luatexluaescapestring{#2}')}\ifin@% + \ltjselectfont@force@definetrue \usekanji{#2}{#3}{#4}{#5}% \global\let#1\gettfont + \ltjselectfont@force@definefalse \else \useroman{#2}{#3}{#4}{#5}% \global\expandafter\let\expandafter#1\the\font @@ -314,6 +320,8 @@ \expandafter\expandafter\expandafter\let \expandafter\expandafter\csname ltj@@orig@selectfont\endcsname\csname selectfont\space\endcsname \@EverySelectfont@Init +%\let\ltj@@font@info\@font@info +%\let\ltj@@font@warning\@font@warning \def\@EverySelectfont@Init{% \expandafter\let\csname selectfont\space \endcsname \ltj@@orig@selectfont \ltj@@EverySelectfont@Init @@ -321,22 +329,26 @@ \def\ltj@selectfont@tate{% \let\k@encoding\ct@encoding \xdef\font@name{\csname\curr@kfontshape/\f@size\endcsname}% - \pickup@tfont\font@name - \ltj@@does@alt@set{\curr@kfontshape}% - % alt fonts の定義 - \directlua{luatexja.jfont.output_alt_font_cmd('t', '\luatexluaescapestring{\curr@kfontshape}')}% - % 定義した alt fonts のデータを \ltjdeclarealtfont に渡すのと同等の処理をする - \directlua{luatexja.jfont.pickup_alt_font_a('\f@size')}% + \pickup@tfont + \ifnum\ltjgetparameter{direction}=3 \font@name + \ltj@@does@alt@set{\curr@kfontshape}{% + % alt fonts の定義 + \directlua{luatexja.jfont.output_alt_font_cmd('t', '\luatexluaescapestring{\curr@kfontshape}')}% + % 定義した alt fonts のデータを \ltjdeclarealtfont に渡すのと同等の処理をする + \directlua{luatexja.jfont.pickup_alt_font_a('\f@size')}% + }% \fi} \def\ltj@selectfont@yoko{% \let\k@encoding\cy@encoding \xdef\font@name{\csname\curr@kfontshape/\f@size\endcsname}% - \pickup@jfont\font@name - \ltj@@does@alt@set{\curr@kfontshape}% - % alt fonts の定義 - \directlua{luatexja.jfont.output_alt_font_cmd('y', '\luatexluaescapestring{\curr@kfontshape}')}% - % 定義した alt fonts のデータを \ltjdeclarealtfont に渡すのと同等の処理をする - \directlua{luatexja.jfont.pickup_alt_font_a('\f@size')}% + \pickup@jfont + \unless\ifnum\ltjgetparameter{direction}=3 \font@name + \ltj@@does@alt@set{\curr@kfontshape}{% + % alt fonts の定義 + \directlua{luatexja.jfont.output_alt_font_cmd('y', '\luatexluaescapestring{\curr@kfontshape}')}% + % 定義した alt fonts のデータを \ltjdeclarealtfont に渡すのと同等の処理をする + \directlua{luatexja.jfont.pickup_alt_font_a('\f@size')}% + }% \fi} \def\ltj@selectfont@patch{% \directlua{luatexja.base.start_time_measure('selectfont')}% @@ -354,8 +366,6 @@ \fi \fi \global\let\ltj@afont@name=\font@name - %\ifnum3=\ltjgetparameter{direction}\relax \ltj@selectfont@tate - %\else \ltj@selectfont@yoko\fi \ltj@selectfont@tate\ltj@selectfont@yoko % \edef\tmp@item{{\k@encoding}}\expandafter\def\expandafter\k@encoding\tmp@item @@ -381,6 +391,24 @@ } \EverySelectfont{\ltj@selectfont@patch} +\bgroup + \def\ltj@@dir@patch#1#2#3{% + \global\csletcs{ltj@@orig@#1}{#1}% + \protected\expandafter\xdef\csname #1\endcsname{% + \csname ltj@@orig@#1\endcsname + \unexpanded{\ifnum#3<\z@\let\ltj@@protect\protect\set@typeset@protect}% + \unexpanded{\global\let\ltj@afont@name=\font@name}% + \expandonce{\csname ltj@selectfont@#2\endcsname}% + \unexpanded{\global\let\font@name=\ltj@afont@name}% + \unexpanded{\let\protect\ltj@@protect\fi}% + }% + } + \ltj@@dir@patch{yoko}{yoko}{\ltj@curjfnt} + \ltj@@dir@patch{tate}{tate}{\ltj@curtfnt} + \ltj@@dir@patch{utod}{yoko}{\ltj@curjfnt} + \ltj@@dir@patch{dtou}{yoko}{\ltj@curjfnt} +\egroup + \def\KanjiEncodingPair#1#2{\@namedef{t@enc@#1}{#2}\@namedef{y@enc@#2}{#1}} \def\set@fontsize#1#2#3{% \@defaultunits\@tempdimb#2pt\relax\@nnil @@ -394,16 +422,16 @@ \baselineskip\f@linespread\baselineskip \normalbaselineskip\baselineskip \adjustbaseline - \setbox\ystrutbox\hbox{\yoko + \setbox\ystrutbox\hbox{\ltj@@orig@yoko \vrule\@width\z@ \@height.7\baselineskip \@depth.3\baselineskip}% - \setbox\dstrutbox\hbox{\dtou + \setbox\dstrutbox\hbox{\ltj@@orig@dtou \vrule\@width\z@ \@height.7\baselineskip \@depth.3\baselineskip}% - \setbox\tstrutbox\hbox{\tate + \setbox\tstrutbox\hbox{\ltj@@orig@tate \vrule\@width\z@ \@height.5\baselineskip \@depth.5\baselineskip}% - \setbox\zstrutbox\hbox{\utod + \setbox\zstrutbox\hbox{\ltj@@orig@utod \vrule\@width\z@ \@height.7\baselineskip \@depth.3\baselineskip}% \let\size@update\relax}} @@ -415,12 +443,13 @@ local t = lua.get_functions_table() local getfont, dir_tate = font.getfont, luatexja.dir_table.dir_tate local fmt, get_attr = luatexja.jfont.font_metric_table, tex.getattribute + local getcount=tex.getcount local setdimen, set_attr = tex.setdimen, tex.setattribute local dir = luatexja.unary_pars.direction t[\the\ltj@@adjust@baseline@inner] = function() local ft = fmt[get_attr('ltj@curtfnt')] or nulltable - ft = ft and ft.char_type or nulltable - local fk = ft and ft[0] or nulltable + ft = ft.char_type or nulltable + local fk = ft[0] or nulltable local ht, dp, wd = fk.height or 0, fk.depth or 0, fk.width or ft.zw or 0 local fm @@ -430,8 +459,8 @@ tex.round(0.5*((fm.height or 0)- (fm.depth or 0) - ht+ dp))) if dir() ~= dir_tate then ft = fmt[get_attr('ltj@curjfnt')] or nulltable - ft = ft and ft.char_type or nulltable - fk = ft and ft[0] or nulltable + ft = ft.char_type or nulltable + fk = ft[0] or nulltable ht, dp, wd = fk.height or 0, fk.depth or 0, fk.width or ft.zw or 0 end @@ -601,19 +630,47 @@ \let\extract@afont\extract@font \def\pickup@jfont{% + \ifnum + \unless\ifnum\ltjgetparameter{direction}=3 1\else + \ifltjselectfont@force@define 1\else 0\fi\fi =1 % \expandafter \ifx \font@name \relax \let\extract@font\extract@jfont \define@newfont \let\extract@font\extract@afont \fi - \let\getjfont\font@name} + \let\getjfont\font@name + \else + \begingroup\escapechar\m@ne + \ifcsname ltj@@fontjfm/\expandafter\string\font@name\endcsname\else + \let\extract@font\extract@jfont@onlyjfm + \define@newfont + \let\extract@font\extract@afont + \fi + \endgroup + \csname ltj@@fontjfm/\expandafter\expandafter\expandafter\@gobble\expandafter\string\font@name\endcsname + \fi +} \def\pickup@tfont{% + \ifnum + \ifnum\ltjgetparameter{direction}=3 1\else + \ifltjselectfont@force@define 1\else 0\fi\fi =1 % \expandafter \ifx \font@name \relax \let\extract@font\extract@tfont \define@newfont \let\extract@font\extract@afont \fi - \let\gettfont\font@name} + \let\gettfont\font@name + \else + \begingroup\escapechar\m@ne + \ifcsname ltj@@fontjfm/\expandafter\string\font@name\endcsname\else + \let\extract@font\extract@tfont@onlyjfm + \define@newfont + \let\extract@font\extract@afont + \fi + \endgroup + \csname ltj@@fontjfm/\expandafter\expandafter\expandafter\@gobble\expandafter\string\font@name\endcsname + \fi +} % 異なる和文 enc/fam/ser/shape からは異なるフォント番号が振られるように % わざと「ゴミをつける」 @@ -621,23 +678,35 @@ #1\directlua{luatexja.jfont.print_aftl_address()}\space at% } \def\extract@jfont{% - \get@external@font - \ltj@@does@alt@set{\f@encoding/\f@family/\f@series/\f@shape}% + \get@external@font + \ltj@@does@alt@set{\f@encoding/\f@family/\f@series/\f@shape}{% \edef\external@font{\expandafter\ltj@@patch@external@font\external@font}% - \fi - \expandafter\globaljfont\font@name\external@font\relax% ここで時間がかかる - \font@name%\global\zw=\zw\global\zh=\zh + }% + \expandafter\globaljfont\font@name\external@font\relax\font@name% ここで時間がかかる \csname \f@encoding+\f@family\endcsname \csname\curr@fontshape\endcsname} \def\extract@tfont{% - \get@external@font - \ltj@@does@alt@set{\f@encoding/\f@family/\f@series/\f@shape}% + \get@external@font + \ltj@@does@alt@set{\f@encoding/\f@family/\f@series/\f@shape}{% \edef\external@font{\expandafter\ltj@@patch@external@font\external@font}% - \fi - \expandafter\globaltfont\font@name\external@font\relax - \font@name%\global\zw=\zw\global\zh=\zh + }% + \expandafter\globaltfont\font@name\external@font\relax\font@name \csname \f@encoding+\f@family\endcsname \csname\curr@fontshape\endcsname} +\def\extract@jfont@onlyjfm{% + \get@external@font + \csxdef{ltj@@fontjfm/\expandafter\string\font@name}{% + \directlua{% + luatexja.jfont.load_jfmonly('\luatexluaescapestring{\external@font}', 'yoko') + }% + }} +\def\extract@tfont@onlyjfm{% + \get@external@font + \csxdef{ltj@@fontjfm/\expandafter\string\font@name}{% + \directlua{% + luatexja.jfont.load_jfmonly('\luatexluaescapestring{\external@font}', 'tate') + }% + }} \let\ltj@@al@do@subst@correction=\do@subst@correction \def\ltj@@ja@do@subst@correction{% @@ -737,8 +806,8 @@ \directlua{luatexja.jfont.pickup_alt_font_b(\the\ltj@tempcntc,'\luatexluaescapestring{#2}')}% } -\def\ltj@@does@alt@set#1{% - \directlua{luatexja.jfont.does_alt_set'\luatexluaescapestring{#1}'}} +\def\ltj@@does@alt@set#1#2{% + \directlua{luatexja.jfont.does_alt_set'\luatexluaescapestring{#1}'}{#2}} %%%% patch \@text@composite because of {y,t}albaselineshift |