OSDN Git Service

Fix bug #33621.
[luatex-ja/luatexja.git] / src / jfm-ujis.lua
index 2470579..d957a2d 100644 (file)
@@ -1,22 +1,30 @@
 -- -*- coding: utf-8 -*-
 -- jfm-ujis.lua: LuaTeX-ja 標準 JFM
 -- based on upnmlminr-h.tfm (a metric in UTF/OTF package used by upTeX).
--- JIS X 4051:2004 では,行末の句読点や中点はベタ
+
+-- JIS X 4051:2004 では,行末の句読点や中点はベタなのでそれに従う
+-- kanjiskip:    0pt plus .25zw minus 0pt
+-- xkanjiskip: .25zw plus .25zw (or .0833zw) minus .125zw
+
 
 luatexja.jfont.define_jfm {
    dir = 'yoko',
    zw = 1.0, zh = 1.0,
-
+   kanjiskip =  {0.0, 0.25, 0},
+   xkanjiskip = {0.25, 0.25, .125},
    [0] = {
       align = 'left', left = 0.0, down = 0.0,
       width = 1.0, height = 0.88, depth = 0.12, italic=0.0,
       glue = {
-        [6] = {0, 0, 0},
+        -- [index] = { width, stretch, shrink, [priority, [ratio]] }
+        [1] = { 0.5 , 0.0, 0.5,  0, 1 },
         [2] = {0, 0, 0},
-        [102] = {0, 0, 0},
+        [3] = { 0.25, 0.0, 0.25, 1, 1 },
         [4] = {0, 0, 0},
-        [1] = { 0.5 , 0.0, 0.5  },
-        [3] = { 0.25, 0.0, 0.25, 1 }
+        [6] = {0, 0, 0},
+        [7] = {0, 0, 0},
+         [8] = {0, 0, 0},
+        [9] = {0, 0, 0},
       }
    },
 
@@ -28,48 +36,39 @@ luatexja.jfont.define_jfm {
       align = 'right', left = 0.0, down = 0.0,
       width = 0.5, height = 0.88, depth = 0.12, italic=0.0,
       glue = {
-        [6] = {0, 0, 0},
+-- 3 のみ四分,あとは0
+         [0] = {0, 0, 0},
+         [1] = {0, 0, 0},
         [2] = {0, 0, 0},
-        [102] = {0, 0, 0},
+        [3] = { 0.25, 0.0, 0.25, 1 },
         [4] = {0, 0, 0},
-        [3] = { 0.25, 0.0, 0.25, 1 }
+        [5] = {0, 0, 0},
+        [6] = {0, 0, 0},
+        [7] = {0, 0, 0},
+         [8] = {0, 0, 0},
+        [9] = {0, 0, 0},
       }
    },
 
    [2] = { -- 閉じ括弧類
       chars = {
         '’', '”', '〉', '》', '」', '』', '】', '〕', 
-        '〗', '〙', '〟', ')', ']', '}', '⦆', 
-      },
-      align = 'left', left = 0.0, down = 0.0,
-      width = 0.5, height = 0.88, depth = 0.12, italic=0.0,
-      glue = {
-        [0] = { 0.5 , 0.0, 0.5  },
-        [1] = { 0.5 , 0.0, 0.5  },
-        [3] = { 0.25, 0.0, 0.25, 1 },
-        [5] = { 0.5 , 0.0, 0.5  },
-        [6] = { 0.5 , 0.0, 0.5  },
-        [7] = { 0.5 , 0.0, 0.5  },
-        [8] = { 0.5 , 0.0, 0.5  },
-      }
-   },
-
-   [102] = { -- 読点類
-      chars = {
-        '、', ',*',
+        '〗', '〙', '〟', ')', ']', '}', '⦆', '、', ',*'
       },
       align = 'left', left = 0.0, down = 0.0,
       width = 0.5, height = 0.88, depth = 0.12, italic=0.0,
-      --end_shrink = 0.5,
-      --end_stretch = 0.5,
       glue = {
-        [0] = { 0.5 , 0.0, 0.5  },
-        [1] = { 0.5 , 0.0, 0.5  },
-        [3] = { 0.25, 0.0, 0.25, 1 },
-        [5] = { 0.5 , 0.0, 0.5  },
-        [6] = { 0.5 , 0.0, 0.5  },
-        [7] = { 0.5 , 0.0, 0.5  },
-        [8] = { 0.5 , 0.0, 0.5  },
+-- 3 は四分, 2, 4, 9 は0, あとは0.5
+        [0] = { 0.5 , 0.0, 0.5, 0, -1 },
+        [1] = { 0.5 , 0.0, 0.5, 0, -1 },
+         [2] = {0, 0, 0},
+        [3] = { 0.25, 0.0, 0.25, 1, 1 },
+         [4] = {0, 0, 0},
+        [5] = { 0.5 , 0.0, 0.5, 0, -1 },
+        [6] = { 0.5 , 0.0, 0.5, 0, -1 },
+        [7] = { 0.5 , 0.0, 0.5, 0, -1 },
+        [8] = { 0.5 , 0.0, 0.5, 0, -1 },
+         [9] = {0, 0, 0},
       }
    },
 
@@ -79,16 +78,17 @@ luatexja.jfont.define_jfm {
       width = 0.5, height = 0.88, depth = 0.12, italic=0.0,
       --end_stretch = 0.25,
       glue = {
-        [0] = { 0.25, 0.0, 0.25, 1 },
-        [1] = { 0.25, 0.0, 0.25, 1 },
-        [2] = { 0.25, 0.0, 0.25, 1 },
-        [102] = { 0.25, 0.0, 0.25, 1 },
-        [3] = { 0.5 , 0.0, 0.5 , 1 },
-        [4] = { 0.25, 0.0, 0.25, 1 },
-        [5] = { 0.25, 0.0, 0.25, 1 },
-        [6] = { 0.25, 0.0, 0.25, 1 },
-        [7] = { 0.25, 0.0, 0.25, 1 },
-        [8] = { 0.25, 0.0, 0.25, 1 },
+-- 3 のみ 0.5,あとは0.25
+        [0] = { 0.25, 0.0, 0.25, 1, 1 },
+        [1] = { 0.25, 0.0, 0.25, 1, 1 },
+        [2] = { 0.25, 0.0, 0.25, 1, 1 },
+        [3] = { 0.5 , 0.0, 0.5 , 1, 0 },
+        [4] = { 0.25, 0.0, 0.25, 1, 1 },
+        [5] = { 0.25, 0.0, 0.25, 1, 1 },
+        [6] = { 0.25, 0.0, 0.25, 1, 1 },
+        [7] = { 0.25, 0.0, 0.25, 1, 1 },
+        [8] = { 0.25, 0.0, 0.25, 1, 1 },
+        [9] = { 0.25, 0.0, 0.25, 1, 1 },
       }
    },
 
@@ -96,30 +96,30 @@ luatexja.jfont.define_jfm {
       chars = {'。', '.'},
       align = 'left', left = 0.0, down = 0.0,
       width = 0.5, height = 0.88, depth = 0.12, italic=0.0,
-      --end_shrink = 0.5,
-      --end_stretch = 0.5,
       glue = {
-        [0] = { 0.5 , 0.0, 0.0  },
-        [1] = { 0.5 , 0.0, 0.0  },
-        [3] = { 0.75, 0.0, 0.25, 1 },
-        [5] = { 0.5 , 0.0, 0.0  },
-        [6] = { 0.5 , 0.0, 0.0  },
-        [7] = { 0.5 , 0.0, 0.0  },
-        [8] = { 0.5 , 0.0, 0.0  },
+-- 3 は.75, 2, 4 は0, あとは0.5
+        [0] = { 0.5 , 0.0, 0.5, 0, -1 },
+        [1] = { 0.5 , 0.0, 0.5, 0, -1 },
+        [3] = { 0.75, 0.0, 0.25, 1, -1/3 },
+        [5] = { 0.5 , 0.0, 0.5, 0, -1 },
+        [6] = { 0.5 , 0.0, 0.5, 0, -1 },
+        [7] = { 0.5 , 0.0, 0.5, 0, -1 },
+        [8] = { 0.5 , 0.0, 0.5, 0, -1 },
+         [9] = { 0.5 , 0.0, 0.5, 0, -1 },
       }
    },
 
    [5] = { -- ダッシュ
-      chars = { '—', '―', '‥', '…' },
+      chars = { '—', '―', '‥', '…', '〳', '〴', '〵', },
       align = 'left', left = 0.0, down = 0.0,
       width = 1.0, height = 0.88, depth = 0.12, italic=0.0,
       glue = {
-        [6] = {0, 0, 0},
+        [1] = { 0.5 , 0.0, 0.5, 0, 1 },
         [2] = {0, 0, 0},
-        [102] = {0, 0, 0},
+        [3] = { 0.25, 0.0, 0.25, 1, 1 },
         [4] = {0, 0, 0},
-        [1] = { 0.5 , 0.0, 0.5  },
-        [3] = { 0.25, 0.0, 0.25, 1 }
+        [6] = {0, 0, 0},
+        [9] = {0, 0, 0},
       },
       kern = {
         [5] = 0.0
@@ -127,22 +127,22 @@ luatexja.jfont.define_jfm {
    },
 
    [6] = { -- 感嘆符・疑問符
-      chars = { '?', '!' },
+      chars = { '?', '!', '‼', '⁇', '⁈', '⁉', },
       align = 'left', left = 0.0, down = 0.0,
       width = 1.0, height = 0.88, depth = 0.12, italic=0.0,
       glue = {
-        [6] = {0, 0, 0},
+         [0] = { 0.5 , 0.0, 0.5, 0, 1 },
+        [1] = { 0.5 , 0.0, 0.5, 0, 1 },
         [2] = {0, 0, 0},
-        [102] = {0, 0, 0},
+        [3] = { 0.75, 0.0, 0.25, 1, 1 },
         [4] = {0, 0, 0},
-        [0] = { 0.5 , 0.0, 0.5  },
-        [1] = { 0.5 , 0.0, 0.5  },
-        [3] = { 0.25, 0.0, 0.25, 1 },
-        [7] = { 0.5 , 0.0, 0.5  },
+        [6] = {0, 0, 0},
+        [7] = { 0.5 , 0.0, 0.5, 0, 1 },
+        [8] = {0, 0, 0},
+        [9] = {0, 0, 0},
       },
       kern = {
-        [5] = 0.0,
-        [8] = 0.0
+        [5] = 0.0
       }
    },
 
@@ -171,12 +171,14 @@ luatexja.jfont.define_jfm {
       align = 'left', left = 0.0, down = 0.0,
       width = 0.5, height = 0.88, depth = 0.12, italic=0.0,      
       glue = {
-        [6] = {0, 0, 0},
+        [1] = { 0.5 , 0.0, 0.5, 0, 1 },
         [2] = {0, 0, 0},
-        [102] = {0, 0, 0},
+        [3] = { 0.25, 0.0, 0.25, 1, 1 },
         [4] = {0, 0, 0},
-        [1] = { 0.5 , 0.0, 0.5  },
-        [3] = { 0.25, 0.0, 0.25, 1 }
+        [6] = {0, 0, 0},
+        [7] = {0, 0, 0},
+         [8] = {0, 0, 0},
+        [9] = {0, 0, 0},
       }
    },
 
@@ -202,18 +204,39 @@ luatexja.jfont.define_jfm {
       align = 'left', left = 0.0, down = 0.0,
       width = 1.0, height = 0.88, depth = 0.12, italic=0.0,
       glue = {
-        [6] = {0, 0, 0},
+        [1] = { 0.5 , 0.0, 0.5, 0, 1 },
         [2] = {0, 0, 0},
-        [102] = {0, 0, 0},
+        [3] = { 0.25, 0.0, 0.25, 1, 1 },
         [4] = {0, 0, 0},
-        [1] = { 0.5 , 0.0, 0.5  },
-        [3] = { 0.25, 0.0, 0.25, 1 }
+        [6] = {0, 0, 0},
+        [9] = {0, 0, 0},
       },
       kern = {
         [8] = 0.0
       }
    },
 
+   [9] = { -- 和字間隔
+      chars = {
+        ' '
+      },
+      align = 'left', left = 0.0, down = 0.0,
+      width = 1.0, height = 0.88, depth = 0.12, italic=0.0,
+      glue = {
+         [0] = {0, 0, 0}, 
+         [1] = {0, 0, 0}, 
+         [2] = {0, 0, 0}, 
+        [3] = { 0.25, 0.0, 0.25, 1 },
+         [4] = {0, 0, 0}, 
+         [5] = {0, 0, 0}, 
+         [6] = {0, 0, 0}, 
+         [7] = {0, 0, 0}, 
+         [8] = {0, 0, 0}, 
+         [9] = {0, 0, 0}, 
+      },
+   },
+
+
    [99] = { -- box末尾
       chars = {'boxbdd', 'parbdd'},
       glue = {
@@ -221,4 +244,4 @@ luatexja.jfont.define_jfm {
       }
    },
 
-}
\ No newline at end of file
+}