OSDN Git Service

行末文字の位置調整も追加.
[luatex-ja/luatexja.git] / src / jfm-ujis.lua
index d2cd13b..2470579 100644 (file)
@@ -1,6 +1,7 @@
 -- -*- 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 では,行末の句読点や中点はベタ
 
 luatexja.jfont.define_jfm {
    dir = 'yoko',
@@ -10,8 +11,12 @@ 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},
+        [2] = {0, 0, 0},
+        [102] = {0, 0, 0},
+        [4] = {0, 0, 0},
         [1] = { 0.5 , 0.0, 0.5  },
-        [3] = { 0.25, 0.0, 0.25 }
+        [3] = { 0.25, 0.0, 0.25, 1 }
       }
    },
 
@@ -23,21 +28,44 @@ 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 = {
-        [3] = { 0.25, 0.0, 0.25 }
+        [6] = {0, 0, 0},
+        [2] = {0, 0, 0},
+        [102] = {0, 0, 0},
+        [4] = {0, 0, 0},
+        [3] = { 0.25, 0.0, 0.25, 1 }
       }
    },
 
    [2] = { -- 閉じ括弧類
       chars = {
-        'â\80\99', 'â\80\9d', 'ã\80\81', 'ã\80\89', 'ã\80\8b', 'ã\80\8d', 'ã\80\8f', 'ã\80\91', 'ã\80\95', 
-        'ã\80\97', 'ã\80\99', 'ã\80\9f', 'ï¼\89', 'ï¼\8c*', 'ï¼½', 'ï½\9d', 'ï½ ', 
+        '’', '”', '〉', '》', '」', '』', '】', '〕', 
+        '〗', '〙', '〟', ')', ']', '}', '⦆', 
       },
       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 },
+        [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  },
@@ -49,16 +77,18 @@ luatexja.jfont.define_jfm {
       chars = {'・', ':', ';'},
       align = 'middle', left = 0.0, down = 0.0,
       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] = { 0.25, 0.0, 0.25 },
-        [2] = { 0.25, 0.0, 0.25 },
-        [3] = { 0.5 , 0.0, 0.5  },
-        [4] = { 0.25, 0.0, 0.25 },
-        [5] = { 0.25, 0.0, 0.25 },
-        [6] = { 0.25, 0.0, 0.25 },
-        [7] = { 0.25, 0.0, 0.25 },
-        [8] = { 0.25, 0.0, 0.25 },
+        [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 },
       }
    },
 
@@ -66,10 +96,12 @@ 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 },
+        [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  },
@@ -82,8 +114,12 @@ 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},
+        [2] = {0, 0, 0},
+        [102] = {0, 0, 0},
+        [4] = {0, 0, 0},
         [1] = { 0.5 , 0.0, 0.5  },
-        [3] = { 0.25, 0.0, 0.25 }
+        [3] = { 0.25, 0.0, 0.25, 1 }
       },
       kern = {
         [5] = 0.0
@@ -95,9 +131,13 @@ 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},
+        [2] = {0, 0, 0},
+        [102] = {0, 0, 0},
+        [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 },
+        [3] = { 0.25, 0.0, 0.25, 1 },
         [7] = { 0.5 , 0.0, 0.5  },
       },
       kern = {
@@ -131,8 +171,12 @@ 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},
+        [2] = {0, 0, 0},
+        [102] = {0, 0, 0},
+        [4] = {0, 0, 0},
         [1] = { 0.5 , 0.0, 0.5  },
-        [3] = { 0.25, 0.0, 0.25 }
+        [3] = { 0.25, 0.0, 0.25, 1 }
       }
    },
 
@@ -158,8 +202,12 @@ 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},
+        [2] = {0, 0, 0},
+        [102] = {0, 0, 0},
+        [4] = {0, 0, 0},
         [1] = { 0.5 , 0.0, 0.5  },
-        [3] = { 0.25, 0.0, 0.25 }
+        [3] = { 0.25, 0.0, 0.25, 1 }
       },
       kern = {
         [8] = 0.0
@@ -169,7 +217,7 @@ luatexja.jfont.define_jfm {
    [99] = { -- box末尾
       chars = {'boxbdd', 'parbdd'},
       glue = {
-        [3] = { 0.25, 0.0, 0.25 },
+        [3] = { 0.25, 0.0, 0.25, 1 },
       }
    },