summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/luatex/jlreq
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2017-04-29 22:22:55 +0000
committerKarl Berry <karl@freefriends.org>2017-04-29 22:22:55 +0000
commita64b4791da7a1ea0fb4652e5a729eac97378f936 (patch)
tree9259c032947abef7879470656be9a1371d564f01 /Master/texmf-dist/tex/luatex/jlreq
parent3f99609b0e6bb17494a6f8bd9d49033f50762c74 (diff)
jlreq (29apr17)
git-svn-id: svn://tug.org/texlive/trunk@44117 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/luatex/jlreq')
-rw-r--r--Master/texmf-dist/tex/luatex/jlreq/jfm-jlreqv.lua41
1 files changed, 41 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/luatex/jlreq/jfm-jlreqv.lua b/Master/texmf-dist/tex/luatex/jlreq/jfm-jlreqv.lua
index 9ddd2936f78..a0d6134bd24 100644
--- a/Master/texmf-dist/tex/luatex/jlreq/jfm-jlreqv.lua
+++ b/Master/texmf-dist/tex/luatex/jlreq/jfm-jlreqv.lua
@@ -2990,4 +2990,45 @@ local jfm={
["zh"]=1,
["zw"]=1,
}
+local function add_space(before,after,glueorkern,space,ratio)
+ if jfm[before][glueorkern] == nil then jfm[before][glueorkern] = {} end
+ if jfm[before][glueorkern][after] == nil then jfm[before][glueorkern][after] = {0} end
+ local origratio = jfm[before][glueorkern][after].ratio
+ if origratio == nil then origratio = 0.5 end
+ jfm[before][glueorkern][after].ratio = (jfm[before][glueorkern][after][1] * origratio + space * ratio) / (jfm[before][glueorkern][after][1] + ratio)
+ jfm[before][glueorkern][after][1] = jfm[before][glueorkern][after][1] + space
+end
+
+if jlreq ~= nil then
+ if type(jlreq.open_bracket_pos) == "string" then
+ local r = jlreq.open_bracket_pos:find("_")
+ local danraku = jlreq.open_bracket_pos:sub(1,r - 1)
+ local orikaeshi = jlreq.open_bracket_pos:sub(r + 1)
+
+ -- 折り返し行頭の開き括弧を二分下げる……つもり
+ if orikaeshi == "nibu" then
+ -- widthを二分増やし,その代わりJFMグルーを二分減らす
+ jfm[1].width = jfm[1].width + 0.5
+ for k,v in pairs(jfm) do
+ if type(k) == "number" then
+ add_space(k,1,"glue",-0.5,1)
+ end
+ end
+ end
+
+ -- 段落行頭の下げ
+ if danraku == "zenkakunibu" then
+ add_space(90,1,"glue",0.5,1)
+ elseif danraku == "nibu" then
+ add_space(90,1,"glue",-0.5,1)
+ end
+ end
+
+ -- ぶら下げ組を有効にする.
+ if jlreq.burasage == true then
+ for _,class in ipairs({6,7}) do
+ table.insert(jfm[class].end_adjust,-0.5)
+ end
+ end
+end
luatexja.jfont.define_jfm(jfm)