OSDN Git Service

update documentation (WIP)
[luatex-ja/luatexja.git] / test / test16-preset.tex
1 %#!lualatex test16-preset && pdffonts test16-preset.pdf
2 \documentclass{ltjtarticle}
3 \makeatletter
4 %\let\ltj@orig@DeclareFontShape@=\DeclareFontShape@
5 %\def\DeclareFontShape@#1#2#3#4#5#6{%
6 %      \immediate\typeout{DFS |#1|#2|#3|#4|#5|#6|}%
7 %      \ltj@orig@DeclareFontShape@{#1}{#2}{#3}{#4}{#5}{#6}%
8 %      }
9 \usepackage[deluxe,expert,jis2004, match]{luatexja-preset}
10
11 \ExplSyntaxOn
12 \cs_new:Nn \__my_ltjpreset_kana_color: {FF00FF}
13 \cs_new:Nn \__my_ltjpreset_kana_range: {"30A0-"30AF}
14 \cs_new:Nn \ltjpreset_define_family_hook_nfssonly:nnn
15 {
16     \__ltjpreset_declare_font_shape:nnnnnnn { JY3 }
17       { ltjp #1 \int_to_arabic:n { \g__ltjpreset_applycount_int }} { #2 } { nk }
18       { "#3" : jfm=\tl_use:N \__ltjpreset_use_jfm_yoko_tl }
19       { script=hani \bool_if:NT \g__ltjpreset_expert_bool { ;+hkna }
20                 ; color=\__my_ltjpreset_kana_color: }
21       { \Cjascale }
22     \DeclareAlternateKanjiFont
23       { JY3 } { ltjp #1 \int_to_arabic:n { \g__ltjpreset_applycount_int }} { #2 } { n }
24       { JY3 } { ltjp #1 \int_to_arabic:n { \g__ltjpreset_applycount_int }} { #2 } { nk }
25       { \__my_ltjpreset_kana_range: }
26     \__ltjpreset_declare_font_shape:nnnnnnn { JT3 }
27       { ltjp #1 \int_to_arabic:n { \g__ltjpreset_applycount_int }} { #2 } { nk }
28       { "#3" : jfm=\tl_use:N \__ltjpreset_use_jfm_tate_tl }
29       { script=hani \bool_if:NT \g__ltjpreset_expert_bool { ;+vkna }
30                 ; color=\__my_ltjpreset_kana_color: }
31       { \Cjascale }
32     \DeclareAlternateKanjiFont
33       { JT3 } { ltjp #1 \int_to_arabic:n { \g__ltjpreset_applycount_int }} { #2 } { n }
34       { JT3 } { ltjp #1 \int_to_arabic:n { \g__ltjpreset_applycount_int }} { #2 } { nk }
35       { \__my_ltjpreset_kana_range: }
36 }
37 \cs_new:Nn \ltjpreset_define_family_hook_fontspec:nnn {
38     AltFont={ { Range=\__my_ltjpreset_kana_range:, Color=\__my_ltjpreset_kana_color: } }
39 }
40 \ExplSyntaxOff
41 \ltjnewpreset{mc}{} % error
42 \ltjnewpreset{kozuka-pro}{} % error
43
44 \ltjnewpreset{hoge}{ms}
45 \ltjnewpreset{hoge}{} % error
46 \ltjnewpreset*{hoge}{
47   kozuka-pr6n,
48   mc=SourceHanSerif-Regular,
49   mc-l=SourceHanSerif-Bold,
50   mc-m=KozMinPr6N-Regular,
51   mg-m=KozMinPr6N-Light,
52 }
53
54 \makeatother
55
56 \ltjapplypreset{hoge}
57 \begin{document}
58 \makeatletter
59 \def\r#1#2{ \csname #1family \endcsname \csname #2series \endcsname
60   %\addjfontfeature {CJKShape=JIS1983}
61   {\romanfamily{\ttdefault}\selectfont<\k@family><\k@series><\k@shape>}\\
62   {\tt#1, #2\ \ \ \ \ }: あーいうえおabcアイ漢字,あ!い,辻ぁが\\
63   {\tt#1, #2 (rb)}: {\rubyfamily あーいうえおabcアイ漢字,あ!い,辻ぁが}
64 }
65 \@namedef{..series}{\relax}
66
67 \ifdefined\ltseries
68 \r{mc}{lt}
69 \fi
70
71 \r{mc}{md}
72
73 \r{mc}{bf}
74
75
76 \r{gt}{md}
77
78 \r{gt}{bf}
79
80 \ifdefined\ebseries
81 \r{gt}{eb}
82 \fi
83
84 \ifdefined\mgfamily
85 \r{mg}{md}
86 \fi
87
88 \r{tt}{md}
89
90 \r{tt}{bf}
91
92 $あいう\mathgt{あいう}$
93
94 \normalfont
95 {あいうえおabc \sf あいうえおabc}
96
97 \newpage
98 あーいうえおabc漢字,あ!い,辻ぁが\\
99 {\fontseries{bx}\selectfont あーいうえおabc漢字,あ!い,辻ぁが}\\
100 {\fontseries{b}\selectfont あーいうえおabc漢字,あ!い,辻ぁが}
101
102 \bfdefault
103
104 \end{document}