OSDN Git Service

Changed the syntax of JFM file (but the old way is still supported)
[luatex-ja/luatexja.git] / src / jfm-ujis.lua
1 -- -*- coding: utf-8 -*-
2 -- jfm-ujis.lua: LuaTeX-ja 標準 JFM
3 -- based on upnmlminr-h.tfm (a metric in UTF/OTF package used by upTeX).
4
5 -- JIS X 4051:2004 では,行末の句読点や中点はベタなのでそれに従う
6 -- kanjiskip:    0pt plus .25zw minus 0pt
7 -- xkanjiskip: .25zw plus .25zw (or .0833zw) minus .125zw
8
9
10 luatexja.jfont.define_jfm {
11    dir = 'yoko',
12    zw = 1.0, zh = 1.0,
13    kanjiskip =  { 0.0, 0.25, 0 },
14    xkanjiskip = { 0.25, 0.25, .125 },
15    [0] = {
16       align = 'left', left = 0.0, down = 0.0,
17       width = 1.0, height = 0.88, depth = 0.12, italic=0.0,
18       glue = {
19          -- [index] = { width, stretch, shrink, [priority, [ratio]],
20          --             ksp_nat=t/f, ksp_stretch=t/f, ksp_shrink=t/f }
21          [1] = { 0.5 , 0.0, 0.5, rario=1, ksp_stretch=true },
22          [2] = { 0, 0, 0, ksp_shrink=true },
23          [3] = { 0.25, 0.0, 0.25, priority=1, ratio=1 },
24          [4] = { 0, 0, 0, ksp_shrink=true },
25          [6] = { 0, 0, 0, ksp_shrink=true },
26          [7] = { 0, 0, 0, ksp_shrink=true },
27          [8] = { 0, 0, 0, ksp_shrink=true },
28          [99] = { 0, 0, 0 },
29       }
30    },
31
32    [1] = { -- 開き括弧類
33       chars = {
34          '‘', '“', '〈', '《', '「', '『', '【', '〔', '〖',
35          '〘', '〝', '(', '[', '{', '⦅'
36       },
37       align = 'right', left = 0.0, down = 0.0,
38       width = 0.5, height = 0.88, depth = 0.12, italic=0.0,
39       glue = {
40 -- 3 のみ四分,あとは0
41          [0] = { 0, 0, 0, ksp_shrink=true },
42          [1] = { 0, 0, 0, ksp_shrink=true },
43          [2] = { 0, 0, 0, ksp_shrink=true },
44          [3] = { 0.25, 0.0, 0.25, priority=1 },
45          [4] = { 0, 0, 0, ksp_shrink=true },
46          [5] = { 0, 0, 0, ksp_shrink=true },
47          [6] = { 0, 0, 0, ksp_shrink=true },
48          [7] = { 0, 0, 0, ksp_shrink=true },
49          [8] = { 0, 0, 0, ksp_shrink=true },
50          [99] = { 0, 0, 0 },
51       }
52    },
53
54    [2] = { -- 閉じ括弧類
55       chars = {
56          '’', '”', '〉', '》', '」', '』', '】', '〕',
57          '〗', '〙', '〟', ')', ']', '}', '⦆', '、', ',*'
58       },
59       align = 'left', left = 0.0, down = 0.0,
60       width = 0.5, height = 0.88, depth = 0.12, italic=0.0,
61       glue = {
62 -- 3 は四分, 2, 4, 9 は0, あとは0.5
63          [0] = { 0.5 , 0.0, 0.5, rario=0, ksp_stretch=true },
64          [1] = { 0.5 , 0.0, 0.5, ratio=0, ksp_stretch=true },
65          [2] = { 0, 0, 0, ksp_shrink=true},
66          [3] = { 0.25, 0.0, 0.25, priority=1, ratio=1 },
67          [4] = { 0, 0, 0, ksp_shrink=true },
68          [5] = { 0.5 , 0.0, 0.5, ratio=0, ksp_stretch=true },
69          [6] = { 0.5 , 0.0, 0.5, ratio=0, ksp_stretch=true },
70          [7] = { 0.5 , 0.0, 0.5, ratio=0, ksp_stretch=true },
71          [8] = { 0.5 , 0.0, 0.5, ratio=0, ksp_stretch=true },
72          [99] = { 0, 0, 0 },
73       }
74    },
75
76    [3] = { -- 中点類
77       chars = {'・', ':', ';'},
78       align = 'middle', left = 0.0, down = 0.0,
79       width = 0.5, height = 0.88, depth = 0.12, italic=0.0,
80       --end_stretch = 0.25,
81       glue = {
82 -- 3 のみ 0.5,あとは0.25
83          [0] = { 0.25, 0.0, 0.25, priority=1, ratio=1 },
84          [1] = { 0.25, 0.0, 0.25, priority=1, ratio=1 },
85          [2] = { 0.25, 0.0, 0.25, priority=1, ratio=1 },
86          [3] = { 0.5 , 0.0, 0.5 , priority=1 },
87          [4] = { 0.25, 0.0, 0.25, priority=1, ratio=1 },
88          [5] = { 0.25, 0.0, 0.25, priority=1, ratio=1 },
89          [6] = { 0.25, 0.0, 0.25, priority=1, ratio=1 },
90          [7] = { 0.25, 0.0, 0.25, priority=1, ratio=1 },
91          [8] = { 0.25, 0.0, 0.25, priority=1, ratio=1 },
92          [99] = { 0.25, 0.0, 0.25, priority=1, ratio=1 },
93       }
94    },
95
96    [4] = { -- 句点類
97       chars = {'。', '.'},
98       align = 'left', left = 0.0, down = 0.0,
99       width = 0.5, height = 0.88, depth = 0.12, italic=0.0,
100       glue = {
101 -- 3 は.75, 2, 4 は0, あとは0.5
102          [0] = { 0.5 , 0.0, 0.5, ratio=0, ksp_stretch=true },
103          [1] = { 0.5 , 0.0, 0.5, ratio=0, ksp_stretch=true },
104          [3] = { 0.75, 0.0, 0.25, priority=1, ratio=1/3, ksp_stretch=true },
105          [5] = { 0.5 , 0.0, 0.5, ratio=0, ksp_stretch=true },
106          [6] = { 0.5 , 0.0, 0.5, ratio=0, ksp_stretch=true },
107          [7] = { 0.5 , 0.0, 0.5, ratio=0, ksp_stretch=true },
108          [8] = { 0.5 , 0.0, 0.5, ratio=0, ksp_stretch=true },
109          [99] = { 0.5 , 0.0, 0.5, ratio=0, ksp_stretch=true },
110       }
111    },
112
113    [5] = { -- ダッシュ
114       chars = { '—', '―', '‥', '…', '〳', '〴', '〵', },
115       align = 'left', left = 0.0, down = 0.0,
116       width = 1.0, height = 0.88, depth = 0.12, italic=0.0,
117       glue = {
118          [1] = { 0.5 , 0.0, 0.5, ratio=1, ksp_stretch=true },
119          [2] = { 0, 0, 0, ksp_shrink=true },
120          [3] = { 0.25, 0.0, 0.25, priority=1, ratio=1 },
121          [4] = { 0, 0, 0, ksp_shrink=true },
122          [6] = { 0, 0, 0, ksp_shrink=true },
123          [99] = { 0, 0, 0 },
124       },
125       kern = {
126          [5] = 0.0
127       }
128    },
129
130    [6] = { -- 感嘆符・疑問符
131       chars = { '?', '!', '‼', '⁇', '⁈', '⁉', },
132       align = 'left', left = 0.0, down = 0.0,
133       width = 1.0, height = 0.88, depth = 0.12, italic=0.0,
134       glue = {
135          [0] = { 0.5 , 0.0, 0.5, ratio=1, ksp_stretch=true },
136          [1] = { 0.5 , 0.0, 0.5, ratio=1, ksp_stretch=true },
137          [2] = { 0, 0, 0, ksp_shrink=true },
138          [3] = { 0.75, 0.0, 0.25, priority=1, ratio=1 },
139          [4] = { 0, 0, 0, ksp_shrink=true },
140          [6] = { 0, 0, 0, ksp_shrink=true },
141          [7] = { 0.5 , 0.0, 0.5, ratio=1, ksp_stretch=true },
142          [8] = { 0, 0, 0, ksp_shrink=true },
143          [99] = { 0, 0, 0 },
144       },
145       kern = {
146          [5] = 0.0
147       }
148    },
149
150    [7] = { -- 半角カナ
151       chars = {
152          '。', '「', '」', '、', '・', 'ヲ', 'ァ', 'ィ', 'ゥ',
153          'ェ', 'ォ', 'ャ', 'ュ', 'ョ', 'ッ', 'ー', 'ア', 'イ',
154          'ウ', 'エ', 'オ', 'カ', 'キ', 'ク', 'ケ', 'コ', 'サ',
155          'シ', 'ス', 'セ', 'ソ', 'タ', 'チ', 'ツ', 'テ', 'ト',
156          'ナ', 'ニ', 'ヌ', 'ネ', 'ノ', 'ハ', 'ヒ', 'フ', 'ヘ',
157          'ホ', 'マ', 'ミ', 'ム', 'メ', 'モ', 'ヤ', 'ユ', 'ヨ',
158          'ラ', 'リ', 'ル', 'レ', 'ロ', 'ワ', 'ン', '゙', '゚',
159          "AJ1-516", "AJ1-517", "AJ1-518", "AJ1-519", "AJ1-520", "AJ1-521", "AJ1-522",
160          "AJ1-523", "AJ1-524", "AJ1-525", "AJ1-526", "AJ1-527", "AJ1-528", "AJ1-529",
161          "AJ1-530", "AJ1-531", "AJ1-532", "AJ1-533", "AJ1-534", "AJ1-535", "AJ1-536",
162          "AJ1-537", "AJ1-538", "AJ1-539", "AJ1-540", "AJ1-541", "AJ1-542", "AJ1-543",
163          "AJ1-544", "AJ1-545", "AJ1-546", "AJ1-547", "AJ1-548", "AJ1-549", "AJ1-550",
164          "AJ1-551", "AJ1-552", "AJ1-553", "AJ1-554", "AJ1-555", "AJ1-556", "AJ1-557",
165          "AJ1-558", "AJ1-559", "AJ1-560", "AJ1-561", "AJ1-562", "AJ1-563", "AJ1-564",
166          "AJ1-565", "AJ1-566", "AJ1-567", "AJ1-568", "AJ1-569", "AJ1-570", "AJ1-571",
167          "AJ1-572", "AJ1-573", "AJ1-574", "AJ1-575", "AJ1-576", "AJ1-577", "AJ1-578",
168          "AJ1-579", "AJ1-580", "AJ1-581", "AJ1-582", "AJ1-583", "AJ1-584", "AJ1-585",
169          "AJ1-586", "AJ1-587", "AJ1-588", "AJ1-589", "AJ1-590", "AJ1-591", "AJ1-592",
170          "AJ1-593", "AJ1-594", "AJ1-595", "AJ1-596", "AJ1-597", "AJ1-598",
171       },
172       align = 'left', left = 0.0, down = 0.0,
173       width = 0.5, height = 0.88, depth = 0.12, italic=0.0,
174       glue = {
175          [1] = { 0.5 , 0.0, 0.5, ratio=1, ksp_stretch=true },
176          [2] = { 0, 0, 0, ksp_shrink=true },
177          [3] = { 0.25, 0.0, 0.25, priority=1, ratio=1 },
178          [4] = { 0, 0, 0, ksp_shrink=true },
179          [6] = { 0, 0, 0, ksp_shrink=true},
180          [7] = { 0, 0, 0, ksp_shrink=true },
181          [8] = { 0, 0, 0, ksp_shrink=true},
182          [99] = { 0, 0, 0 },
183       }
184    },
185
186    [8] = { -- 罫線類.
187       chars = {
188          '─', '━', '│', '┃', '┄', '┅', '┆', '┇',
189          '┈', '┉', '┊', '┋', '┌', '┍', '┎', '┏',
190          '┐', '┑', '┒', '┓', '└', '┕', '┖', '┗',
191          '┘', '┙', '┚', '┛', '├', '┝', '┞', '┟',
192          '┠', '┡', '┢', '┣', '┤', '┥', '┦', '┧',
193          '┨', '┩', '┪', '┫', '┬', '┭', '┮', '┯',
194          '┰', '┱', '┲', '┳', '┴', '┵', '┶', '┷',
195          '┸', '┹', '┺', '┻', '┼', '┽', '┾', '┿',
196          '╀', '╁', '╂', '╃', '╄', '╅', '╆', '╇',
197          '╈', '╉', '╊', '╋', '╌', '╍', '╎', '╏',
198          '═', '║', '╒', '╓', '╔', '╕', '╖', '╗',
199          '╘', '╙', '╚', '╛', '╜', '╝', '╞', '╟',
200          '╠', '╡', '╢', '╣', '╤', '╥', '╦', '╧',
201          '╨', '╩', '╪', '╫', '╬', '╭', '╮', '╯',
202          '╰', '╱', '╲', '╳', '╴', '╵', '╶', '╷',
203          '╸', '╹', '╺', '╻', '╼', '╽', '╾', '╿',
204       },
205       align = 'left', left = 0.0, down = 0.0,
206       width = 1.0, height = 0.88, depth = 0.12, italic=0.0,
207       glue = {
208          [1] = { 0.5 , 0.0, 0.5, 0, 1, ksp_stretch=true },
209          [2] = { 0, 0, 0, ksp_shrink=true },
210          [3] = { 0.25, 0.0, 0.25, 1, 1 },
211          [4] = { 0, 0, 0, ksp_shrink=true },
212          [6] = { 0, 0, 0, ksp_shrink=true },
213          [99] = {0, 0, 0},
214       },
215       kern = {
216          [8] = 0.0
217       }
218    },
219
220
221    [99] = { -- box末尾
222       chars = {'boxbdd', 'parbdd'},
223       glue = {
224          [3] = { 0.25, 0.0, 0.25, priority=1 },
225       }
226    },
227
228 }