\item {\tt src/}: 核となる\TeX ソースとLuaコードはこのディレクトリ内に入っている.
\itemitem \TeX 用スタイルファイル達
\itemT {\tt luatexja.sty}: 利用者はこのファイルを読み込む.
-拡張子は{\tt sty}であるが,plain \TeX と\LaTeX 両方に対応させる方針である.しかし,
-{\bf 現時点で\LaTeX での使用は考慮されていない.}
+拡張子は{\tt sty}であるが,plain \TeX と\LaTeX 両方に対応させる方針である.
\itemT {\tt luatexja-core.sty}:
\itemT {\tt luatexja-base.sty}:
\itemT {\tt luatexja-cctbreg.sty}:
\itemT {\tt mk-rmlgbm-data.tex}: {\tt luatexja-rmlgbm-data.lua}作成用スクリプト
{\small(小塚明朝を{\tt luaotfload}で読み込んだ時のキャッシュが必要)\inhibitglue}.
+\itemitem \LaTeX 用スタイルファイル達
+\itemT {\tt luatexja-latex.sty}:
+\itemT {\tt lltjdefs.sty}:
+\itemT {\tt lltjfont.sty}:
+
+
\itemitem Luaコード達(旧フォーマット)
\itemT {\tt luatexja-core.lua}: コア部分に使われるLuaコード.
\itemT {\tt luatexja-rmlgbm-data.lua}: 非埋込和文フォント用のデータ(小塚明朝Pr6N R由来).
\itemT {\tt jfont.lua}: 和文フォント定義部のLuaコード.
\itemT {\tt rmlgbm.lua}: 非埋込和文フォント (Ryumin-Light etc.) 定義用コード.
\itemT {\tt jfmglue.lua}: 和文処理に伴う空白の挿入処理部.
+\itemT {\tt math.lua}: 数式モード中の和文文字のフォント置換部分.
\itemT {\tt tangle.lua}
\itemT {\tt charrange.lua}: 「和文文字の範囲」管理部.
\itemT {\tt debug.lua}
\beginsection 使用方法
-大é\9b\91æ\8a\8aã\81«è¨\80ã\81\86ã\81¨ï¼\8cplain \TeX ã\81®ç\8a¶æ³\81ã\81§ï¼\8c以ä¸\8bã\81®ã\82\88ã\81\86ã\81«ã\81\99ã\82\8cã\81°ã\82\88ã\81\84ï¼\8e
+大é\9b\91æ\8a\8aã\81«è¨\80ã\81\86ã\81¨ï¼\8cplain \TeX ã\81®ç\8a¶æ³\81ã\81§ï¼\8c以ä¸\8bã\81®ã\82\88ã\81\86ã\81«ã\81\99ã\82\8bã\81\8bï¼\8c
\begintt
\input luatexja.sty % ←マクロ本体を読み込み
\jfont\tenipam={file:ipam.ttf:jfm=ujis} at 13.5\jQ
\rm\tenipam abcほげほげ)(あいう本文本文……
\endtt
+\LaTeX において preamble 部で
+\begintt
+\usepackage{luatexja}
+\endtt
+と書けばよい.標準では非埋込の標準和文フォントRyumin-Light, GothicBBB-Mediumが使われる.
\beginparagraph 和文フォントの定義
\beginparagraph その他の命令
-\item dimen |\zw|, |\zh|: 現在の和文フォントの「幅」/「高さ」(メトリックから指定)
+\item |\zw|, |\zh|: 現在の和文フォントの「幅」/「高さ」(メトリックにより指定)\hfil\break
+今の版では,これは純粋なdimenレジスタではなくなっている.
+
\item dimen |\jQ|, |\jH|${}= 0.25\,{\rm mm}$.
\item |\inhibitglue|:
指定箇所でのJFM由来のglue/kernの挿入を禁止する.
\def\extract@jfont{%
\get@external@font
\expandafter\globaljfont\font@name\external@font\relax
- \font@name\global\zw=\zw\global\zh=\zh
+ \font@name%\global\zw=\zw\global\zh=\zh
\csname \f@encoding+\f@family\endcsname
\csname\curr@fontshape\endcsname}
local attr_curjfnt = luatexbase.attributes['ltj@curjfnt']
local attr_yablshift = luatexbase.attributes['ltj@yablshift']
local attr_icflag = luatexbase.attributes['ltj@icflag']
+local cat_lp = luatexbase.catcodetables['latex-package']
local ITALIC = 1
local PACKED = 2
-- EXT: print \global if necessary
function ltj.ext_print_global()
- if ltj.isglobal=='global' then tex.sprint('\\global') end
+ if ltj.isglobal=='global' then tex.sprint(cat_lp, '\\global') end
end
-- main process
\newdimen\ltj@tempdima
\newskip\ltj@tempskipa
-\newdimen\zw
-\newdimen\zh
+\newdimen\ltj@zw
+\newdimen\ltj@zh
\newdimen\jQ \jQ=0.25mm
\newdimen\jH \jH=0.25mm
\afterassignment\ltj@@jfont\directlua{luatexja.jfont.jfontdefX(true)}}
\def\ltj@@jfont{\directlua{luatexja.jfont.jfontdefY()}}
+\def\zw{\directlua{luatexja.jfont.load_zw()}\ltj@zw}
+\def\zh{\directlua{luatexja.jfont.load_zh()}\ltj@zh}
+
%%%%%%%% \inhibitglue
\protected\def\inhibitglue{\directlua{luatexja.jfmglue.create_inhibitglue_node()}}
%%------------------ all done
\ltj@core@AtEnd
\endinput
-%% EOF
+%% EOF
\ No newline at end of file
local attr_curjfnt = luatexbase.attributes['ltj@curjfnt']
local id_glyph = node.id('glyph')
local id_kern = node.id('kern')
-
+local cat_lp = luatexbase.catcodetables['latex-package']
local ITALIC = 1
------------------------------------------------------------------------
-- LOADING JFM
local t = token.get_next()
cstemp=token.csname_name(t)
if g then ltj.is_global = '\\global' else ltj.is_global = '' end
- tex.sprint('\\expandafter\\font\\csname ' .. cstemp .. '\\endcsname')
+ tex.sprint(cat_lp, '\\expandafter\\font\\csname ' .. cstemp .. '\\endcsname')
end
-- EXT
"bad JFM `" .. jfm_file_name .. "'",
'The JFM file you specified is not valid JFM file.\n'..
'So defining Japanese font is cancelled.')
- tex.sprint(ltj.is_global .. '\\expandafter\\let\\csname '
- .. cstemp .. '\\endcsname=\\relax')
+ tex.sprint(cat_lp, ltj.is_global .. '\\expandafter\\let\\csname ' ..cstemp
+ .. '\\endcsname=\\relax')
return
end
font_metric_table[fn]={}
font_metric_table[fn].jfm=j
font_metric_table[fn].size=f.size
font_metric_table[fn].var=jfm_var
- tex.sprint(ltj.is_global .. '\\protected\\expandafter\\def\\csname '
- .. cstemp .. '\\endcsname'
- .. '{\\csname ltj@curjfnt\\endcsname=' .. fn
- .. ' \\zw=' .. round(f.size*metrics[j].zw) .. 'sp'
- .. '\\zh=' .. round(f.size*metrics[j].zh) .. 'sp\\relax}')
+ tex.sprint(cat_lp, ltj.is_global .. '\\protected\\expandafter\\def\\csname '
+ .. cstemp .. '\\endcsname{\\ltj@curjfnt=' .. fn .. '\\relax}')
+end
+
+-- zw, zh
+function load_zw()
+ local a = font_metric_table[tex.attribute[attr_curjfnt]]
+ if a then
+ tex.setdimen('ltj@zw', round(a.size*metrics[a.jfm].zw))
+ else
+ tex.setdimen('ltj@zw',0)
+ end
+end
+
+function load_zh()
+ local a = font_metric_table[tex.attribute[attr_curjfnt]]
+ if a then
+ tex.setdimen('ltj@zh', round(a.size*metrics[a.jfm].zh))
+ else
+ tex.setdimen('ltj@zh', round(a.size*metrics[a.jfm].zh))
+ end
end
-- extract jfm_file_name and jfm_var
%#! luatex
\input luatexja-core.sty
-\jfont\tenmin={psft:Ryumin-Light:jfm=ujis}\tenmin
-\jfont\tengoth={psft:GothicBBB-Medium:jfm=ujis}
+\let\tengoth=\tengt
\jfont\jisse={psft:Ryumin-Light:script=latn;+jp78;jfm=ujis}
\jfont\jisexpt={psft:Ryumin-Light:script=latn;+expt;jfm=ujis}
\jfont\jishwid={psft:Ryumin-Light:script=latn;+hwid;jfm=ujis}