From: Hironori Kitagawa Date: Thu, 1 Mar 2012 20:46:03 +0000 (+0900) Subject: Metrics for Chinese fonts, by MaQiYuan and SuJie. X-Git-Tag: 20120419.0~14^2 X-Git-Url: http://git.osdn.jp/view?a=commitdiff_plain;ds=sidebyside;h=e0db143401ae56f575db3e1c5b9637e601ae1f6f;hp=b031cd2a66bfec925fd6b22bf26781b00c45146b;p=luatex-ja%2Fluatexja.git Metrics for Chinese fonts, by MaQiYuan and SuJie. > Here is a initial version of Chinese font metrics tested by MaQiYuan and SuJie. > This version can works well with Chinese on normal Chinese texts. > We are now collecting more sentences to test our metrics. new file: jfm-banjiao.lua new file: jfm-kaiming.lua modified: jfm-quanjiao.lua new file: metrics-test-zh.pdf new file: metrics-test-zh.tex --- diff --git a/test/zh/jfm-banjiao.lua b/test/zh/jfm-banjiao.lua new file mode 100644 index 0000000..783e836 --- /dev/null +++ b/test/zh/jfm-banjiao.lua @@ -0,0 +1,98 @@ +luatexja.jfont.define_jfm { + dir = 'yoko', + zw = 1.0, zh = 1.0, + + [0] = { + align = 'left', left = 0.0, down = 0.0, + width = 1.0, height = 0.88, depth = 0.12, italic=0.0, + glue = { + --[1] = { 0.5 , 0.0, 0.5 }, + [3] = { 0.125, 0.0, 0.125 } + } + }, + + [1] = { -- fw. opening punctuations + chars = { + 0x2018, 0x201C, 0x3008, 0x300A, 0x300C, 0x300E, 0x3010, 0x3014, 0x3016, + 0x3018, 0x301D, 0xFF08, 0xFF3B, 0xFF5B, 0xFF5F + }, + 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 } + } + }, + + [2] = { -- fw. closing/colon/dot punctuations, except 4 & 7 + chars = { + 0x2019, 0x201D, 0x3009, 0x300B, 0x300D, 0x300F, 0x3011, 0x3015, + 0x3017, 0x3019, 0x301F, 0xFF09, 0xFF0C, 0xFF3D, 0xFF5D, 0xFF60, + 0xFF0E, 0xFF1A, 0xFF1B, 0xFF01, 0xFF1F + }, + 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.125, 0.0, 0.125 }, + [5] = { 0.5 , 0.0, 0.5 } + } + }, + + [3] = { -- fw. middle dot punctuations + chars = {0x30FB, 0x00B7}, + align = 'middle', left = 0.0, down = 0.0, + width = 0.5, height = 0.88, depth = 0.12, italic=0.0, + glue = { + [0] = { 0.125, 0.0, 0.125 }, + [1] = { 0.125, 0.0, 0.125 }, + [2] = { 0.125, 0.0, 0.125 }, + [3] = { 0.5 , 0.0, 0.5 }, + [4] = { 0.25, 0.0, 0.25 }, + [5] = { 0.25, 0.0, 0.25 }, + [7] = { 0.25, 0.0, 0.25 } + } + }, + + [4] = { -- ideographic full stop + chars = {0x3002}, + 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.0 }, + [1] = { 0.5 , 0.0, 0.0 }, + [3] = { 0.75, 0.0, 0.25 }, + [5] = { 0.5 , 0.0, 0.0 } + } + }, + + [5] = { -- fw. dash punctuations + chars = { 0x2015, 0x2025, 0x2026, 0x2014, 0x301C, 0xFF5E }, + align = 'left', left = 0.0, down = 0.0, + width = 1.0, height = 0.88, depth = 0.12, italic=0.0, + glue = { + [1] = { 0.5 , 0.0, 0.5 }, + [3] = { 0.25, 0.0, 0.25 } + }, + kern = { + [5] = 0.0 + } + }, + + [6] = { -- box end + chars = {'boxbdd'}, + }, + + [7] = { -- ideographic comma + chars = {0x3001}, + 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.25 }, + [1] = { 0.5 , 0.0, 0.25 }, + [3] = { 0.25, 0.0, 0.25 }, + [5] = { 0.5 , 0.0, 0.25 } + } + }, + +} diff --git a/test/zh/jfm-kaiming.lua b/test/zh/jfm-kaiming.lua new file mode 100644 index 0000000..cb166ec --- /dev/null +++ b/test/zh/jfm-kaiming.lua @@ -0,0 +1,98 @@ +luatexja.jfont.define_jfm { + dir = 'yoko', + zw = 1.0, zh = 1.0, + + [0] = { + align = 'left', left = 0.0, down = 0.0, + width = 1.0, height = 0.88, depth = 0.12, italic=0.0, + glue = { + --[1] = { 0.5 , 0.0, 0.5 }, + [3] = { 0.125, 0.0, 0.125 } + } + }, + + [1] = { -- fw. opening punctuations + chars = { + 0x2018, 0x201C, 0x3008, 0x300A, 0x300C, 0x300E, 0x3010, 0x3014, 0x3016, + 0x3018, 0x301D, 0xFF08, 0xFF3B, 0xFF5B, 0xFF5F + }, + 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 } + } + }, + + [2] = { -- fw. closing/colon/dot punctuations, except 4 & 7 + chars = { + 0x2019, 0x201D, 0x3009, 0x300B, 0x300D, 0x300F, 0x3011, 0x3015, + 0x3017, 0x3019, 0x301F, 0xFF09, 0xFF0C, 0xFF3D, 0xFF5D, 0xFF60, + 0xFF0E, 0xFF1A, 0xFF1B + }, + 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.125, 0.0, 0.125 }, + [5] = { 0.5 , 0.0, 0.5 } + } + }, + + [3] = { -- fw. middle dot punctuations + chars = {0x30FB, 0x00B7}, + align = 'middle', left = 0.0, down = 0.0, + width = 0.5, height = 0.88, depth = 0.12, italic=0.0, + glue = { + [0] = { 0.125, 0.0, 0.125 }, + [1] = { 0.125, 0.0, 0.125 }, + [2] = { 0.125, 0.0, 0.125 }, + [3] = { 0.5 , 0.0, 0.5 }, + [4] = { 0.25, 0.0, 0.25 }, + [5] = { 0.25, 0.0, 0.25 }, + [7] = { 0.25, 0.0, 0.25 } + } + }, + + [4] = { -- ideographic full stop + chars = {0x3002, 0xFF1F, 0xFF01}, + 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.0 }, + [1] = { 0.5 , 0.0, 0.0 }, + [3] = { 0.75, 0.0, 0.25 }, + [5] = { 0.5 , 0.0, 0.0 } + } + }, + + [5] = { -- fw. dash punctuations + chars = { 0x2015, 0x2025, 0x2026, 0x2014, 0x301C, 0xFF5E }, + align = 'left', left = 0.0, down = 0.0, + width = 1.0, height = 0.88, depth = 0.12, italic=0.0, + glue = { + [1] = { 0.5 , 0.0, 0.5 }, + [3] = { 0.25, 0.0, 0.25 } + }, + kern = { + [5] = 0.0 + } + }, + + [6] = { -- box end + chars = {'boxbdd'}, + }, + + [7] = { -- ideographic comma + chars = {0x3001}, + 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.25 }, + [1] = { 0.5 , 0.0, 0.25 }, + [3] = { 0.25, 0.0, 0.25 }, + [5] = { 0.5 , 0.0, 0.25 } + } + }, + +} diff --git a/test/zh/jfm-quanjiao.lua b/test/zh/jfm-quanjiao.lua index b2e7254..20590b6 100644 --- a/test/zh/jfm-quanjiao.lua +++ b/test/zh/jfm-quanjiao.lua @@ -1,4 +1,4 @@ -ltj.define_jfm { +luatexja.jfont.define_jfm { dir = 'yoko', zw = 1.0, zh = 1.0, @@ -95,4 +95,4 @@ ltj.define_jfm { } }, -} \ No newline at end of file +} diff --git a/test/zh/metrics-test-zh.pdf b/test/zh/metrics-test-zh.pdf new file mode 100644 index 0000000..86dfbac Binary files /dev/null and b/test/zh/metrics-test-zh.pdf differ diff --git a/test/zh/metrics-test-zh.tex b/test/zh/metrics-test-zh.tex new file mode 100644 index 0000000..f1db807 --- /dev/null +++ b/test/zh/metrics-test-zh.tex @@ -0,0 +1,21 @@ +\input luatexja-core.sty +\jfont\fmdisplay={name:SimSun:jfm=ujis} at 12pt +\jfont\banjiao={name:SimSun:jfm=banjiao} at 12pt +\jfont\quanjiao={name:SimSun:jfm=quanjiao} at 12pt +\jfont\kaiming={name:SimSun:jfm=kaiming} at 12pt +\def\texta{a). ……于是她近乎歇斯底里的喊道:“这真的不是我做的!……”然而这么熟识的人中间,竟然没有一个相信她这个“疯子”。} +\def\textb{b). 他端起茶杯,“俗话说的好,‘到什么山唱什么歌。’”呷了一口茶,继续说到:“像你这样不识抬举,总有一天会吃亏的!”} +\fmdisplay +\beginsection A. 半角标点样式 + +\smallskip +{\banjiao\texta\par\textb} +\beginsection B. 全角标点样式 + +\smallskip +{\quanjiao\texta\par\textb} +\beginsection C. 开明标点样式 + +\smallskip +{\kaiming\texta\par\textb} +\bye \ No newline at end of file