1 \NeedsTeXFormat{LaTeX2e}
2 \ProvidesPackage{chise}[2003/03/03 v.0.1 (Omega/CHISE Team)]
3 % based on mulambda and omega-japanese
5 \RequirePackage[UT1]{fontenc}
7 \newif\if@gbfont\@gbfontfalse
8 \newif\if@cnsfont\@cnsfontfalse
9 \newif\if@jisfont\@jisfontfalse
10 \newif\if@ksfont\@ksfontfalse
12 \DeclareOption{gbfont}{
15 \DeclareOption{cnsfont}{
18 \DeclareOption{jisfont}{
21 \DeclareOption{ksfont}{
25 \DeclareOption{utf8mcs}{
27 \externalocp\OCPuniGB=Utf8mcsToUniGB {}
29 \addbeforeocplist 1 \OCPuniGB
32 \externalocp\OCPuniCNS=Utf8mcsToUniCNS {}
34 \addbeforeocplist 1 \OCPuniCNS
37 \externalocp\OCPuniJIS=Utf8mcsToUniJIS {}
39 \addbeforeocplist 1 \OCPuniJIS
42 \externalocp\OCPuniKS=Utf8mcsToUniKS {}
44 \addbeforeocplist 1 \OCPuniKS
47 \externalocp\OCPuniGB=Utf8mcsToUniGB {}
49 \addbeforeocplist 1 \OCPuniGB
51 \externalocp\OCPuniCNS=Utf8mcsToUniCNS {}
53 \addbeforeocplist 1 \OCPuniCNS
55 \externalocp\OCPuniJIS=Utf8mcsToUniJIS {}
57 \addbeforeocplist 1 \OCPuniJIS
59 \externalocp\OCPuniKS=Utf8mcsToUniKS {}
61 \addbeforeocplist 1 \OCPuniKS
65 \DeclareOption{utf8gb}{
67 \externalocp\OCPuniGB=Utf8gbToUniGB {}
69 \addbeforeocplist 1 \OCPuniGB
72 \externalocp\OCPuniCNS=Utf8gbToUniCNS {}
74 \addbeforeocplist 1 \OCPuniCNS
77 \externalocp\OCPuniJIS=Utf8gbToUniJIS {}
79 \addbeforeocplist 1 \OCPuniJIS
82 \externalocp\OCPuniKS=Utf8gbToUniKS {}
84 \addbeforeocplist 1 \OCPuniKS
87 \externalocp\OCPuniGB=Utf8gbToUniGB {}
89 \addbeforeocplist 1 \OCPuniGB
91 \externalocp\OCPuniCNS=Utf8gbToUniCNS {}
93 \addbeforeocplist 1 \OCPuniCNS
95 \externalocp\OCPuniJIS=Utf8gbToUniJIS {}
97 \addbeforeocplist 1 \OCPuniJIS
99 \externalocp\OCPuniKS=Utf8gbToUniKS {}
101 \addbeforeocplist 1 \OCPuniKS
105 \DeclareOption{utf8cns}{
107 \externalocp\OCPuniGB=Utf8cnsToUniGB {}
109 \addbeforeocplist 1 \OCPuniGB
112 \externalocp\OCPuniCNS=Utf8cnsToUniCNS {}
114 \addbeforeocplist 1 \OCPuniCNS
117 \externalocp\OCPuniJIS=Utf8cnsToUniJIS {}
119 \addbeforeocplist 1 \OCPuniJIS
122 \externalocp\OCPuniKS=Utf8cnsToUniKS {}
124 \addbeforeocplist 1 \OCPuniKS
127 \externalocp\OCPuniGB=Utf8cnsToUniGB {}
129 \addbeforeocplist 1 \OCPuniGB
131 \externalocp\OCPuniCNS=Utf8cnsToUniCNS {}
133 \addbeforeocplist 1 \OCPuniCNS
135 \externalocp\OCPuniJIS=Utf8cnsToUniJIS {}
137 \addbeforeocplist 1 \OCPuniJIS
139 \externalocp\OCPuniKS=Utf8cnsToUniKS {}
141 \addbeforeocplist 1 \OCPuniKS
145 \DeclareOption{utf8jis}{
147 \externalocp\OCPuniGB=Utf8jisToUniGB {}
149 \addbeforeocplist 1 \OCPuniGB
152 \externalocp\OCPuniCNS=Utf8jisToUniCNS {}
154 \addbeforeocplist 1 \OCPuniCNS
157 \externalocp\OCPuniJIS=Utf8jisToUniJIS {}
159 \addbeforeocplist 1 \OCPuniJIS
162 \externalocp\OCPuniKS=Utf8jisToUniKS {}
164 \addbeforeocplist 1 \OCPuniKS
167 \externalocp\OCPuniGB=Utf8jisToUniGB {}
169 \addbeforeocplist 1 \OCPuniGB
171 \externalocp\OCPuniCNS=Utf8jisToUniCNS {}
173 \addbeforeocplist 1 \OCPuniCNS
175 \externalocp\OCPuniJIS=Utf8jisToUniJIS {}
177 \addbeforeocplist 1 \OCPuniJIS
179 \externalocp\OCPuniKS=Utf8jisToUniKS {}
181 \addbeforeocplist 1 \OCPuniKS
185 \DeclareOption{utf8ks}{
187 \externalocp\OCPuniGB=Utf8ksToUniGB {}
189 \addbeforeocplist 1 \OCPuniGB
192 \externalocp\OCPuniCNS=Utf8ksToUniCNS {}
194 \addbeforeocplist 1 \OCPuniCNS
197 \externalocp\OCPuniJIS=Utf8ksToUniJIS {}
199 \addbeforeocplist 1 \OCPuniJIS
202 \externalocp\OCPuniKS=Utf8ksToUniKS {}
204 \addbeforeocplist 1 \OCPuniKS
207 \externalocp\OCPuniGB=Utf8ksToUniGB {}
209 \addbeforeocplist 1 \OCPuniGB
211 \externalocp\OCPuniCNS=Utf8ksToUniCNS {}
213 \addbeforeocplist 1 \OCPuniCNS
215 \externalocp\OCPuniJIS=Utf8ksToUniJIS {}
217 \addbeforeocplist 1 \OCPuniJIS
219 \externalocp\OCPuniKS=Utf8ksToUniKS {}
221 \addbeforeocplist 1 \OCPuniKS
226 \ocp\CJKbreak=cjkbreak
227 %% \ocplist\CJKadjust=
228 %% \addbeforeocplist 1 \CJKbreak
230 \def\cjkglue{\hskip 0pt plus 1pt minus .5pt}
234 \addbeforeocplist 1 \OCPutf
237 % \DefaultInputMode onebyte
238 % \InputMode currentfile onebyte
239 % \DefaultInputTranslation onebyte \OCPutf
240 % \InputTranslation currentfile \OCPutf
245 \externalocp\OCPmkfont=makefonts.pl {}
247 \addbeforeocplist 1 \OCPmkfont
251 \pushocplist\mkfontOCP
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}
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}
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}
280 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
283 \DeclareFontFamily{OT1}{chise000}{}
284 \DeclareFontShape{OT1}{chise000}{m}{n}{
285 <-> [.96] chise000min
287 \DeclareFontShape{OT1}{chise000}{m}{sc}{
288 <-> [.96] ssub * chise000min/m/n
290 \DeclareFontShape{OT1}{chise000}{m}{it}{
291 <-> [.96] chise000min
293 \DeclareFontShape{OT1}{chise000}{m}{sl}{
294 <-> [.96] ssub * chise000min/m/it
296 \DeclareFontShape{OT1}{chise000}{m}{itsc}{
297 <-> [.96] ssub * chise000min/m/it
299 \DeclareFontShape{OT1}{chise000}{m}{slsc}{
300 <-> [.96] ssub * chise000min/m/it
302 \DeclareFontShape{OT1}{chise000}{bx}{n}{
303 <-> [.96] chise000got
305 \DeclareFontShape{OT1}{chise000}{bx}{sc}{
306 <-> [.96] ssub * chise000got/bx/n
308 \DeclareFontShape{OT1}{chise000}{bx}{it}{
309 <-> [.96] chise000got
311 \DeclareFontShape{OT1}{chise000}{bx}{itsc}{
312 <-> [.96] ssub * chise000got/bx/it
314 \DeclareFontShape{OT1}{chise000}{bx}{sl}{
315 <-> [.96] ssub * chise000got/bx/it
317 \DeclareFontShape{OT1}{chise000}{bx}{slsc}{
318 <-> [.96] ssub * chise000got/bx/it
321 \DeclareFontFamily{OT1}{gt01}{}
322 \DeclareFontShape{OT1}{gt01}{m}{n}{
325 \DeclareFontFamily{OT1}{gt02}{}
326 \DeclareFontShape{OT1}{gt02}{m}{n}{
329 \DeclareFontFamily{OT1}{gt03}{}
330 \DeclareFontShape{OT1}{gt03}{m}{n}{
333 \DeclareFontFamily{OT1}{gt04}{}
334 \DeclareFontShape{OT1}{gt04}{m}{n}{
337 \DeclareFontFamily{OT1}{gt05}{}
338 \DeclareFontShape{OT1}{gt05}{m}{n}{
341 \DeclareFontFamily{OT1}{gt06}{}
342 \DeclareFontShape{OT1}{gt06}{m}{n}{
345 \DeclareFontFamily{OT1}{gt07}{}
346 \DeclareFontShape{OT1}{gt07}{m}{n}{
349 \DeclareFontFamily{OT1}{gt08}{}
350 \DeclareFontShape{OT1}{gt08}{m}{n}{
353 \DeclareFontFamily{OT1}{gt09}{}
354 \DeclareFontShape{OT1}{gt09}{m}{n}{
357 \DeclareFontFamily{OT1}{gt10}{}
358 \DeclareFontShape{OT1}{gt10}{m}{n}{
361 \DeclareFontFamily{OT1}{gt11}{}
362 \DeclareFontShape{OT1}{gt11}{m}{n}{
366 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
367 % line break, from omega-japanese.
369 \def\CJKunbreakablekernone{%
371 \hskip 0sp plus 2sp minus 2sp
374 \def\CJKunbreakablekerntwo{%
376 \hskip 0sp plus 2sp minus 2sp
379 \def\CJKunbreakablekernthree{%
381 \hskip 0sp plus 2sp minus 2sp
384 \def\CJKbreakablekern{\hskip 0sp plus 2pt minus 2sp}
385 % BUG: \rlap should preserve the current font
387 \discretionary{\rlap{#1}}%
391 %% Hyphenation parameters
392 % If the badness does not exceed this, no hyphenation is
399 % Penalty added for the first hyphenation
400 % in the current paragraph
401 \hyphenpenalty=0 % Was 50
403 % Penalty added for subsequent hyphenations
404 \exhyphenpenalty=0 % Was 50
406 % TeX tries to minimize the demerit of the lines:
407 % (\linepenalty^2 + badness^2) + penalty^2
410 % If a tight line is followed by a loose one
411 % (or conversely), we add \adjdemerits
413 \adjdemerits=0 % Was 10000 % ???
415 % two hyphens on consecutive lines also add
417 \doublehyphendemerits=0 % Was 10000
419 % A hyphen on the last line also adds to
421 \finalhyphendemerits=0 % Was 5000
423 % Minimum number of characters in the current word
424 % before or after a hyphenation point
428 % line break definition ends.