-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)>.
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
-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']
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]
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