CHISE Omega
[chise/omega.git] / chise.sty
1 \NeedsTeXFormat{LaTeX2e}
2 \ProvidesPackage{chise}[2003/03/03 v.0.1 (Omega/CHISE Team)]
3 % based on mulambda and omega-japanese
4 \RequirePackage{omega}
5 \RequirePackage[UT1]{fontenc}
6
7 \newif\if@gbfont\@gbfontfalse
8 \newif\if@cnsfont\@cnsfontfalse
9 \newif\if@jisfont\@jisfontfalse
10 \newif\if@ksfont\@ksfontfalse
11
12 \DeclareOption{gbfont}{
13   \@gbfonttrue
14 }
15 \DeclareOption{cnsfont}{
16   \@cnsfonttrue
17 }
18 \DeclareOption{jisfont}{
19   \@jisfonttrue
20 }
21 \DeclareOption{ksfont}{
22   \@ksfonttrue
23 }
24
25 \DeclareOption{utf8mcs}{
26   \if@gbfont
27     \externalocp\OCPuniGB=Utf8mcsToUniGB {}
28     \ocplist\uniGB=
29       \addbeforeocplist 1 \OCPuniGB
30       \nullocplist
31   \else\if@cnsfont
32     \externalocp\OCPuniCNS=Utf8mcsToUniCNS {}
33     \ocplist\uniCNS=
34       \addbeforeocplist 1 \OCPuniCNS
35       \nullocplist
36   \else\if@jisfont
37     \externalocp\OCPuniJIS=Utf8mcsToUniJIS {}
38     \ocplist\uniJIS=
39       \addbeforeocplist 1 \OCPuniJIS
40       \nullocplist
41   \else\if@ksfont
42     \externalocp\OCPuniKS=Utf8mcsToUniKS {}
43     \ocplist\uniKS=
44       \addbeforeocplist 1 \OCPuniKS
45       \nullocplist
46   \else
47     \externalocp\OCPuniGB=Utf8mcsToUniGB {}
48     \ocplist\uniGB=
49       \addbeforeocplist 1 \OCPuniGB
50       \nullocplist
51     \externalocp\OCPuniCNS=Utf8mcsToUniCNS {}
52     \ocplist\uniCNS=
53       \addbeforeocplist 1 \OCPuniCNS
54       \nullocplist
55     \externalocp\OCPuniJIS=Utf8mcsToUniJIS {}
56     \ocplist\uniJIS=
57       \addbeforeocplist 1 \OCPuniJIS
58       \nullocplist
59     \externalocp\OCPuniKS=Utf8mcsToUniKS {}
60     \ocplist\uniKS=
61       \addbeforeocplist 1 \OCPuniKS
62       \nullocplist
63   \fi\fi\fi\fi
64 }
65 \DeclareOption{utf8gb}{
66   \if@gbfont
67     \externalocp\OCPuniGB=Utf8gbToUniGB {}
68     \ocplist\uniGB=
69       \addbeforeocplist 1 \OCPuniGB
70       \nullocplist
71   \else\if@cnsfont
72     \externalocp\OCPuniCNS=Utf8gbToUniCNS {}
73     \ocplist\uniCNS=
74       \addbeforeocplist 1 \OCPuniCNS
75       \nullocplist
76   \else\if@jisfont
77     \externalocp\OCPuniJIS=Utf8gbToUniJIS {}
78     \ocplist\uniJIS=
79       \addbeforeocplist 1 \OCPuniJIS
80       \nullocplist
81   \else\if@ksfont
82     \externalocp\OCPuniKS=Utf8gbToUniKS {}
83     \ocplist\uniKS=
84       \addbeforeocplist 1 \OCPuniKS
85       \nullocplist
86   \else
87     \externalocp\OCPuniGB=Utf8gbToUniGB {}
88     \ocplist\uniGB=
89       \addbeforeocplist 1 \OCPuniGB
90       \nullocplist
91     \externalocp\OCPuniCNS=Utf8gbToUniCNS {}
92     \ocplist\uniCNS=
93       \addbeforeocplist 1 \OCPuniCNS
94       \nullocplist
95     \externalocp\OCPuniJIS=Utf8gbToUniJIS {}
96     \ocplist\uniJIS=
97       \addbeforeocplist 1 \OCPuniJIS
98       \nullocplist
99     \externalocp\OCPuniKS=Utf8gbToUniKS {}
100     \ocplist\uniKS=
101       \addbeforeocplist 1 \OCPuniKS
102       \nullocplist
103   \fi\fi\fi\fi
104 }
105 \DeclareOption{utf8cns}{
106   \if@gbfont
107     \externalocp\OCPuniGB=Utf8cnsToUniGB {}
108     \ocplist\uniGB=
109       \addbeforeocplist 1 \OCPuniGB
110       \nullocplist
111   \else\if@cnsfont
112     \externalocp\OCPuniCNS=Utf8cnsToUniCNS {}
113     \ocplist\uniCNS=
114       \addbeforeocplist 1 \OCPuniCNS
115       \nullocplist
116   \else\if@jisfont
117     \externalocp\OCPuniJIS=Utf8cnsToUniJIS {}
118     \ocplist\uniJIS=
119       \addbeforeocplist 1 \OCPuniJIS
120       \nullocplist
121   \else\if@ksfont
122     \externalocp\OCPuniKS=Utf8cnsToUniKS {}
123     \ocplist\uniKS=
124       \addbeforeocplist 1 \OCPuniKS
125       \nullocplist
126   \else
127     \externalocp\OCPuniGB=Utf8cnsToUniGB {}
128     \ocplist\uniGB=
129       \addbeforeocplist 1 \OCPuniGB
130       \nullocplist
131     \externalocp\OCPuniCNS=Utf8cnsToUniCNS {}
132     \ocplist\uniCNS=
133       \addbeforeocplist 1 \OCPuniCNS
134       \nullocplist
135     \externalocp\OCPuniJIS=Utf8cnsToUniJIS {}
136     \ocplist\uniJIS=
137       \addbeforeocplist 1 \OCPuniJIS
138       \nullocplist
139     \externalocp\OCPuniKS=Utf8cnsToUniKS {}
140     \ocplist\uniKS=
141       \addbeforeocplist 1 \OCPuniKS
142       \nullocplist
143   \fi\fi\fi\fi
144 }
145 \DeclareOption{utf8jis}{
146   \if@gbfont
147     \externalocp\OCPuniGB=Utf8jisToUniGB {}
148     \ocplist\uniGB=
149       \addbeforeocplist 1 \OCPuniGB
150       \nullocplist
151   \else\if@cnsfont
152     \externalocp\OCPuniCNS=Utf8jisToUniCNS {}
153     \ocplist\uniCNS=
154       \addbeforeocplist 1 \OCPuniCNS
155       \nullocplist
156   \else\if@jisfont
157     \externalocp\OCPuniJIS=Utf8jisToUniJIS {}
158     \ocplist\uniJIS=
159       \addbeforeocplist 1 \OCPuniJIS
160       \nullocplist
161   \else\if@ksfont
162     \externalocp\OCPuniKS=Utf8jisToUniKS {}
163     \ocplist\uniKS=
164       \addbeforeocplist 1 \OCPuniKS
165       \nullocplist
166   \else
167     \externalocp\OCPuniGB=Utf8jisToUniGB {}
168     \ocplist\uniGB=
169       \addbeforeocplist 1 \OCPuniGB
170       \nullocplist
171     \externalocp\OCPuniCNS=Utf8jisToUniCNS {}
172     \ocplist\uniCNS=
173       \addbeforeocplist 1 \OCPuniCNS
174       \nullocplist
175     \externalocp\OCPuniJIS=Utf8jisToUniJIS {}
176     \ocplist\uniJIS=
177       \addbeforeocplist 1 \OCPuniJIS
178       \nullocplist
179     \externalocp\OCPuniKS=Utf8jisToUniKS {}
180     \ocplist\uniKS=
181       \addbeforeocplist 1 \OCPuniKS
182       \nullocplist
183   \fi\fi\fi\fi
184 }
185 \DeclareOption{utf8ks}{
186   \if@gbfont
187     \externalocp\OCPuniGB=Utf8ksToUniGB {}
188     \ocplist\uniGB=
189       \addbeforeocplist 1 \OCPuniGB
190       \nullocplist
191   \else\if@cnsfont
192     \externalocp\OCPuniCNS=Utf8ksToUniCNS {}
193     \ocplist\uniCNS=
194       \addbeforeocplist 1 \OCPuniCNS
195       \nullocplist
196   \else\if@jisfont
197     \externalocp\OCPuniJIS=Utf8ksToUniJIS {}
198     \ocplist\uniJIS=
199       \addbeforeocplist 1 \OCPuniJIS
200       \nullocplist
201   \else\if@ksfont
202     \externalocp\OCPuniKS=Utf8ksToUniKS {}
203     \ocplist\uniKS=
204       \addbeforeocplist 1 \OCPuniKS
205       \nullocplist
206   \else
207     \externalocp\OCPuniGB=Utf8ksToUniGB {}
208     \ocplist\uniGB=
209       \addbeforeocplist 1 \OCPuniGB
210       \nullocplist
211     \externalocp\OCPuniCNS=Utf8ksToUniCNS {}
212     \ocplist\uniCNS=
213       \addbeforeocplist 1 \OCPuniCNS
214       \nullocplist
215     \externalocp\OCPuniJIS=Utf8ksToUniJIS {}
216     \ocplist\uniJIS=
217       \addbeforeocplist 1 \OCPuniJIS
218       \nullocplist
219     \externalocp\OCPuniKS=Utf8ksToUniKS {}
220     \ocplist\uniKS=
221       \addbeforeocplist 1 \OCPuniKS
222       \nullocplist
223   \fi\fi\fi\fi
224 }
225
226 \ocp\CJKbreak=cjkbreak
227 %% \ocplist\CJKadjust=
228 %%    \addbeforeocplist 1 \CJKbreak
229 %%    \nullocplist
230 \def\cjkglue{\hskip 0pt plus 1pt minus .5pt}
231
232 \ocp\OCPutf=inutf8
233 \ocplist\inutf
234   \addbeforeocplist 1 \OCPutf
235   \nullocplist
236 \AtBeginDocument{
237 %  \DefaultInputMode onebyte
238 %  \InputMode currentfile onebyte
239 %  \DefaultInputTranslation onebyte \OCPutf
240 %  \InputTranslation currentfile \OCPutf
241   \pushocplist\inutf
242 }
243
244 %%%%% dummy %%%%%
245 \externalocp\OCPmkfont=makefonts.pl {}
246 \ocplist\mkfontOCP=
247 \addbeforeocplist 1 \OCPmkfont
248 \nullocplist
249
250 \AtEndDocument{
251   \pushocplist\mkfontOCP
252 }
253
254 % Settings for CJK
255 \def\selectjisfont{\fontencoding{OT1}\fontfamily{omjis}\selectfont}
256 \def\selectgbsfont{\fontencoding{OT1}\fontfamily{omgbs}\selectfont}
257 \def\selectcnsfont{\fontencoding{OT1}\fontfamily{omcns}\selectfont}
258 \def\selectksxfont{\fontencoding{OT1}\fontfamily{omksx}\selectfont}
259 %\def\JIS{\pushocplist\CJKadjust\selectjisfont}
260 %\def\GB{\pushocplist\CJKadjust\selectgbsfont}
261 %\def\KS{\pushocplist\CJKadjust\selectksxfont}
262 %\def\CNS{\pushocplist\CJKadjust\selectcnsfont}
263
264 \newenvironment{JISfont}{\pushocplist\uniJIS\selectjisfont}{\pushocplist\inutf}
265 \newenvironment{GBfont}{\pushocplist\uniGB\selectgbsfont}{\pushocplist\inutf}
266 \newenvironment{KSfont}{\pushocplist\uniKS\selectksxfont}{\pushocplist\inutf}
267 \newenvironment{CNSfont}{\pushocplist\uniCNS\selectcnsfont}{\pushocplist\inutf}
268
269 \newcommand{\jisfont}[1]{\begingroup%
270   \pushocplist\uniJIS\selectjisfont #1\endgroup}
271 \newcommand{\gbfont}[1]{\begingroup%
272   \pushocplist\uniGB\selectgbsfont #1\endgroup}
273 \newcommand{\ksfont}[1]{\begingroup%
274   \pushocplist\uniKS\selectksxfont #1\endgroup}
275 \newcommand{\cnsfont}[1]{\begingroup%
276   \pushocplist\uniCNS\selectcnsfont #1\endgroup}
277 \newcommand{\noncjk}[1]{\begingroup%
278   \normalfont\pushocplist\inutf #1\endgroup}
279
280 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
281 % Font Declaration
282 % ----------------
283 \DeclareFontFamily{OT1}{chise000}{}
284 \DeclareFontShape{OT1}{chise000}{m}{n}{
285    <-> [.96] chise000min
286 }{}
287 \DeclareFontShape{OT1}{chise000}{m}{sc}{
288    <-> [.96] ssub * chise000min/m/n
289 }{}
290 \DeclareFontShape{OT1}{chise000}{m}{it}{
291    <-> [.96] chise000min
292 }{}
293 \DeclareFontShape{OT1}{chise000}{m}{sl}{
294    <-> [.96] ssub * chise000min/m/it
295 }{}
296 \DeclareFontShape{OT1}{chise000}{m}{itsc}{
297    <-> [.96] ssub * chise000min/m/it
298 }{}
299 \DeclareFontShape{OT1}{chise000}{m}{slsc}{
300    <-> [.96] ssub * chise000min/m/it
301 }{}
302 \DeclareFontShape{OT1}{chise000}{bx}{n}{
303    <-> [.96] chise000got
304 }{}
305 \DeclareFontShape{OT1}{chise000}{bx}{sc}{
306    <-> [.96] ssub * chise000got/bx/n
307 }{}
308 \DeclareFontShape{OT1}{chise000}{bx}{it}{
309    <-> [.96] chise000got
310 }{}
311 \DeclareFontShape{OT1}{chise000}{bx}{itsc}{
312    <-> [.96] ssub * chise000got/bx/it
313 }{}
314 \DeclareFontShape{OT1}{chise000}{bx}{sl}{
315    <-> [.96] ssub * chise000got/bx/it
316 }{}
317 \DeclareFontShape{OT1}{chise000}{bx}{slsc}{
318    <-> [.96] ssub * chise000got/bx/it
319 }{}
320 %%% GT
321 \DeclareFontFamily{OT1}{gt01}{}
322 \DeclareFontShape{OT1}{gt01}{m}{n}{
323    <-> gt01
324 }{}
325 \DeclareFontFamily{OT1}{gt02}{}
326 \DeclareFontShape{OT1}{gt02}{m}{n}{
327    <-> gt02
328 }{}
329 \DeclareFontFamily{OT1}{gt03}{}
330 \DeclareFontShape{OT1}{gt03}{m}{n}{
331    <-> gt03
332 }{}
333 \DeclareFontFamily{OT1}{gt04}{}
334 \DeclareFontShape{OT1}{gt04}{m}{n}{
335    <-> gt04
336 }{}
337 \DeclareFontFamily{OT1}{gt05}{}
338 \DeclareFontShape{OT1}{gt05}{m}{n}{
339    <-> gt05
340 }{}
341 \DeclareFontFamily{OT1}{gt06}{}
342 \DeclareFontShape{OT1}{gt06}{m}{n}{
343    <-> gt06
344 }{}
345 \DeclareFontFamily{OT1}{gt07}{}
346 \DeclareFontShape{OT1}{gt07}{m}{n}{
347    <-> gt07
348 }{}
349 \DeclareFontFamily{OT1}{gt08}{}
350 \DeclareFontShape{OT1}{gt08}{m}{n}{
351    <-> gt08
352 }{}
353 \DeclareFontFamily{OT1}{gt09}{}
354 \DeclareFontShape{OT1}{gt09}{m}{n}{
355    <-> gt09
356 }{}
357 \DeclareFontFamily{OT1}{gt10}{}
358 \DeclareFontShape{OT1}{gt10}{m}{n}{
359    <-> gt10
360 }{}
361 \DeclareFontFamily{OT1}{gt11}{}
362 \DeclareFontShape{OT1}{gt11}{m}{n}{
363    <-> gt11
364 }{}
365
366
367 \ProcessOptions
368 \endinput