summaryrefslogtreecommitdiff
path: root/macros/luatex/generic
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2023-08-26 03:00:52 +0000
committerNorbert Preining <norbert@preining.info>2023-08-26 03:00:52 +0000
commit2c6f7db39402a9980f7423ed3266ad1d18936bcc (patch)
treeb998126ee1c53cfee553777049066ea4b50244f4 /macros/luatex/generic
parentba73c7edc85ac1310d82920c5f432993f8a9af23 (diff)
CTAN sync 202308260300
Diffstat (limited to 'macros/luatex/generic')
-rw-r--r--macros/luatex/generic/evangelion-jfm/Eva-JFM_doc-sc.pdfbin265483 -> 265161 bytes
-rw-r--r--macros/luatex/generic/evangelion-jfm/Evangelion-JFM.dtx8
-rw-r--r--macros/luatex/generic/evangelion-jfm/README.md12
-rw-r--r--macros/luatex/generic/evangelion-jfm/jfm-eva.lua100
-rw-r--r--macros/luatex/generic/evangelion-jfm/makefile15
5 files changed, 111 insertions, 24 deletions
diff --git a/macros/luatex/generic/evangelion-jfm/Eva-JFM_doc-sc.pdf b/macros/luatex/generic/evangelion-jfm/Eva-JFM_doc-sc.pdf
index 36b355f26f..d67ad71d65 100644
--- a/macros/luatex/generic/evangelion-jfm/Eva-JFM_doc-sc.pdf
+++ b/macros/luatex/generic/evangelion-jfm/Eva-JFM_doc-sc.pdf
Binary files differ
diff --git a/macros/luatex/generic/evangelion-jfm/Evangelion-JFM.dtx b/macros/luatex/generic/evangelion-jfm/Evangelion-JFM.dtx
index 6a67de23a0..cb47b2a246 100644
--- a/macros/luatex/generic/evangelion-jfm/Evangelion-JFM.dtx
+++ b/macros/luatex/generic/evangelion-jfm/Evangelion-JFM.dtx
@@ -1,7 +1,7 @@
% \iffalse meta-comment
% Copyright © 2023, RadioNoiseE (Jing Huang)
% Evangelion Japanese Font Metric for LuaTeX
-% Current Version: 1.0.3 (c)
+% Current Version: 1.0.5 (b)
% Dev URL: https://github.com/RadioNoiseE/Evangelion-JFM
% \fi
%<*batchfile>
@@ -39,7 +39,7 @@
%<en>\usepackage[margin=1.2in]{geometry}
\usepackage{graphicx}
%<sc>\usepackage[match]{luatexja-fontspec}
-%<ja>\usepackage[hiragino-pron, match,deluxe]{luatexja-preset}
+%<ja>\usepackage[hiragino-pron, match, deluxe]{luatexja-preset}
%<en>\usepackage{fontspec, luatexja}
%<*en>
\newfontfeature{microtype}{protrusion=default;expansion=default}
@@ -97,10 +97,10 @@
\maketitle
\begin{abstract}
-%<sc> 本文档将介绍名为Evangelion Japanese Font Metric(下简称为``\textsf{Eva-JFM}'')的JFM文件。其适用于简体中文(以下简称为「简中」)、繁体中文(以下简称为「繁中」)及日文字体的横直排。旨在提供一个充分利用\LuaTeX-ja的\texttt{priority}特性,基于标准\cite{jlreq}的同时,支持一些罕用特性的JFM文件。文档暂使用中文及西文撰写。
+%<sc> 本文档将介绍名为Evangelion Japanese Font Metric(下简称为``\textsf{Eva-JFM}'')的JFM文件。其适用于简体中文(以下简称为「简中」)、繁体中文(以下简称为「繁中」)及日文字体的横直排。旨在提供一个充分利用\LuaTeX-ja的\texttt{priority}特性,基于标准\cite{jlreq}的同时,支持一些罕用特性的JFM文件。文档使用中文、日文及西文撰写。
%<ja> 本ドキュメントは、高品質な中国語および日本語のドキュメントを組版するための日本語フォントメトリック「Evangelion Japanese Font Metric(以下「\textsf{Eva-JFM}」とする)」を紹介するものです。このメトリックは、縦書きと横書きの両方のテキストに対して、従来の中国語、簡体字中国語、および日本語のフォントとともに使用できます。これは、\LuaTeX-ja で提供される優先機能を最大限に活用するフォントメトリックを提供し、標準\cite{jlreq}に基づき、一部の高度な(すなわち、めったに使用されない)機能をサポートすることを目的としています。\段
%<ja> 本ドキュメントは、完全なものではありません。文法的な(および文脈的な)エラーが多数含まれている可能性があります。
-%<en> This documentation is going to introduce Evangelion Japanese Font Metric (hereinafter referred to as ``\textsf{Eva-JFM}''), a Japanese Font Metric for typesetting high quality Chinese and Japanese documents. It can be used with Traditional Chinese, Simplified Chinese and Japanese fonts for both vertically and horizontally typesetted texts. It aims to provide a font metric which makes full use of the \texttt{priority} feature (provided by \textsf{\LuaTeX-ja}), bases on the standard~\cite{jlreq}, and supports some advanced (a.k.a., rarely-used) features. The documentation is now written in both Chinese and English.\par
+%<en> This documentation is going to introduce Evangelion Japanese Font Metric (hereinafter referred to as ``\textsf{Eva-JFM}''), a Japanese Font Metric for typesetting high quality Chinese and Japanese documents. It can be used with Traditional Chinese, Simplified Chinese and Japanese fonts for both vertically and horizontally typesetted texts. It aims to provide a font metric which makes full use of the \texttt{priority} feature (provided by \textsf{\LuaTeX-ja}), bases on the standard~\cite{jlreq}, and supports some advanced (a.k.a., rarely-used) features. The documentation is now written in Chinese, Japanese and English.\par
%<en> This documentation is far from complete. It may have many grammatical (and contextual) errors.
\end{abstract}
diff --git a/macros/luatex/generic/evangelion-jfm/README.md b/macros/luatex/generic/evangelion-jfm/README.md
index 4141648b7b..87abb3e19f 100644
--- a/macros/luatex/generic/evangelion-jfm/README.md
+++ b/macros/luatex/generic/evangelion-jfm/README.md
@@ -42,12 +42,22 @@ This package is also available on [CTAN](https://www.ctan.org/pkg/evangelion-jfm
- 原始 調整なし Plain
+- 原始比例宽度 プロポーショナル(調整なし) Proportional (with no aki adjust for punct)
+
+- 比例宽度 プロポーショナル Proportional
+
## 状态・現在のバージョン・Current Version
-`Ver 1.0.4 (e)`
+`Ver 1.0.5 (b)`
## 历史・変更ログ・Changelog
+- 2023.8.25 Ver 1.0.5 (b): add feature `prop` and `propw` for japanese typesetting.
+
+- 2023.8.23 Ver 1.0.5 (a): add character `U+2E3A` and `U+2E3B` to be compatible with Source Han Fonts' ligatures.
+
+- 2023.8.3 Ver 1.0.4 (f): ''optimized'' the behaviour of TC punct at line end.
+
- 2023.5.19 Ver 1.0.4 (e): update japanese documentation and README.
- 2023.5.17 Ver 1.0.4 (c): sync the documentation (en&sc) for the new feature.
diff --git a/macros/luatex/generic/evangelion-jfm/jfm-eva.lua b/macros/luatex/generic/evangelion-jfm/jfm-eva.lua
index 632b4a85d7..502295772b 100644
--- a/macros/luatex/generic/evangelion-jfm/jfm-eva.lua
+++ b/macros/luatex/generic/evangelion-jfm/jfm-eva.lua
@@ -1,11 +1,11 @@
---- Evangelion Japanese Font Metric for LuaTeX
----- Current Version: 1.0.4 (e)
+---- Current Version: 1.0.5 (b)
---- Dev URL: https://github.com/RadioNoiseE/Evangelion-JFM
---- Copyright 2023, RadioNoiseE ©
-- 初始化
-local lang_jp, lang_tc, lang_sc, dir_vt, font_extd, punc_lg, punc_hg, std_nil, al_hw, al_fw, as_nil
+local lang_jp, lang_tc, lang_sc, dir_vt, font_extd, punc_lg, punc_hg, std_nil, al_hw, al_fw, as_nil, fw_prop, fw_xprop
if luatexja.jfont.jfm_feature then
lang_jp = luatexja.jfont.jfm_feature.jp
@@ -19,6 +19,8 @@ if luatexja.jfont.jfm_feature then
al_hw = luatexja.jfont.jfm_feature.hwid
al_fw = luatexja.jfont.jfm_feature.fwid
as_nil = luatexja.jfont.jfm_feature.plain
+ fw_prop = luatexja.jfont.jfm_feature.prop
+ fw_xprop = luatexja.jfont.jfm_feature.propw
end
-- 預處理及容錯
@@ -35,11 +37,19 @@ if punc_lg == true and dir_vt == false then
end
if al_hw == true and al_fw == true then
- tex.error('JFM feature "hwid" cannot be used with "fwid".')
+ tex.error('JFM feature "hwid" cannot be used with "fwid".\n' ..
+ 'For now I\'ll ignore both.')
luatexja.jfont.jfm_feature["hwid"] = nil
luatexja.jfont.jfm_feature["fwid"] = nil
end
+if fw_prop == true and fw_xprop == true then
+ tex.error('JFM feature "prop" cannot be used with "propw".\n' ..
+ 'For now I\'ll ignore both.')
+ luatexja.jfont.jfm_feature["prop"] = nil
+ luatexja.jfont.jfm_feature["propw"] = nil
+end
+
if not ((lang_jp and not (lang_tc or lang_sc)) or
(lang_tc and not (lang_jp or lang_sc)) or
(lang_sc and not (lang_jp or lang_tc))) then
@@ -47,7 +57,7 @@ if not ((lang_jp and not (lang_tc or lang_sc)) or
'"jp", "trad" or "smpl"\n' ..
'is required.\n' ..
'For now I\'ll use "lang_jp" for japanese by default.')
- luatexja.jfont.jfm_feature["hwid"] = nil
+ luatexja.jfont.jfm_feature["jp"] = "eva_langfeat_defl"
end
-- 壓縮比例設定
@@ -64,11 +74,21 @@ local function logic_anif(f1, f2, r1, r2)
return rta
end
+local function logic_orif(f1, f2, r1, r2)
+ local rto = (f1 or f2) and r1 or r2
+ return rto
+end
+
local function logic_if(f1, r1, r2)
local rti = f1 and r1 or r2
return rti
end
+local function context_width(regv)
+ local rtw = (fw_prop or fw_xprop) and 'prop' or (regv)
+ return rtw
+end
+
local function context_height()
local rth = dir_vt and (font_extd and extd_ratio/2 or 0.5) or 0.88
return rth
@@ -89,7 +109,7 @@ local eva = {
xkanjiskip = {0.25, 0.125, 0.125},
[0] = { -- 缺省類
- width = 1,
+ width = context_width(1),
height = context_height(),
depth = context_depth(),
italic = 0,
@@ -108,7 +128,7 @@ local eva = {
[1] = { -- 読点類
chars = logic_anif(dir_vt, punc_lg, {}, {'、', ','}),
- width = 0.5,
+ width = context_width(0.5),
height = context_height(),
depth = context_depth(),
italic = 0,
@@ -127,7 +147,7 @@ local eva = {
[8] = logic_if(lang_tc, {0.25, 0, 0.125}, {}),
[9] = logic_if(lang_tc, {0.5, 0, 0.25, priority = {0, -1}}, {0.75, 0, 0.25, ratio = 1/3, priority = {0, -1}})
},
- end_adjust = logic_if(lang_tc, {0.25, 0}, logic_if(punc_hg, {-0.5, 0.5, 0}, {0, 0}))
+ end_adjust = logic_if(lang_tc, {0.25, 0, 0.25}, logic_if(punc_hg, {-0.5, 0.5, 0}, {0, 0}))
},
[101] = { -- 読点類(行間a)
@@ -160,7 +180,7 @@ local eva = {
[2] = { -- 句點類
chars = logic_anif(dir_vt, punc_lg, {}, {'.', '。'}),
- width = 0.5,
+ width = context_width(0.5),
height = context_height(),
depth = context_depth(),
italic = 0,
@@ -179,7 +199,7 @@ local eva = {
[8] = logic_if(lang_tc, {0.25, 0, 0.125, ratio = 0}, {}),
[9] = logic_if(lang_tc, {0.5, 0, 0.25, priority = {0, -1}}, {0.75, 0, 0.25, ratio = 1/3, priority = {0, -1}})
},
- end_adjust = logic_if(lang_tc, {0.25, 0}, logic_if(punc_hg, {-0.5, 0.5, 0}, {0, 0}))
+ end_adjust = logic_if(lang_tc, {0.25, 0, 0.25}, logic_if(punc_hg, {-0.5, 0.5, 0}, {0, 0}))
},
[201] = { -- 句點類(行間a)
@@ -212,7 +232,7 @@ local eva = {
[3] = { -- 兩點類
chars = logic_if(lang_jp, {}, (logic_anif(dir_vt, punc_lg, {}, {':', ';'}))),
- width = logic_if(dir_vt, 1, 0.5),
+ width = context_width(logic_if(dir_vt, 1, 0.5)),
height = context_height(),
depth = context_depth(),
italic = 0,
@@ -268,7 +288,7 @@ local eva = {
'ョ', 'ヮ', 'ヵ', 'ヶ', 'ヽ', 'ヾ', 'ㇰ', 'ㇱ', 'ㇲ', 'ㇳ', 'ㇴ',
'ㇵ', 'ㇶ', 'ㇷ', 'ㇸ', 'ㇹ', 'ㇺ', 'ㇻ', 'ㇼ', 'ㇽ', 'ㇾ', 'ㇿ'
},
- width = 1,
+ width = context_width(1),
height = context_height(),
depth = context_depth(),
italic = 0,
@@ -286,7 +306,7 @@ local eva = {
[5] = { -- 疑問感嘆類
chars = {'!', '?', '‼︎', '⁉︎', '⁈', '⁇'},
- width = logic_if(dir_vt, 1, logic_if(lang_sc, 0.5, 1)),
+ width = context_width(logic_if(dir_vt, 1, logic_if(lang_sc, 0.5, 1))),
height = context_height(),
depth = context_depth(),
italic = 0,
@@ -307,7 +327,7 @@ local eva = {
[6] = { -- 分離禁止類
chars = {'—', '―', '‥', '…', '⋯', '〳', '〴', '〵'},
- width = 1,
+ width = context_width(1),
height = context_height(),
depth = context_depth(),
italic = 0,
@@ -326,9 +346,45 @@ local eva = {
}
},
+ [601] = { -- 二連字
+ chars = {'⸺'},
+ width = context_width(2),
+ height = context_height(),
+ depth = context_depth(),
+ italic = 0,
+ left = 0,
+ down = 0,
+ align = 'middle',
+ glue = {
+ [1] = logic_if(lang_tc, {0.25, 0, 0,125, ratio = 1}, {}),
+ [2] = logic_if(lang_tc, {0.25, 0, 0.125, ratio = 1}, {}),
+ [3] = logic_if(dir_vt, {priority = {0, -1}}, logic_if(lang_tc, {0.25, 0, 0.125, ratio = 1, priority = {0, -1}}, {priority = {0, -1}})),
+ [7] = {0.5, 0, 0.25, ratio = 1, priority = {-1, -2}},
+ [9] = {0.25, 0, 0.125, ratio = 1, priority = {0, -1}}
+ }
+ },
+
+ [602] = { -- 三連字
+ chars = {'⸻'},
+ width = context_width(3),
+ height = context_height(),
+ depth = context_depth(),
+ italic = 0,
+ left = 0,
+ down = 0,
+ align = 'middle',
+ glue = {
+ [1] = logic_if(lang_tc, {0.25, 0, 0,125, ratio = 1}, {}),
+ [2] = logic_if(lang_tc, {0.25, 0, 0.125, ratio = 1}, {}),
+ [3] = logic_if(dir_vt, {priority = {0, -1}}, logic_if(lang_tc, {0.25, 0, 0.125, ratio = 1, priority = {0, -1}}, {priority = {0, -1}})),
+ [7] = {0.5, 0, 0.25, ratio = 1, priority = {-1, -2}},
+ [9] = {0.25, 0, 0.125, ratio = 1, priority = {0, -1}}
+ }
+ },
+
[7] = { -- 開括號類
chars = {'(', '〔', '[', '{', '〈', '《', '「', '『', '【', '⦅', '〘', '〖', '〝', '‘', '“'},
- width = 0.5,
+ width = context_width(0.5),
height = context_height(),
depth = context_depth(),
italic = 0,
@@ -346,7 +402,7 @@ local eva = {
[8] = { -- 閉括號類
chars = {')', '〕', ']', '}', '〉', '》', '」', '』', '】', '⦆', '〙', '〗', '〟', '’', '”'},
- width = 0.5,
+ width = context_width(0.5),
height = context_height(),
depth = context_depth(),
italic = 0,
@@ -369,7 +425,7 @@ local eva = {
[9] = { -- 中點類
chars = logic_if(lang_jp, {'・', ':', ';'}, {'・', '·'}),
- width = 0.5,
+ width = context_width(0.5),
height = context_height(),
depth = context_depth(),
italic = 0,
@@ -388,7 +444,7 @@ local eva = {
[8] = {0.25, 0, 0.125, ratio = 0, priority = {0, -1}},
[9] = {0.5, 0, 0.25, priority = {0, -1}}
},
- end_adjust = {0.25, 0}
+ end_adjust = {0.25, 0, 0.25}
},
[10] = { -- 西文
@@ -409,7 +465,7 @@ local eva = {
[7] = {0, 0, 0}
}
}
-}
+}
if al_hw == true or al_fw == true then
eva[10].chars = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm',
@@ -428,10 +484,16 @@ if al_hw == true and al_fw == false then
eva[10].width = 0.5
end
-if al_fw == false and al_fw == true then
+if al_fw == false and al_hw == true then
eva[10].width = 1
end
+if fw_prop == true and fw_xprop == false then
+ for _, catnum in ipairs({0, 1, 101, 102, 2, 201, 202, 3, 301, 302, 4, 5, 6, 7, 8, 9, 10}) do
+ eva[catnum].glue = {}
+ end
+end
+
if sa_nil == true then
for _, catnum in ipairs({1, 101, 102, 2, 201, 202, 3, 301, 302, 4, 5, 6, 7, 8, 9, 10, 11}) do
eva[catnum] = nil
diff --git a/macros/luatex/generic/evangelion-jfm/makefile b/macros/luatex/generic/evangelion-jfm/makefile
new file mode 100644
index 0000000000..9107953de0
--- /dev/null
+++ b/macros/luatex/generic/evangelion-jfm/makefile
@@ -0,0 +1,15 @@
+doc-manu = Eva-JFM_doc-sc.tex Eva-JFM_doc-en.tex Eva-JFM_doc-jp.tex
+
+.PHONY : release
+release : Evangelion-JFM.dtx jfm-eva.lua
+ luatex Evangelion-JFM.dtx
+ lualatex Eva-JFM_doc-sc.tex
+ lualatex Eva-JFM_doc-sc.tex
+ latexmk -c Eva-JFM_doc-sc.tex
+ lualatex Eva-JFM_doc-jp.tex
+ lualatex Eva-JFM_doc-jp.tex
+ latexmk -c Eva-JFM_doc-jp.tex
+ lualatex Eva-JFM_doc-en.tex
+ lualatex Eva-JFM_doc-en.tex
+ latexmk -c Eva-JFM_doc-en.tex
+ rm $(doc-manu)