% luatexja-preset.sty
-\ProvidesPackage{luatexja-preset}[2013/05/25 Japanese font presets]
+\ProvidesPackage{luatexja-preset}[2013/10/26 Japanese font presets]
%% Sync with PXchfon 0.6a
\RequirePackage{expl3}
\RequirePackage{luatexja-fontspec}
\ExplSyntaxOn
+%%%% message
\bool_new:N \l_ltjpreset_bold_bool % bold
\bool_set_false:N \l_ltjpreset_bold_bool
% 漢字字形
\tl_new:N \l_ltjpreset_kanji_shape_tl
-\DeclareOption{90jis}{
- \tl_set:Nn \l_ltjpreset_kanji_shape_tl { , CJKShape=JIS1990 }
-} % 90jis
-\DeclareOption{jis2004}{
- \tl_set:Nn \l_ltjpreset_kanji_shape_tl { , CJKShape=JIS2004 }
-} % jis2004
+\DeclareOption{90jis}{ \tl_set:Nn \l_ltjpreset_kanji_shape_tl { , CJKShape=JIS1990 }} % 90jis
+\DeclareOption{jis2004}{\tl_set:Nn \l_ltjpreset_kanji_shape_tl { , CJKShape=JIS2004 }} % jis2004
% font preset
\bool_new:N \l_ltjpreset_office_bool % MS Office の HG 系フォントを使っているか
-% kozuka
+% 小塚 (Adobe)
\DeclareOption{kozuka-pro}{
\ltjpreset_set_multi:n {
KozMinPro-Regular.otf , KozMinPro-Bold.otf, % mc/m, mc/bx
}
}
-% hiragino
+% ヒラギノ (OSX)
\DeclareOption{hiragino-pro}{
\ltjpreset_set_multi:n {
HiraMinPro-W3.otf , HiraMinPro-W6.otf, % mc/m, mc/bx
}
}
-% morisawa
+% モリサワ
\DeclareOption{morisawa-pro}{
\ltjpreset_set_multi:n {
A-OTF-RyuminPro-Light.otf , A-OTF-FutoMinA101Pro-Bold.otf , % mc/m, mc/bx
}
}
+% 游明朝/游ゴシック (Win8.1)
+\DeclareOption{yu}{
+ \ltjpreset_set_multi:n {
+ yumin.ttf , yumindb.ttf , % mc/m, mc/bx
+ yugothic.ttf , yugothib.ttf , % gt/m, gt/bx (multiweight))
+ yugothic.ttf , yugothib.ttf , % gt/m (uni), gt/eb
+ yugothib.ttf % mg/m
+ }
+}
+
% ipa, ipaex, ms
\DeclareOption{ipa}{
%%%% (丸)ゴシック体の設定: bold option もここで
\int_compare:nTF { \l_ltjpreset_deluxe_int == 2 } {
%%% mg
- \newjfontfamily \mgfamily [
- BoldFont = \ltjpreset_font_mg:,
+ \newjfontfamily \mgfamily [
+ BoldFont = \ltjpreset_font_mg:,
\tl_use:N \l_ltjpreset_add_features_tl
\bool_if:NT \l_ltjpreset_noembed_bool { , NoEmbed },
\tl_use:N \l_ltjpreset_add_features_tl
] { \ltjpreset_font_mg: }
- \DeclareTextFontCommand{\textmg}{\mgfamily}
-%%% gteb
+ \DeclareTextFontCommand{\textmg}{\mgfamily}
+%%% gt/eb
\newjfontfamily \gtebfamily [
BoldFont = \ltjpreset_font_gt_eb:,
\tl_use:N \l_ltjpreset_add_features_tl
%%%% 実際の fontspec の呼びだし
\defaultjfontfeatures{ Kerning=Off }
+
\setmainjfont [
BoldFont = \ltjpreset_font_mc_bx:
\bool_if:NT \l_ltjpreset_noembed_bool { , NoEmbed },
\tl_use:N \l_ltjpreset_add_features_tl
] { \ltjpreset_font_gt_m: }
-
\ExplSyntaxOff
\endinput
\ No newline at end of file
end
local get_pr_begin_flag = get_pr_begin_flag
-head = nil
+head = nil;
luatexbase.create_callback("luatexja.set_width", "data",
function (fstable, fmtable, jchar_class)
if not char_data then return node_next(p) end
local fwidth, pwidth = char_data.width, p.width
fwidth = (fwidth ~= 'prop') and fwidth or pwidth
- local fheight, fdepth = char_data.height, char_data.depth
fshift.down = char_data.down; fshift.left = char_data.left
fshift = luatexbase.call_callback("luatexja.set_width", fshift, met, class)
+ local fheight, fdepth = char_data.height, char_data.depth
+ fheight = (fheight ~= 'prop') and fheight or p.height
+ fdepth = (fdepth ~= 'prop') and fdepth or p.depth
if (mode or pwidth ~= fwidth or p.height ~= fheight or p.depth ~= fdepth) then
local y_shift, ca
= - p.yoffset + (has_attr(p,attr_ykblshift) or 0), char_data.align
local q; head, q = node.remove(head, p)
p.yoffset, p.next = -fshift.down, nil
- if total ~= 0 and ca~='left' then
+ if ca~='left' then
p.xoffset = p.xoffset - fshift.left
+ (((ca=='right') and fwidth - pwidth) or round((fwidth - pwidth)*0.5))
else
local p = ahead; head = ahead
local m = false -- is in math mode?
while p do
- if (p.id==id_glyph)
- and ((has_attr(p, attr_icflag) or 0)%PROCESSED_BEGIN_FLAG)<=0 then
+ local pid = p.id
+ if (pid==id_glyph)
+ and ((has_attr(p, attr_icflag) or 0)%PROCESSED_BEGIN_FLAG)<=0 then
local pf = p.font
if pf == has_attr(p, attr_curjfnt) then
p = capsule_glyph(p, dir, false, ltjf_font_metric_table[pf],
m = (p.subtype==0); p = node_next(p)
else
if m then
- if p.id==id_hlist or p.id==id_vlist then
+ if pid==id_hlist or pid==id_vlist then
p.shift = p.shift + (has_attr(p,attr_yablshift) or 0)
- elseif p.id==id_rule then
+ elseif pid==id_rule then
local v = has_attr(p,attr_yablshift) or 0
p.height = p.height - v; p.depth = p.depth + v
end