OSDN Git Service

Update README and test/valign.lua.
authorHironori Kitagawa <h_kitagawa2001@yahoo.co.jp>
Sat, 21 Apr 2012 21:44:21 +0000 (06:44 +0900)
committerHironori Kitagawa <h_kitagawa2001@yahoo.co.jp>
Sat, 21 Apr 2012 21:44:21 +0000 (06:44 +0900)
README
test/test12-ltjarticle.pdf
test/valign.lua

diff --git a/README b/README
index d1ab54f..24070cf 100644 (file)
--- a/README
+++ b/README
@@ -1,13 +1,14 @@
-The LuaTeX-ja Package 20120421.0
+The LuaTeX-ja Package 20120422.0
 --------------------------------
 Copyright (c) 2011--2012 The LuaTeX-ja project
+License: modified BSD (see COPYING)
 
 LuaTeX-ja is a macro package for typesetting Japanese documents with LuaTeX.
 This package is highly affected by ASCII pTeX engine, but not a porting of it.
 
 Note that this package is still *alpha-stage*; documentations are not complete
 and specifications are subject to change. Documentations are located at
-  doc/man-en.pdf (en), doc/man-ja.pdf (ja), doc/manual-zh.pdf (zh).
+  doc/luatexja-en.pdf (en), doc/luatexja-ja.pdf (ja), doc/luatexja-zh.pdf (zh).
 
 LuaTeX-ja is developed on
   <http://sourceforge.jp/projects/luatex-ja/wiki/FrontPage(en)>.
@@ -16,22 +17,26 @@ thread in the forum or a ticket in the bug tracking system for that in the way
 which SourceForge.jp supplies, via links found in the page above.
 
 
-
 Installation
 ------------
 
 0. Please make sure that your TeX distribution is up-to-date.
    LuaTeX-ja (luatexja-fontspec.sty) requires xunicode.sty v0.981.
+
 1. If you use TeX Live 2011 or later, you can install LuaTeX-ja via tlmgr.
+
 2. If you must/want to install manually:
+
    a. Download the source archive from CTAN, or HEAD in the Git repository by
       <http://git.sourceforge.jp/view?p=luatex-ja/luatexja.git
                                                     ;a=snapshot;h=HEAD;sf=tgz>
    b. Extract the archive and put src/ into your TEXMF tree.
       An example location is TEXMF/tex/luatex/luatexja.
-   c. Files in src/no_runtime/ are not used in the regular use,
-      so you can remove them.
-   d. You may need to update the filename database, by 'mktexlsr' or something.
+
+      If you are updating from old version, you MUST remove it before
+      extracting the new version of LuaTeX-ja.
+
+   c. You may need to update the filename database, by 'mktexlsr' or something.
 
 
 Basic Usage
index a242da5..f3b19d7 100644 (file)
Binary files a/test/test12-ltjarticle.pdf and b/test/test12-ltjarticle.pdf differ
index c044e6f..581dd82 100644 (file)
@@ -1,8 +1,8 @@
-require('luatexja.base');      local ltjb = luatexja.base
-require('luatexja.jfont');     local ltjf = luatexja.jfont
+luatexja.load_module('base');      local ltjb = luatexja.base
+luatexja.load_module('jfont');     local ltjf = luatexja.jfont
 
 local round = tex.round
-
+local floor = math.floor
 local attr_curjfnt = luatexbase.attributes['ltj@curjfnt']
 local attr_jchar_class = luatexbase.attributes['ltj@charclass']
 local attr_yablshift = luatexbase.attributes['ltj@yablshift']
@@ -11,6 +11,23 @@ local attr_ykblshift = luatexbase.attributes['ltj@ykblshift']
 local ltjf_font_metric_table = ltjf.font_metric_table
 local ltjf_find_char_class = ltjf.find_char_class
 
+local unity=65536
+local function print_scaled(s)
+   local out=''
+   local delta=10
+   if s<0 then
+      out=out..'-'; s=-s
+   end
+   out=out..tostring(floor(s/unity)) .. '.'
+   s=10*(s%unity)+5
+   repeat
+      if delta>unity then s=s+32768-50000 end
+      out=out .. tostring(floor(s/unity))
+      s=10*(s%unity)
+      delta=delta*10
+   until s<=delta
+   return out
+end
 local function set_valign(fmtable, fn)
    local fi = fonts.ids[fn]
    local mt = ltjf.metrics[fmtable.jfm].char_type[0]
@@ -22,7 +39,7 @@ local function set_valign(fmtable, fn)
 end
 luatexbase.add_to_callback("luatexja.define_jfont", 
                           set_valign, "ltj.valign.define_jfont", 1)
---  ´û¤ËÆɤ߹þ¤Þ¤ì¤Æ¤¤¤ë¥Õ¥©¥ó¥È¤ËÂФ·¤Æ¤â¡¤Æ±¤¸¤³¤È¤ò¤ä¤é¤Ê¤¤¤È¤¤¤±¤Ê¤¤
+--  既に読み込まれているフォントに対しても,同じことをやらないといけない
 for fn, v in pairs(ltjf_font_metric_table) do
    ltjf_font_metric_table[fn] = set_valign(v, fn)
 end