| 1 |
% Language definition file (part of polyglossia v2.10 -- 2026/04/18) |
| 2 |
% |
| 3 |
\ProvidesFile{gloss-korean.ldf}[polyglossia: module for Korean] |
| 4 |
|
| 5 |
\PolyglossiaSetup{korean}{ |
| 6 |
bcp47=ko, |
| 7 |
bcp47-language=ko, |
| 8 |
bcp47-script=Kore, |
| 9 |
script=Hangul, |
| 10 |
scripttag=hang, |
| 11 |
language=Korean, |
| 12 |
langtag=KOR, |
| 13 |
hyphennames={nohyphenation}, |
| 14 |
frenchspacing=true |
| 15 |
} |
| 16 |
|
| 17 |
% BCP-47 compliant aliases |
| 18 |
\setlanguagealias*{korean}{ko} |
| 19 |
|
| 20 |
\newif\if@korean@swapheadings |
| 21 |
\newif\if@korean@swapheaders |
| 22 |
|
| 23 |
\DeclareKeys[polyglossia/gloss/korean] |
| 24 |
{ |
| 25 |
variant.choices:nn = { plain, classic, modern } |
| 26 |
{% |
| 27 |
\edef\xpg@korean@variant{\the\numexpr\UseName{l_keys_choice_int}-1\relax}% |
| 28 |
}, |
| 29 |
variant.default:n = plain, |
| 30 |
captions.choices:nn = { hangul, hanja } |
| 31 |
{% |
| 32 |
\edef\xpg@korean@captions{\the\numexpr\UseName{l_keys_choice_int}-1\relax}% |
| 33 |
}, |
| 34 |
captions.default:n = hangul, |
| 35 |
swapstrings.choice:, |
| 36 |
swapstrings / all.code = |
| 37 |
{% |
| 38 |
\@korean@swapheadingstrue |
| 39 |
\@korean@swapheaderstrue |
| 40 |
}, |
| 41 |
swapstrings / headings.code = |
| 42 |
{% |
| 43 |
\@korean@swapheadingstrue |
| 44 |
\@korean@swapheadersfalse |
| 45 |
}, |
| 46 |
swapstrings / headers.code = |
| 47 |
{% |
| 48 |
\@korean@swapheadingsfalse |
| 49 |
\@korean@swapheaderstrue |
| 50 |
}, |
| 51 |
swapstrings / none.code = |
| 52 |
{% |
| 53 |
\@korean@swapheadingsfalse |
| 54 |
\@korean@swapheadersfalse |
| 55 |
}, |
| 56 |
swapstrings.default:n = all, |
| 57 |
swapstrings/unknown.code = \xpg@warning{Unknown Korean swapstrings value `#1'} |
| 58 |
} |
| 59 |
|
| 60 |
% Register default options |
| 61 |
\InitializeGlossOptions{korean}{variant=plain,swapstrings=all,captions=hangul} |
| 62 |
|
| 63 |
\def\captionskorean{% |
| 64 |
\ifcase\xpg@korean@captions\relax |
| 65 |
\captions@korean@hangul |
| 66 |
\else |
| 67 |
\captions@korean@hanja |
| 68 |
\fi |
| 69 |
\def\seename{$\rightarrow$}% |
| 70 |
\def\alsoname{$\Rightarrow$}% |
| 71 |
} |
| 72 |
\def\captions@korean@hangul{% |
| 73 |
\def\koreanTHEname{제}% |
| 74 |
\def\partname{편}% |
| 75 |
\def\chaptername{장}% |
| 76 |
\def\refname{참고문헌}% |
| 77 |
\def\abstractname{요약}% |
| 78 |
\def\bibname{참고문헌}% |
| 79 |
\def\prefacename{서문}% |
| 80 |
\def\appendixname{부록}% |
| 81 |
\def\contentsname{차례}% |
| 82 |
\def\listfigurename{그림 차례}% |
| 83 |
\def\listtablename{표 차례}% |
| 84 |
\def\indexname{찾아보기}% |
| 85 |
\def\figurename{그림}% |
| 86 |
\def\tablename{표}% |
| 87 |
\def\pagename{페이지}% |
| 88 |
\def\enclname{동봉}% |
| 89 |
\def\proofname{증명}% |
| 90 |
\def\headtoname{수신:}% |
| 91 |
\def\ccname{사본}% |
| 92 |
\def\glossaryname{용어집}% |
| 93 |
} |
| 94 |
\def\captions@korean@hanja{% |
| 95 |
\def\koreanTHEname{第}% |
| 96 |
\def\partname{篇}% |
| 97 |
\def\chaptername{章}% |
| 98 |
\def\refname{參考文獻}% |
| 99 |
\def\abstractname{要約}% |
| 100 |
\def\bibname{參考文獻}% |
| 101 |
\def\prefacename{序文}% |
| 102 |
\def\appendixname{附錄}% |
| 103 |
\def\contentsname{目次}% |
| 104 |
\def\listfigurename{圖版 目次}% |
| 105 |
\def\listtablename{表 目次}% |
| 106 |
\def\indexname{索引}% |
| 107 |
\def\figurename{圖版}% |
| 108 |
\def\tablename{表}% |
| 109 |
\def\pagename{面}% |
| 110 |
\def\enclname{同封}% |
| 111 |
\def\proofname{證明}% |
| 112 |
\def\headtoname{受信:}% |
| 113 |
\def\ccname{寫本}% |
| 114 |
\def\glossaryname{用語集}% |
| 115 |
} |
| 116 |
|
| 117 |
\def\korean@appendix@chapapp{\appendixname}% to exclude appendix |
| 118 |
|
| 119 |
\def\korean@headingsformat{% |
| 120 |
% change chapter and part headings |
| 121 |
\if@korean@swapheadings |
| 122 |
% With titlesec |
| 123 |
\@ifundefined{titleformat}{% |
| 124 |
% With KOMA |
| 125 |
\@ifundefined{sectionformat}{% |
| 126 |
% With memoir |
| 127 |
\@ifundefined{@memptsize}{% |
| 128 |
% With standard classes |
| 129 |
\@ifundefined{@makechapterhead}{}{% |
| 130 |
\let\xpg@save@chap@format\@makechapterhead |
| 131 |
\patchcmd{\@makechapterhead}% |
| 132 |
{\@chapapp\space \thechapter}% |
| 133 |
{% |
| 134 |
\ifx\@chapapp\korean@appendix@chapapp |
| 135 |
\appendixname\space \thechapter |
| 136 |
\else |
| 137 |
\koreanTHEname\space \thechapter\space \@chapapp |
| 138 |
\fi |
| 139 |
}% |
| 140 |
{}% |
| 141 |
{\xpg@warning{Failed to patch chapter for Korean}}% |
| 142 |
}% |
| 143 |
\@ifundefined{NR@part}{% not hyperref |
| 144 |
\@ifundefined{@part}{}{% |
| 145 |
\ifpatchable{\@part}% |
| 146 |
{\partname\nobreakspace\thepart}% |
| 147 |
{\let\xpg@save@part@format\@part |
| 148 |
\patchcmd{\@part}% |
| 149 |
{\partname\nobreakspace\thepart}% |
| 150 |
{\koreanTHEname\nobreakspace \thepart\nobreakspace \partname}% |
| 151 |
{}% |
| 152 |
{\@ifundefined{part}{}{\xpg@warning{Failed to patch part for Korean}}}}% |
| 153 |
{}% |
| 154 |
}% (end \ifdefined\@part) |
| 155 |
}{% Hyperref (nameref) |
| 156 |
\let\xpg@save@part@format\NR@part |
| 157 |
\patchcmd{\NR@part}% |
| 158 |
{\partname\nobreakspace\thepart}% |
| 159 |
{\koreanTHEname\nobreakspace \thepart\nobreakspace \partname}% |
| 160 |
{}% |
| 161 |
{\xpg@warning{Failed to patch part for Korean}}% |
| 162 |
}% (end not hyperref) |
| 163 |
}{% (\ifdefined\@memptsize) |
| 164 |
\@ifundefined{@makechapterhead}{}{% |
| 165 |
\let\xpg@save@chap@format\@makechapterhead |
| 166 |
\patchcmd{\@makechapterhead}% |
| 167 |
{\printchaptername \chapternamenum \printchapternum}% |
| 168 |
{% |
| 169 |
\ifx\@chapapp\korean@appendix@chapapp |
| 170 |
\printchaptername\relax\chapternamenum \printchapternum |
| 171 |
\else |
| 172 |
\printkoreanchapterthe \printchapternum\chapternamenum \printchaptername |
| 173 |
\fi |
| 174 |
}% |
| 175 |
{}% |
| 176 |
{\xpg@warning{Failed to patch chapter for Korean}}% |
| 177 |
\ifdefined\printkoreanchapterthe\else |
| 178 |
\def\printkoreanchapterthe{% |
| 179 |
\ifpatchable\printchaptername\@chapapp |
| 180 |
{\chapnamefont\koreanTHEname\chapternamenum}{}}% |
| 181 |
\fi |
| 182 |
}% |
| 183 |
\@ifundefined{NR@part}{% not hyperref |
| 184 |
\@ifundefined{@part}{}{% |
| 185 |
\let\xpg@save@part@format\@part |
| 186 |
\patchcmd{\@part}% |
| 187 |
{\printpartname \partnamenum \printpartnum}% |
| 188 |
{\printkoreanpartthe \printpartnum\partnamenum \printpartname}% |
| 189 |
{}% |
| 190 |
{\xpg@warning{Failed to patch part for Korean}}% |
| 191 |
\ifdefined\printkoreanpartthe\else |
| 192 |
\def\printkoreanpartthe{\partnamefont\koreanTHEname\partnamenum}% |
| 193 |
\fi |
| 194 |
}% |
| 195 |
}{% Hyperref (nameref) |
| 196 |
\let\xpg@save@part@format\NR@part |
| 197 |
\patchcmd{\NR@part}% |
| 198 |
{\printpartname \partnamenum \printpartnum}% |
| 199 |
{\printkoreanpartthe \printpartnum\partnamenum \printpartname}% |
| 200 |
{}% |
| 201 |
{\xpg@warning{Failed to patch part for Korean}}% |
| 202 |
\ifdefined\printkoreanpartthe\else |
| 203 |
\def\printkoreanpartthe{\partnamefont\koreanTHEname\partnamenum}% |
| 204 |
\fi |
| 205 |
}% |
| 206 |
}% (end \ifdefined\@memptsize) |
| 207 |
}{% (\ifdefined\sectionformat) |
| 208 |
\@ifundefined{partformat}{}{% |
| 209 |
\let\xpg@save@part@format\partformat |
| 210 |
\renewcommand*{\partformat}{\koreanTHEname~\thepart~\partname}% |
| 211 |
}% |
| 212 |
\@ifundefined{chapterformat}{}{% |
| 213 |
\let\xpg@save@chap@format\chapterformat |
| 214 |
\renewcommand*{\chapterformat}{\mbox{% |
| 215 |
\IfChapterUsesPrefixLine |
| 216 |
{% |
| 217 |
\ifx\@chapapp\korean@appendix@chapapp |
| 218 |
\chapapp\nobreakspace \thechapter\autodot |
| 219 |
\else |
| 220 |
\koreanTHEname\nobreakspace \thechapter\nobreakspace \chapapp\autodot |
| 221 |
\fi |
| 222 |
}% |
| 223 |
{\thechapter\autodot\enskip}% |
| 224 |
}}% |
| 225 |
}% |
| 226 |
}% (end \ifdefined\sectionformat) |
| 227 |
}{% (\ifdefined\titleformat) |
| 228 |
\@ifundefined{NR@part}{% not hyperref |
| 229 |
\@ifundefined{@part}{}{% |
| 230 |
\let\xpg@save@part@format\@part |
| 231 |
\patchcmd{\@part}% |
| 232 |
{\partname\nobreakspace\thepart}% |
| 233 |
{\koreanTHEname\nobreakspace \thepart\nobreakspace \partname}% |
| 234 |
{}% |
| 235 |
{\xpg@warning{Failed to patch part for Korean}}% |
| 236 |
}% |
| 237 |
}{% Hyperref (nameref) |
| 238 |
\let\xpg@save@part@format\NR@part |
| 239 |
\patchcmd{\NR@part}% |
| 240 |
{\partname\nobreakspace\thepart}% |
| 241 |
{\koreanTHEname\nobreakspace \thepart\nobreakspace \partname}% |
| 242 |
{}% |
| 243 |
{\xpg@warning{Failed to patch part for Korean}}% |
| 244 |
}% |
| 245 |
\@ifundefined{chapter}{}{% |
| 246 |
\titleformat\chapter[display]% |
| 247 |
{\@ifundefined{ttl@fil}{\raggedright}{\ttl@fil}\ttl@fonts\ttl@sizes6}% |
| 248 |
{% |
| 249 |
\ifx\@chapapp\korean@appendix@chapapp |
| 250 |
\appendixname\space \thechapter |
| 251 |
\else |
| 252 |
\koreanTHEname\space \thechapter\space \@chapapp |
| 253 |
\fi |
| 254 |
}{.8\baselineskip}{\ttl@sizes\z@\ttl@passexplicit}% |
| 255 |
}% |
| 256 |
}% (end \ifdefined\titleformat) |
| 257 |
\fi % (end \if@korean@swapheadings) |
| 258 |
% |
| 259 |
% Change running headers |
| 260 |
\if@korean@swapheaders |
| 261 |
\@ifundefined{chapterformat}{% |
| 262 |
\@ifundefined{@memptsize}{% |
| 263 |
% With standard classes |
| 264 |
\@ifundefined{chaptermark}{}{% |
| 265 |
\ifpatchable{\chaptermark}% |
| 266 |
{\@chapapp\ \thechapter}% |
| 267 |
{\let\xpg@save@chaptermark@format\chaptermark |
| 268 |
\patchcmd{\chaptermark}% |
| 269 |
{\@chapapp\ \thechapter}% |
| 270 |
{% |
| 271 |
\ifx\@chapapp\korean@appendix@chapapp |
| 272 |
\appendixname\ \thechapter |
| 273 |
\else |
| 274 |
\koreanTHEname\ \thechapter\ \@chapapp |
| 275 |
\fi |
| 276 |
}% |
| 277 |
{}% |
| 278 |
{\xpg@warning{Failed to patch chaptermark for Korean}}}% |
| 279 |
{}% |
| 280 |
}% (end \ifdefined\chaptermark) |
| 281 |
}{% (\ifdefined\@memptsize) |
| 282 |
% With memoir |
| 283 |
\let\xpg@save@chaptermark@format\chaptermark |
| 284 |
\patchcmd{\chaptermark}% |
| 285 |
{\@chapapp\ \@nameuse{thechapter}}% |
| 286 |
{% |
| 287 |
\ifx\@chapapp\korean@appendix@chapapp |
| 288 |
\appendixname\ \@nameuse{thechapter}% |
| 289 |
\else |
| 290 |
\koreanTHEname\ \@nameuse{thechapter}\ \@chapapp |
| 291 |
\fi |
| 292 |
}% |
| 293 |
{}% |
| 294 |
{\xpg@warning{Failed to patch chaptermark for Korean}}% |
| 295 |
}% (end \ifdefined\@memptsize) |
| 296 |
}{% (\ifdefined\chapterformat) |
| 297 |
% With KOMA |
| 298 |
\let\xpg@save@chaptermark@format\chaptermarkformat |
| 299 |
\renewcommand*\chaptermarkformat{% |
| 300 |
\IfChapterUsesPrefixLine |
| 301 |
{% |
| 302 |
\ifx\@chapapp\korean@appendix@chapapp |
| 303 |
\chapapp\ \thechapter\autodot |
| 304 |
\else |
| 305 |
\koreanTHEname\ \thechapter\ \chapapp\autodot |
| 306 |
\fi |
| 307 |
}% |
| 308 |
{\thechapter\autodot}% |
| 309 |
\enskip |
| 310 |
}% |
| 311 |
}% (end \ifdefined\chapterformat) |
| 312 |
\fi % (end \if@korean@swapheaders) |
| 313 |
} |
| 314 |
|
| 315 |
\def\nokorean@headingsformat{% |
| 316 |
% Reset chapter and part heading |
| 317 |
\@ifundefined{titleformat}{% |
| 318 |
\@ifundefined{sectionformat}{% |
| 319 |
% With memoir and standard classes |
| 320 |
\@ifundefined{xpg@save@part@format}{}{% |
| 321 |
\@ifundefined{NR@part}{% |
| 322 |
\let\@part\xpg@save@part@format |
| 323 |
}{% |
| 324 |
\let\NR@part\xpg@save@part@format |
| 325 |
}% |
| 326 |
}% |
| 327 |
\@ifundefined{xpg@save@chap@format}{}{% |
| 328 |
\let\@makechapterhead\xpg@save@chap@format |
| 329 |
}% |
| 330 |
}{% |
| 331 |
% With KOMA |
| 332 |
\@ifundefined{xpg@save@part@format}{}{% |
| 333 |
\let\partformat\xpg@save@part@format |
| 334 |
}% |
| 335 |
\@ifundefined{xpg@save@chap@format}{}{% |
| 336 |
\let\chapterformat\xpg@save@chap@format |
| 337 |
}% |
| 338 |
}% (end \ifdefined\sectionformat) |
| 339 |
}{% (\ifdefined\titleformat) |
| 340 |
% With titlesec |
| 341 |
\@ifundefined{xpg@save@part@format}{}{% |
| 342 |
\@ifundefined{NR@part}{% |
| 343 |
\let\@part\xpg@save@part@format |
| 344 |
}{% |
| 345 |
\let\NR@part\xpg@save@part@format |
| 346 |
}% |
| 347 |
}% |
| 348 |
\@ifundefined{chapter}{}{% |
| 349 |
\titleformat\chapter[display]% |
| 350 |
{\@ifundefined{ttl@fil}{\raggedright}{\ttl@fil}\ttl@fonts\ttl@sizes6}% |
| 351 |
{\@chapapp\space\thechapter}{.8\baselineskip}{\ttl@sizes\z@\ttl@passexplicit}% |
| 352 |
}% |
| 353 |
}% (end \ifdefined\titleformat) |
| 354 |
% |
| 355 |
% Reset headers |
| 356 |
\@ifundefined{chaptermarkformat}{% |
| 357 |
\@ifundefined{chaptermark}{}{% |
| 358 |
% With memoir and standard classes |
| 359 |
\@ifundefined{xpg@save@chaptermark@format}{}{% |
| 360 |
\let\chaptermark\xpg@save@chaptermark@format |
| 361 |
}% |
| 362 |
}% (end \ifdefined\chaptermark) |
| 363 |
}{% |
| 364 |
% With KOMA |
| 365 |
\@ifundefined{xpg@save@chaptermark@format}{}{% |
| 366 |
\let\chaptermarkformat\xpg@save@chaptermark@format |
| 367 |
}% |
| 368 |
}% (end \ifdefined\chapterformat) |
| 369 |
} |
| 370 |
|
| 371 |
\def\datekorean{% |
| 372 |
\ifcase\xpg@korean@captions\relax |
| 373 |
\def\today{\the\year 년 \the\month 월 \the\day 일}% |
| 374 |
\else |
| 375 |
\def\today{\the\year 年 \the\month 月 \the\day 日}% |
| 376 |
\fi |
| 377 |
} |
| 378 |
|
| 379 |
\def\koreanAlph#1{\expandafter\@koreanAlph\csname c@#1\endcsname} |
| 380 |
\def\@koreanAlph#1{% |
| 381 |
\ifcase#1\or 가\or 나\or 다\or 라\or 마\or 바\or 사\or 아\or 자\or |
| 382 |
차\or 카\or 타\or 파\or 하\else\xpg@ill@value{#1}{@koreanAlph}\fi |
| 383 |
} |
| 384 |
|
| 385 |
\def\koreanalph#1{\expandafter\@koreanalph\csname c@#1\endcsname} |
| 386 |
\def\@koreanalph#1{% |
| 387 |
\ifcase#1\or ㄱ\or ㄴ\or ㄷ\or ㄹ\or ㅁ\or ㅂ\or ㅅ\or ㅇ\or ㅈ\or |
| 388 |
ㅊ\or ㅋ\or ㅌ\or ㅍ\or ㅎ\else\xpg@ill@value{#1}{@koreanalph}\fi |
| 389 |
} |
| 390 |
|
| 391 |
\def\korean@numbers{% |
| 392 |
\let\@alph\@koreanalph |
| 393 |
\let\@Alph\@koreanAlph |
| 394 |
} |
| 395 |
\def\nokorean@numbers{% |
| 396 |
\let\@alph\latin@alph |
| 397 |
\let\@Alph\latin@Alph |
| 398 |
} |
| 399 |
\let\nokorean@globalnumbers\nokorean@numbers |
| 400 |
|
| 401 |
\ifxetex |
| 402 |
\def\inlineextras@korean{% |
| 403 |
\ifcase\xpg@korean@variant\relax |
| 404 |
\XeTeXinterchartokenstate\z@ |
| 405 |
\XeTeXlinebreakpenalty 50 |
| 406 |
\XeTeXlinebreakskip 0pt plus.05em minus .01em |
| 407 |
\or |
| 408 |
\setvariantkoreaninterchartoks |
| 409 |
\setvariantkoreancharclasses |
| 410 |
\def\XPGKOhalfdim{\dimexpr.5em\relax}% |
| 411 |
\XeTeXinterchartokenstate\@ne |
| 412 |
\XeTeXlinebreakpenalty \z@ |
| 413 |
\XeTeXlinebreakskip 0pt plus.1em minus .01em |
| 414 |
\else |
| 415 |
\setvariantkoreaninterchartoks |
| 416 |
\setvariantkoreancharclasses |
| 417 |
\def\XPGKOhalfdim{\dimexpr.5\fontdimen\tw@\font\relax}% |
| 418 |
\XeTeXinterchartokenstate\@ne |
| 419 |
\XeTeXlinebreakpenalty 50 |
| 420 |
\XeTeXlinebreakskip 0pt plus.05em minus .01em |
| 421 |
\fi |
| 422 |
\XeTeXlinebreaklocale "ko" |
| 423 |
} |
| 424 |
\def\noextras@korean{% |
| 425 |
\ifcase\xpg@korean@variant\relax |
| 426 |
\else |
| 427 |
\unsetvariantkoreaninterchartoks |
| 428 |
\unsetvariantkoreancharclasses |
| 429 |
\fi |
| 430 |
\XeTeXinterchartokenstate\z@ |
| 431 |
\XeTeXlinebreakpenalty\z@ |
| 432 |
\XeTeXlinebreakskip\z@skip |
| 433 |
\XeTeXlinebreaklocale "" |
| 434 |
\noextras@korean@common |
| 435 |
} |
| 436 |
% \XeTeXlinebreaklocale is global, |
| 437 |
% so we need to reset after nested language got closed |
| 438 |
\def\nestedextras@korean{% |
| 439 |
\XeTeXlinebreaklocale "ko"\relax |
| 440 |
} |
| 441 |
\else % luatex |
| 442 |
\def\inlineextras@korean{\xpg@attr@cjkspacing\xpg@korean@variant\relax} |
| 443 |
\def\noextras@korean{% |
| 444 |
\unsetattribute\xpg@attr@cjkspacing |
| 445 |
\noextras@korean@common |
| 446 |
} |
| 447 |
\fi |
| 448 |
|
| 449 |
\def\blockextras@korean{% |
| 450 |
\inlineextras@korean |
| 451 |
\korean@headingsformat |
| 452 |
} |
| 453 |
|
| 454 |
\def\noextras@korean@common{% |
| 455 |
\nokorean@headingsformat |
| 456 |
} |
| 457 |
|
| 458 |
% disable user commands for Josa upon hyperref package |
| 459 |
\AddToHook{package/hyperref/after}[polyglossia/korean]{% |
| 460 |
\pdfstringdefDisableCommands{\let\rieul\relax \let\jung\relax \let\jong\relax}} |
| 461 |
|
| 462 |
\ifluatex % luatex |
| 463 |
\protected\def\inhibitglue{\hskip\z@skip} |
| 464 |
\ifdefined\newattribute\else |
| 465 |
\let\newattribute\newluatexattribute |
| 466 |
\let\unsetattribute\unsetluatexattribute |
| 467 |
\fi |
| 468 |
\ifdefined\xpg@attr@cjkspacing\else |
| 469 |
\newattribute\xpg@attr@cjkspacing |
| 470 |
\fi |
| 471 |
\newattribute\xpg@attr@autojosa |
| 472 |
% user commands for Josa |
| 473 |
% Josa : particles in Korean grammar that immediately follow a noun or pronoun. |
| 474 |
% Josa might vary depending on previous character. |
| 475 |
\protected\def\rieul{\global\let\xpg@josa@zwang\@ne} |
| 476 |
\protected\def\jung {\global\let\xpg@josa@zwang\tw@} |
| 477 |
\protected\def\jong {\global\let\xpg@josa@zwang\thr@@} |
| 478 |
\protected\def\은{\begingroup\xpg@attr@autojosa\xpg@josa@zwang 은\endgroup\xpg@reset@josa} |
| 479 |
\let\는\은 |
| 480 |
\protected\def\을{\begingroup\xpg@attr@autojosa\xpg@josa@zwang 을\endgroup\xpg@reset@josa} |
| 481 |
\let\를\을 |
| 482 |
\protected\def\와{\begingroup\xpg@attr@autojosa\xpg@josa@zwang 와\endgroup\xpg@reset@josa} |
| 483 |
\let\과\와 |
| 484 |
\protected\def\가{\begingroup\xpg@attr@autojosa\xpg@josa@zwang 가\endgroup\xpg@reset@josa} |
| 485 |
\protected\def\이{\begingroup\xpg@attr@autojosa\xpg@josa@zwang 이\endgroup\xpg@reset@josa} |
| 486 |
\protected\def\라{\이 라} |
| 487 |
\protected\def\으{\begingroup\xpg@attr@autojosa\xpg@josa@zwang 으\endgroup\xpg@reset@josa} |
| 488 |
\protected\def\로{\으 로} |
| 489 |
\def\xpg@reset@josa {\global\let\xpg@josa@zwang\z@}\xpg@reset@josa |
| 490 |
% load lua file for korean |
| 491 |
\directlua{ require "polyglossia-cjk-spacing" } |
| 492 |
\endinput\fi |
| 493 |
|
| 494 |
% XeTeX |
| 495 |
% user commands for Josa |
| 496 |
\protected\def\jong {\global\let\XPGKO@let@josa=0}\jong |
| 497 |
\protected\def\rieul{\global\let\XPGKO@let@josa=1} |
| 498 |
\protected\def\jung {\global\let\XPGKO@let@josa=2} |
| 499 |
\protected\def\가{\xpg@make@josa 가이} |
| 500 |
\protected\def\이{\futurelet\@let@token\xpg@make@josa@I} |
| 501 |
\protected\def\은{\xpg@make@josa 는은} \let\는\은 |
| 502 |
\protected\def\을{\xpg@make@josa 를을} \let\를\을 |
| 503 |
\protected\def\와{\xpg@make@josa 와과} \let\과\와 |
| 504 |
\protected\def\으{\xpg@make@josa \empty 으} |
| 505 |
\protected\def\로{\으 로} |
| 506 |
\protected\def\라{\xpg@make@josa 라{이라}} |
| 507 |
\def\xpg@make@josa@II{\xpg@make@josa\relax 이} |
| 508 |
\def\xpg@make@josa@I{% |
| 509 |
\if\noexpand\@let@token\relax |
| 510 |
\count@\m@ne |
| 511 |
\else |
| 512 |
\ifcat\xpg@catcode@letter\@let@token |
| 513 |
\expandafter\expandafter\expandafter\count@\expandafter |
| 514 |
\xpg@letter@to@num\meaning\@let@token\relax |
| 515 |
\else |
| 516 |
\count@\m@ne |
| 517 |
\fi |
| 518 |
\fi |
| 519 |
\ifnum 0\ifnum\count@>"ABFF \ifnum\count@<"D7A4 1\fi\fi>\z@ |
| 520 |
\expandafter\xpg@make@josa@II |
| 521 |
\else |
| 522 |
\expandafter\가 |
| 523 |
\fi |
| 524 |
} |
| 525 |
\def\xpg@make@josa#1#2{% |
| 526 |
\ifcat\xpg@catcode@letter\XPGKO@let@josa |
| 527 |
\expandafter\expandafter\expandafter\count@\expandafter |
| 528 |
\xpg@letter@to@num\meaning\XPGKO@let@josa\relax |
| 529 |
\else\ifcat\xpg@catcode@other\XPGKO@let@josa |
| 530 |
\expandafter\expandafter\expandafter\count@\expandafter |
| 531 |
\xpg@character@to@num\meaning\XPGKO@let@josa\relax |
| 532 |
\fi\fi |
| 533 |
\ifnum\count@<"3260 |
| 534 |
\else\ifnum\count@<"3280 \advance\count@-"60 |
| 535 |
\else\ifnum\count@<"AC00 |
| 536 |
\else\ifnum\count@<"D7A4 % Hangul syllables |
| 537 |
\advance\count@-"AC00 |
| 538 |
\@tempcnta\count@ \divide\@tempcnta28 \multiply\@tempcnta28 |
| 539 |
\advance\count@-\@tempcnta \advance\count@"11A7 |
| 540 |
\else\ifnum\count@<"FF00 |
| 541 |
\else\ifnum\count@<"FF5B \advance\count@-"FEE0 |
| 542 |
\fi\fi\fi\fi\fi \fi |
| 543 |
\ifnum\count@<"11A8 |
| 544 |
\ifnum "30=\count@ \count@\z@ % 0 |
| 545 |
\else\ifnum "31=\count@ \count@\@ne % 1 |
| 546 |
\else\ifnum "33=\count@ \count@\z@ % 3 |
| 547 |
\else\ifnum "36=\count@ \count@\z@ % 6 |
| 548 |
\else\ifnum "37=\count@ \count@\@ne % 7 |
| 549 |
\else\ifnum "38=\count@ \count@\@ne % 8 |
| 550 |
\else\ifnum "4C=\count@ \count@\@ne % L |
| 551 |
\else\ifnum "4D=\count@ \count@\z@ % M |
| 552 |
\else\ifnum "4E=\count@ \count@\z@ % N |
| 553 |
\else\ifnum "6C=\count@ \count@\@ne % l |
| 554 |
\else\ifnum "6D=\count@ \count@\z@ % m |
| 555 |
\else\ifnum "6E=\count@ \count@\z@ % n |
| 556 |
\fi\fi\fi\fi\fi \fi\fi\fi\fi\fi \fi\fi |
| 557 |
\else\ifnum\count@<"1200 |
| 558 |
\ifnum\count@="11AF \count@\@ne \else \count@\z@ \fi |
| 559 |
\else\ifnum\count@<"3131 |
| 560 |
\else\ifnum\count@<"318F |
| 561 |
\ifnum \count@="3139 \count@\@ne |
| 562 |
\else\ifnum\count@<"314F \count@\z@ |
| 563 |
\else\ifnum\count@>"3164 |
| 564 |
\ifnum\count@<"3187 \count@\z@ \fi |
| 565 |
\fi\fi\fi |
| 566 |
\else\ifnum\count@<"3200 |
| 567 |
\else\ifnum\count@<"321F |
| 568 |
\ifnum \count@="3203 \count@\@ne |
| 569 |
\else\ifnum\count@<"320E \count@\z@ |
| 570 |
\fi\fi |
| 571 |
\else\ifnum\count@<"D7CB |
| 572 |
\else\ifnum\count@<"D7FC \count@\z@ |
| 573 |
\fi\fi\fi\fi\fi \fi\fi\fi |
| 574 |
\ifcase\count@ #2% jong |
| 575 |
\or \ifx#1\empty\else#2\fi% rieul |
| 576 |
\else #1% jung |
| 577 |
\fi |
| 578 |
} |
| 579 |
\def\xpg@character@to@num #1 #2 #3#4\relax{`#3\relax} |
| 580 |
\let\xpg@letter@to@num\xpg@character@to@num |
| 581 |
\begingroup |
| 582 |
\catcode`A=11 \catcode`0=12 |
| 583 |
\global\let\xpg@catcode@letter=A \global\let\xpg@catcode@other=0 |
| 584 |
\endgroup |
| 585 |
% macros for interchartoks (Josa selection) |
| 586 |
\def\XPGKOstartID{\global\futurelet\XPGKO@let@josa\XPGKO@skipID} |
| 587 |
\def\XPGKOstartAA{\global\futurelet\XPGKO@let@josa\XPGKO@skipAA} |
| 588 |
\def\XPGKO@skipID{\XeTeXinterchartoks\XeTeXcharclassBoundary\XeTeXcharclassID{\empty}} |
| 589 |
\def\XPGKO@skipAA{\XeTeXinterchartoks\XeTeXcharclassBoundary\XPGKOcharclassAA{\empty}} |
| 590 |
\def\XPGKOstopID {% |
| 591 |
\XeTeXinterchartoks\XeTeXcharclassBoundary\XeTeXcharclassID{% |
| 592 |
\ifnum\lastnodetype=12 % |
| 593 |
\ifcase\lastkern |
| 594 |
\or \or \or \or \or |
| 595 |
\or \unkern\unkern |
| 596 |
\or \unkern\unkern \XPGKOhalfhalf |
| 597 |
\or \unkern\unkern \XPGKOquarterquarter |
| 598 |
\or \unkern\unkern \XPGKOhalfzero |
| 599 |
\fi |
| 600 |
\fi |
| 601 |
\XPGKOstartID}} |
| 602 |
\def\XPGKOstopAA {% |
| 603 |
\XeTeXinterchartoks\XeTeXcharclassBoundary\XPGKOcharclassAA{% |
| 604 |
\ifnum\lastnodetype=12 % |
| 605 |
\ifcase\lastkern |
| 606 |
\or \or \or \or \or |
| 607 |
\or \unkern\unkern |
| 608 |
\or \unkern\unkern \XPGKOhalfhalf |
| 609 |
\or \unkern\unkern \XPGKOquarterquarter |
| 610 |
\or \unkern\unkern \XPGKOhalfzero |
| 611 |
\fi |
| 612 |
\fi |
| 613 |
\XPGKOstartAA}} |
| 614 |
% macros for interchartoks (CJK punctuations) |
| 615 |
\def\XPGKOstartOP#1{\leavevmode |
| 616 |
\hbox to.5em\bgroup\hss\XeTeXinterchartokenstate\z@ #1\egroup |
| 617 |
\kern-6sp \kern6sp } |
| 618 |
\def\XPGKOstartCL#1{\leavevmode |
| 619 |
\hbox to.5em\bgroup\XeTeXinterchartokenstate\z@ #1\hss\egroup |
| 620 |
\kern-7sp \kern7sp } |
| 621 |
\def\XPGKOstartMD#1{\leavevmode |
| 622 |
\hbox to.5em\bgroup\hss\XeTeXinterchartokenstate\z@ #1\hss\egroup |
| 623 |
\kern-8sp \kern8sp } |
| 624 |
\def\XPGKOstartFS#1{\leavevmode |
| 625 |
\hbox to.5em\bgroup\XeTeXinterchartokenstate\z@ #1\hss\egroup |
| 626 |
\kern-9sp \kern9sp } |
| 627 |
\let\XPGKOnobreak \nobreak |
| 628 |
\def\XPGKOhalfzero {\hskip \XPGKOhalfdim \relax}% |
| 629 |
\def\XPGKOhalfhalf {\hskip \XPGKOhalfdim minus \XPGKOhalfdim \relax}% |
| 630 |
\def\XPGKOhalfquarter {\hskip \XPGKOhalfdim minus.5\XPGKOhalfdim \relax}% |
| 631 |
\def\XPGKOquarterquarter {\hskip .5\XPGKOhalfdim minus.5\XPGKOhalfdim \relax}% |
| 632 |
\def\XPGKOiiiquarterquarter{\hskip1.5\XPGKOhalfdim minus.5\XPGKOhalfdim \relax}% |
| 633 |
\def\XPGKOlatincjk {\hskip .5\XPGKOhalfdim plus.25\XPGKOhalfdim minus.125\XPGKOhalfdim}% |
| 634 |
% user macro to force zero skip |
| 635 |
\let\inhibitglue\relax |
| 636 |
% initialize interchartoks and classes |
| 637 |
\ifdim\the\XeTeXversion\XeTeXrevision pt<0.99994pt |
| 638 |
\let\XeTeXcharclassIgnore \@cclvi |
| 639 |
\let\XeTeXcharclassBoundary\@cclv |
| 640 |
\else |
| 641 |
\chardef\XeTeXcharclassIgnore =4096 |
| 642 |
\chardef\XeTeXcharclassBoundary=4095 |
| 643 |
\fi |
| 644 |
\ifdefined\XeTeXcharclassID\else |
| 645 |
\ifdefined\xtxHanGlue |
| 646 |
\let\XeTeXcharclassID\@ne |
| 647 |
\let\XeTeXcharclassOP\tw@ |
| 648 |
\let\XeTeXcharclassCL\thr@@ |
| 649 |
\else % email from JW |
| 650 |
\newXeTeXintercharclass\XeTeXcharclassID |
| 651 |
\newXeTeXintercharclass\XeTeXcharclassOP |
| 652 |
\newXeTeXintercharclass\XeTeXcharclassCL |
| 653 |
\global\let\XeTeXcharclassCJ\XeTeXcharclassID |
| 654 |
\global\let\XeTeXcharclassEX\XeTeXcharclassCL |
| 655 |
\global\let\XeTeXcharclassIS\XeTeXcharclassCL |
| 656 |
\global\let\XeTeXcharclassNS\XeTeXcharclassCL |
| 657 |
\global\let\XeTeXcharclassCM\XeTeXcharclassIgnore |
| 658 |
\input load-unicode-xetex-classes % |
| 659 |
\fi |
| 660 |
\fi |
| 661 |
% assign Hangul |
| 662 |
\count@="AC00 \loop |
| 663 |
\XeTeXcharclass\count@\XeTeXcharclassID |
| 664 |
\ifnum\count@<"D7A3 |
| 665 |
\advance\count@\@ne |
| 666 |
\repeat |
| 667 |
\count@="1100 \loop |
| 668 |
\XeTeXcharclass\count@\XeTeXcharclassID |
| 669 |
\ifnum\count@<"11FF |
| 670 |
\advance\count@\@ne |
| 671 |
\repeat |
| 672 |
\count@="A960 \loop |
| 673 |
\XeTeXcharclass\count@\XeTeXcharclassID |
| 674 |
\ifnum\count@<"A97C |
| 675 |
\advance\count@\@ne |
| 676 |
\repeat |
| 677 |
\count@="D7B0 \loop |
| 678 |
\XeTeXcharclass\count@\XeTeXcharclassID |
| 679 |
\ifnum\count@<"D7FB |
| 680 |
\advance\count@\@ne |
| 681 |
\repeat |
| 682 |
% more classes |
| 683 |
\newXeTeXintercharclass\XPGKOcharclassMD % ・ : ; |
| 684 |
\newXeTeXintercharclass\XPGKOcharclassFS % 。 . |
| 685 |
\newXeTeXintercharclass\XPGKOcharclassLD % ― … ‥ |
| 686 |
\newXeTeXintercharclass\XPGKOcharclassEX % ? ! |
| 687 |
\newXeTeXintercharclass\XPGKOcharclassAO % ascii ( |
| 688 |
\newXeTeXintercharclass\XPGKOcharclassAC % ascii ) |
| 689 |
\newXeTeXintercharclass\XPGKOcharclassAA % ascii letters/numbers |
| 690 |
% unset all interchartoks |
| 691 |
\def\unsetvariantkoreaninterchartoks{% |
| 692 |
\@tfor\@tmpa :=\XeTeXcharclassID\XeTeXcharclassOP\XeTeXcharclassCL\XPGKOcharclassMD\XPGKOcharclassFS |
| 693 |
\XPGKOcharclassLD\XPGKOcharclassEX\XPGKOcharclassAO\XPGKOcharclassAC\XPGKOcharclassAA |
| 694 |
\do{\count@\XeTeXcharclassBoundary \loop |
| 695 |
\XeTeXinterchartoks\@tmpa\count@{}% |
| 696 |
\XeTeXinterchartoks\count@\@tmpa{}% |
| 697 |
\ifnum\count@=\XeTeXcharclassBoundary \count@\m@ne \fi |
| 698 |
\ifnum\count@<\xe@alloc@intercharclass |
| 699 |
\advance\count@\@ne |
| 700 |
\repeat |
| 701 |
}% |
| 702 |
} |
| 703 |
% interchartoks for classic/modern variants |
| 704 |
\def\setvariantkoreaninterchartoks{% |
| 705 |
\count@\XeTeXcharclassBoundary \loop |
| 706 |
\ifnum\count@=\XeTeXcharclassID\else |
| 707 |
\ifnum\count@=\XeTeXcharclassOP\else |
| 708 |
\ifnum\count@=\XeTeXcharclassCL\else |
| 709 |
\ifnum\count@=\XPGKOcharclassMD\else |
| 710 |
\ifnum\count@=\XPGKOcharclassFS\else |
| 711 |
\ifnum\count@=\XPGKOcharclassAA\else |
| 712 |
\XeTeXinterchartoks\count@\XeTeXcharclassID{\XPGKOstartID}% |
| 713 |
\XeTeXinterchartoks\count@\XeTeXcharclassOP{\XPGKOstartOP}% |
| 714 |
\XeTeXinterchartoks\count@\XeTeXcharclassCL{\XPGKOstartCL}% |
| 715 |
\XeTeXinterchartoks\count@\XPGKOcharclassMD{\XPGKOstartMD}% |
| 716 |
\XeTeXinterchartoks\count@\XPGKOcharclassFS{\XPGKOstartFS}% |
| 717 |
\XeTeXinterchartoks\count@\XPGKOcharclassAA{\XPGKOstartAA}% |
| 718 |
\XeTeXinterchartoks\XeTeXcharclassID\count@{\XPGKOstopID}% |
| 719 |
\XeTeXinterchartoks\XPGKOcharclassAA\count@{\XPGKOstopAA}% |
| 720 |
\fi\fi\fi\fi\fi\fi |
| 721 |
\ifnum\count@=\XeTeXcharclassBoundary \count@\m@ne \fi |
| 722 |
\ifnum\count@<\xe@alloc@intercharclass |
| 723 |
\advance\count@\@ne |
| 724 |
\repeat |
| 725 |
% |
| 726 |
\XeTeXinterchartoks\XPGKOcharclassAA\XeTeXcharclassID{\XPGKOstopAA\XPGKOlatincjk\XPGKOstartID}% |
| 727 |
\XeTeXinterchartoks\XPGKOcharclassAA\XeTeXcharclassOP{\XPGKOstopAA\XPGKOhalfhalf\XPGKOstartOP}% |
| 728 |
\XeTeXinterchartoks\XPGKOcharclassAA\XeTeXcharclassCL{\XPGKOstopAA\XPGKOstartCL}% |
| 729 |
\XeTeXinterchartoks\XPGKOcharclassAA\XPGKOcharclassMD{\XPGKOstopAA\XPGKOnobreak\XPGKOquarterquarter\XPGKOstartMD}% |
| 730 |
\XeTeXinterchartoks\XPGKOcharclassAA\XPGKOcharclassFS{\XPGKOstopAA\XPGKOstartFS}% |
| 731 |
\XeTeXinterchartoks\XPGKOcharclassAA\XPGKOcharclassAA{\XPGKOstartAA}% |
| 732 |
% |
| 733 |
\XeTeXinterchartoks\XeTeXcharclassID\XeTeXcharclassID{\XPGKOstartID}% |
| 734 |
\XeTeXinterchartoks\XeTeXcharclassID\XeTeXcharclassOP{\XPGKOstopID\XPGKOhalfhalf\XPGKOstartOP}% |
| 735 |
\XeTeXinterchartoks\XeTeXcharclassID\XeTeXcharclassCL{\XPGKOstopID\XPGKOstartCL}% |
| 736 |
\XeTeXinterchartoks\XeTeXcharclassID\XPGKOcharclassMD{\XPGKOstopID\XPGKOnobreak\XPGKOquarterquarter\XPGKOstartMD}% |
| 737 |
\XeTeXinterchartoks\XeTeXcharclassID\XPGKOcharclassFS{\XPGKOstopID\XPGKOstartFS}% |
| 738 |
\XeTeXinterchartoks\XeTeXcharclassID\XPGKOcharclassAO{\XPGKOstopID\XPGKOlatincjk}% |
| 739 |
\XeTeXinterchartoks\XeTeXcharclassID\XPGKOcharclassAA{\XPGKOstopID\XPGKOlatincjk\XPGKOstartAA}% |
| 740 |
% |
| 741 |
\XPGKOstopID |
| 742 |
\XPGKOstopAA |
| 743 |
\XeTeXinterchartoks\XeTeXcharclassBoundary\XeTeXcharclassOP{% |
| 744 |
\ifnum\lastnodetype=12 % |
| 745 |
\ifcase\lastkern |
| 746 |
\or \or \or \or \or |
| 747 |
\or \unkern\unkern |
| 748 |
\or \unkern\unkern \XPGKOhalfhalf |
| 749 |
\or \unkern\unkern \XPGKOquarterquarter |
| 750 |
\or \unkern\unkern \XPGKOhalfzero |
| 751 |
\fi |
| 752 |
\fi |
| 753 |
\XPGKOstartOP}% |
| 754 |
\XeTeXinterchartoks\XeTeXcharclassBoundary\XeTeXcharclassCL{% |
| 755 |
\ifnum\lastnodetype=12 % |
| 756 |
\ifcase\lastkern |
| 757 |
\or \or \or \or \or |
| 758 |
\or \unkern\unkern |
| 759 |
\or \unkern\unkern |
| 760 |
\or \unkern\unkern \XPGKOnobreak\XPGKOquarterquarter |
| 761 |
\or \unkern\unkern |
| 762 |
\fi |
| 763 |
\fi |
| 764 |
\XPGKOstartCL}% |
| 765 |
\XeTeXinterchartoks\XeTeXcharclassBoundary\XPGKOcharclassMD{% |
| 766 |
\ifnum\lastnodetype=12 % |
| 767 |
\ifcase\lastkern |
| 768 |
\or \or \or \or \or |
| 769 |
\or \unkern\unkern \XPGKOnobreak\XPGKOquarterquarter |
| 770 |
\or \unkern\unkern \XPGKOnobreak\XPGKOquarterquarter |
| 771 |
\or \unkern\unkern \XPGKOnobreak\XPGKOhalfquarter |
| 772 |
\or \unkern\unkern \XPGKOnobreak\XPGKOiiiquarterquarter |
| 773 |
\fi |
| 774 |
\fi |
| 775 |
\XPGKOstartMD}% |
| 776 |
\XeTeXinterchartoks\XeTeXcharclassBoundary\XPGKOcharclassFS{% |
| 777 |
\ifnum\lastnodetype=12 % |
| 778 |
\ifcase\lastkern |
| 779 |
\or \or \or \or \or |
| 780 |
\or \unkern\unkern |
| 781 |
\or \unkern\unkern |
| 782 |
\or \unkern\unkern \XPGKOnobreak\XPGKOquarterquarter |
| 783 |
\or \unkern\unkern |
| 784 |
\fi |
| 785 |
\fi |
| 786 |
\XPGKOstartFS}% |
| 787 |
\XeTeXinterchartoks\XeTeXcharclassBoundary\XPGKOcharclassLD{% |
| 788 |
\ifnum\lastnodetype=12 % |
| 789 |
\ifcase\lastkern |
| 790 |
\or \or \or \or \or |
| 791 |
\or \unkern\unkern |
| 792 |
\or \unkern\unkern \XPGKOnobreak\XPGKOhalfhalf |
| 793 |
\or \unkern\unkern \XPGKOnobreak\XPGKOquarterquarter |
| 794 |
\or \unkern\unkern \XPGKOnobreak\XPGKOhalfzero |
| 795 |
\fi |
| 796 |
\fi |
| 797 |
}% |
| 798 |
\XeTeXinterchartoks\XeTeXcharclassBoundary\XPGKOcharclassEX{% |
| 799 |
\ifnum\lastnodetype=12 % |
| 800 |
\ifcase\lastkern |
| 801 |
\or \or \or \or \or |
| 802 |
\or \unkern\unkern |
| 803 |
\or \unkern\unkern \XPGKOnobreak\XPGKOhalfhalf |
| 804 |
\or \unkern\unkern \XPGKOnobreak\XPGKOquarterquarter |
| 805 |
\or \unkern\unkern \XPGKOnobreak\XPGKOhalfzero |
| 806 |
\fi |
| 807 |
\fi |
| 808 |
}% |
| 809 |
\XeTeXinterchartoks\XeTeXcharclassBoundary\XPGKOcharclassAO{% |
| 810 |
\ifnum\lastnodetype=12 % |
| 811 |
\ifcase\lastkern |
| 812 |
\or \or \or \or \or |
| 813 |
\or \unkern\unkern |
| 814 |
\or \unkern\unkern \XPGKOhalfhalf |
| 815 |
\or \unkern\unkern \XPGKOquarterquarter |
| 816 |
\or \unkern\unkern \XPGKOhalfzero |
| 817 |
\fi |
| 818 |
\fi |
| 819 |
}% |
| 820 |
\XeTeXinterchartoks\XeTeXcharclassBoundary\XPGKOcharclassAC{% |
| 821 |
\ifnum\lastnodetype=12 % |
| 822 |
\ifcase\lastkern |
| 823 |
\or \or \or \or \or |
| 824 |
\or \unkern\unkern |
| 825 |
\or \unkern\unkern \XPGKOnobreak\XPGKOhalfhalf |
| 826 |
\or \unkern\unkern \XPGKOnobreak\XPGKOquarterquarter |
| 827 |
\or \unkern\unkern \XPGKOnobreak\XPGKOhalfzero |
| 828 |
\fi |
| 829 |
\fi |
| 830 |
}% |
| 831 |
% |
| 832 |
\XeTeXinterchartoks\XPGKOcharclassLD\XeTeXcharclassOP{\XPGKOhalfhalf\XPGKOstartOP}% |
| 833 |
\XeTeXinterchartoks\XPGKOcharclassLD\XPGKOcharclassMD{\XPGKOnobreak\XPGKOquarterquarter\XPGKOstartMD}% |
| 834 |
% |
| 835 |
\XeTeXinterchartoks\XPGKOcharclassEX\XeTeXcharclassID{\XPGKOhalfhalf\XPGKOstartID}% |
| 836 |
\XeTeXinterchartoks\XPGKOcharclassEX\XeTeXcharclassOP{\XPGKOhalfhalf\XPGKOstartOP}% |
| 837 |
\XeTeXinterchartoks\XPGKOcharclassEX\XPGKOcharclassMD{\XPGKOnobreak\XPGKOquarterquarter\XPGKOstartMD}% |
| 838 |
\XeTeXinterchartoks\XPGKOcharclassEX\XPGKOcharclassAO{\XPGKOhalfhalf}% |
| 839 |
\XeTeXinterchartoks\XPGKOcharclassEX\XPGKOcharclassAC{\XPGKOnobreak\XPGKOhalfhalf}% |
| 840 |
\XeTeXinterchartoks\XPGKOcharclassEX\XPGKOcharclassAA{\XPGKOhalfhalf\XPGKOstartAA}% |
| 841 |
% |
| 842 |
\XeTeXinterchartoks\XPGKOcharclassAO\XeTeXcharclassOP{\XPGKOnobreak\XPGKOhalfhalf\XPGKOstartOP}% |
| 843 |
\XeTeXinterchartoks\XPGKOcharclassAO\XPGKOcharclassMD{\XPGKOnobreak\XPGKOquarterquarter\XPGKOstartMD}% |
| 844 |
% |
| 845 |
\XeTeXinterchartoks\XPGKOcharclassAC\XeTeXcharclassID{\XPGKOlatincjk\XPGKOstartID}% |
| 846 |
\XeTeXinterchartoks\XPGKOcharclassAC\XeTeXcharclassOP{\XPGKOhalfhalf\XPGKOstartOP}% |
| 847 |
\XeTeXinterchartoks\XPGKOcharclassAC\XPGKOcharclassMD{\XPGKOnobreak\XPGKOquarterquarter\XPGKOstartMD}% |
| 848 |
} |
| 849 |
% char classes for classic/modern variants |
| 850 |
\def\setvariantkoreancharclasses{} |
| 851 |
\def\unsetvariantkoreancharclasses{} |
| 852 |
\def\@tmpa#1=#2{% |
| 853 |
\edef\setvariantkoreancharclasses{% |
| 854 |
\unexpanded\expandafter{\setvariantkoreancharclasses |
| 855 |
\XeTeXcharclass#1=#2}}% |
| 856 |
\edef\unsetvariantkoreancharclasses{% |
| 857 |
\noexpand\XeTeXcharclass#1=\the\XeTeXcharclass#1\relax |
| 858 |
\unexpanded\expandafter{\unsetvariantkoreancharclasses}}% |
| 859 |
} |
| 860 |
\count@"30 \loop % 0 .. 9 |
| 861 |
\expandafter\@tmpa\the\count@=\XPGKOcharclassAA |
| 862 |
\ifnum\count@<"39 |
| 863 |
\advance\count@\@ne |
| 864 |
\repeat |
| 865 |
\count@"41 \loop % A .. Z |
| 866 |
\expandafter\@tmpa\the\count@=\XPGKOcharclassAA |
| 867 |
\ifnum\count@<"5A |
| 868 |
\advance\count@\@ne |
| 869 |
\repeat |
| 870 |
\count@"61 \loop % a .. z |
| 871 |
\expandafter\@tmpa\the\count@=\XPGKOcharclassAA |
| 872 |
\ifnum\count@<"7A |
| 873 |
\advance\count@\@ne |
| 874 |
\repeat |
| 875 |
% NS |
| 876 |
\@tmpa "3005=\XeTeXcharclassID % 々 IDEOGRAPHIC ITERATION MARK |
| 877 |
\@tmpa "301C=\XeTeXcharclassID % 〜 WAVE DASH |
| 878 |
\@tmpa "303B=\XeTeXcharclassID % 〻 VERTICAL IDEOGRAPHIC ITERATION MARK |
| 879 |
\@tmpa "303C=\XeTeXcharclassID % 〼 MASU MARK |
| 880 |
\@tmpa "309B=\XeTeXcharclassID % ゛ KATAKANA-HIRAGANA VOICED SOUND MARK |
| 881 |
\@tmpa "309C=\XeTeXcharclassID % ゜ KATAKANA-HIRAGANA SEMI-VOICED SOUND MARK |
| 882 |
\@tmpa "309D=\XeTeXcharclassID % ゝ HIRAGANA ITERATION MARK |
| 883 |
\@tmpa "309E=\XeTeXcharclassID % ゞ HIRAGANA VOICED ITERATION MARK |
| 884 |
\@tmpa "30A0=\XeTeXcharclassID % ゠ KATAKANA-HIRAGANA DOUBLE HYPHEN |
| 885 |
\@tmpa "30FD=\XeTeXcharclassID % ヽ KATAKANA ITERATION MARK |
| 886 |
\@tmpa "30FE=\XeTeXcharclassID % ヾ KATAKANA VOICED ITERATION MARK |
| 887 |
\@tmpa "A015=\XeTeXcharclassID % ꀕ YI SYLLABLE ITERATION MARK |
| 888 |
\@tmpa "FF9E=\XeTeXcharclassID % ゙ HALFWIDTH KATAKANA VOICED SOUND MARK |
| 889 |
\@tmpa "FF9F=\XeTeXcharclassID % ゚ HALFWIDTH KATAKANA SEMI-VOICED SOUND MARK |
| 890 |
% IS |
| 891 |
\@tmpa "FE13=\XeTeXcharclassID % ︓ PRESENTATION FORM FOR VERTICAL COLON |
| 892 |
\@tmpa "FE14=\XeTeXcharclassID % ︔ PRESENTATION FORM FOR VERTICAL SEMICOLON |
| 893 |
% CJ |
| 894 |
\ifnum\the\XeTeXcharclass"3041=\XeTeXcharclassID \else |
| 895 |
\@tmpa "3041=\XeTeXcharclassID % ぁ HIRAGANA LETTER SMALL A |
| 896 |
\@tmpa "3043=\XeTeXcharclassID % ぃ HIRAGANA LETTER SMALL I |
| 897 |
\@tmpa "3045=\XeTeXcharclassID % ぅ HIRAGANA LETTER SMALL U |
| 898 |
\@tmpa "3047=\XeTeXcharclassID % ぇ HIRAGANA LETTER SMALL E |
| 899 |
\@tmpa "3049=\XeTeXcharclassID % ぉ HIRAGANA LETTER SMALL O |
| 900 |
\@tmpa "3063=\XeTeXcharclassID % っ HIRAGANA LETTER SMALL TU |
| 901 |
\@tmpa "3083=\XeTeXcharclassID % ゃ HIRAGANA LETTER SMALL YA |
| 902 |
\@tmpa "3085=\XeTeXcharclassID % ゅ HIRAGANA LETTER SMALL YU |
| 903 |
\@tmpa "3087=\XeTeXcharclassID % ょ HIRAGANA LETTER SMALL YO |
| 904 |
\@tmpa "308E=\XeTeXcharclassID % ゎ HIRAGANA LETTER SMALL WA |
| 905 |
\@tmpa "3095=\XeTeXcharclassID % ゕ HIRAGANA LETTER SMALL KA |
| 906 |
\@tmpa "3096=\XeTeXcharclassID % ゖ HIRAGANA LETTER SMALL KE |
| 907 |
\@tmpa "30A1=\XeTeXcharclassID % ァ KATAKANA LETTER SMALL A |
| 908 |
\@tmpa "30A3=\XeTeXcharclassID % ィ KATAKANA LETTER SMALL I |
| 909 |
\@tmpa "30A5=\XeTeXcharclassID % ゥ KATAKANA LETTER SMALL U |
| 910 |
\@tmpa "30A7=\XeTeXcharclassID % ェ KATAKANA LETTER SMALL E |
| 911 |
\@tmpa "30A9=\XeTeXcharclassID % ォ KATAKANA LETTER SMALL O |
| 912 |
\@tmpa "30C3=\XeTeXcharclassID % ッ KATAKANA LETTER SMALL TU |
| 913 |
\@tmpa "30E3=\XeTeXcharclassID % ャ KATAKANA LETTER SMALL YA |
| 914 |
\@tmpa "30E5=\XeTeXcharclassID % ュ KATAKANA LETTER SMALL YU |
| 915 |
\@tmpa "30E7=\XeTeXcharclassID % ョ KATAKANA LETTER SMALL YO |
| 916 |
\@tmpa "30EE=\XeTeXcharclassID % ヮ KATAKANA LETTER SMALL WA |
| 917 |
\@tmpa "30F5=\XeTeXcharclassID % ヵ KATAKANA LETTER SMALL KA |
| 918 |
\@tmpa "30F6=\XeTeXcharclassID % ヶ KATAKANA LETTER SMALL KE |
| 919 |
\@tmpa "30FC=\XeTeXcharclassID % ー KATAKANA-HIRAGANA PROLONGED SOUND MARK |
| 920 |
\count@"31F0 \loop |
| 921 |
\expandafter\@tmpa\the\count@=\XeTeXcharclassID |
| 922 |
\ifnum\count@<"31FF |
| 923 |
\advance\count@\@ne |
| 924 |
\repeat |
| 925 |
\count@"FF67 \loop |
| 926 |
\expandafter\@tmpa\the\count@=\XeTeXcharclassID |
| 927 |
\ifnum\count@<"FF70 |
| 928 |
\advance\count@\@ne |
| 929 |
\repeat |
| 930 |
\fi |
| 931 |
% |
| 932 |
\@tmpa "28=\XPGKOcharclassAO % ( LEFT PARENTHESIS |
| 933 |
\@tmpa "5B=\XPGKOcharclassAO % [ LEFT SQUARE BRACKET |
| 934 |
\@tmpa "60=\XPGKOcharclassAO % ` GRAVE ACCENT |
| 935 |
\@tmpa "7B=\XPGKOcharclassAO % { LEFT CURLY BRACKET |
| 936 |
\@tmpa "AB=\XPGKOcharclassAO % « LEFT-POINTING DOUBLE ANGLE QUOTATION MARK |
| 937 |
% |
| 938 |
\@tmpa "21=\XPGKOcharclassAC % ! EXCLAMATION MARK |
| 939 |
\@tmpa "27=\XPGKOcharclassAC % ' APOSTROPHE |
| 940 |
\@tmpa "29=\XPGKOcharclassAC % ) RIGHT PARENTHESIS |
| 941 |
\@tmpa "2C=\XPGKOcharclassAC % , COMMA |
| 942 |
\@tmpa "2E=\XPGKOcharclassAC % . FULL STOP |
| 943 |
\@tmpa "3B=\XPGKOcharclassAC % ; SEMICOLON |
| 944 |
\@tmpa "3F=\XPGKOcharclassAC % ? QUESTION MARK |
| 945 |
\@tmpa "5D=\XPGKOcharclassAC % ] RIGHT SQUARE BRACKET |
| 946 |
\@tmpa "7D=\XPGKOcharclassAC % } RIGHT CURLY BRACKET |
| 947 |
\@tmpa "BB=\XPGKOcharclassAC % » RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK |
| 948 |
% |
| 949 |
\@tmpa "2018=\XeTeXcharclassOP % ‘ LEFT SINGLE QUOTATION MARK |
| 950 |
\@tmpa "201C=\XeTeXcharclassOP % “ LEFT DOUBLE QUOTATION MARK |
| 951 |
% |
| 952 |
\@tmpa "2019=\XeTeXcharclassCL % ’ RIGHT SINGLE QUOTATION MARK |
| 953 |
\@tmpa "201D=\XeTeXcharclassCL % ” RIGHT DOUBLE QUOTATION MARK |
| 954 |
% NS |
| 955 |
\@tmpa "00B7=\XPGKOcharclassMD % · MIDDLE DOT |
| 956 |
\@tmpa "30FB=\XPGKOcharclassMD % ・ KATAKANA MIDDLE DOT |
| 957 |
\@tmpa "FE54=\XPGKOcharclassMD % ﹔ SMALL SEMICOLON |
| 958 |
\@tmpa "FE55=\XPGKOcharclassMD % ﹕ SMALL COLON |
| 959 |
\@tmpa "FF1A=\XPGKOcharclassMD % : FULLWIDTH COLON |
| 960 |
\@tmpa "FF1B=\XPGKOcharclassMD % ; FULLWIDTH SEMICOLON |
| 961 |
\@tmpa "FF65=\XPGKOcharclassMD % ・ HALFWIDTH KATAKANA MIDDLE DOT |
| 962 |
% |
| 963 |
\@tmpa "3002=\XPGKOcharclassFS % 。 IDEOGRAPHIC FULL STOP |
| 964 |
\@tmpa "FE12=\XPGKOcharclassFS % ︒ PRESENTATION FORM FOR VERTICAL IDEOGRAPHIC FULL STOP |
| 965 |
\@tmpa "FE52=\XPGKOcharclassFS % ﹒ SMALL FULL STOP |
| 966 |
\@tmpa "FF0E=\XPGKOcharclassFS % . FULLWIDTH FULL STOP |
| 967 |
\@tmpa "FF61=\XPGKOcharclassFS % 。 HALFWIDTH IDEOGRAPHIC FULL STOP |
| 968 |
% |
| 969 |
\@tmpa "2014=\XPGKOcharclassLD % — EM DASH |
| 970 |
\@tmpa "2015=\XPGKOcharclassLD % ― HORIZONTAL BAR |
| 971 |
\@tmpa "2025=\XPGKOcharclassLD % ‥ TWO DOT LEADER |
| 972 |
\@tmpa "2026=\XPGKOcharclassLD % … HORIZONTAL ELLIPSIS |
| 973 |
% EX |
| 974 |
\@tmpa "FE15=\XPGKOcharclassEX % ︕ PRESENTATION FORM FOR VERTICAL EXCLAMATION MARK |
| 975 |
\@tmpa "FE16=\XPGKOcharclassEX % ︖ PRESENTATION FORM FOR VERTICAL QUESTION MARK |
| 976 |
\@tmpa "FE56=\XPGKOcharclassEX % ﹖ SMALL QUESTION MARK |
| 977 |
\@tmpa "FE57=\XPGKOcharclassEX % ﹗ SMALL EXCLAMATION MARK |
| 978 |
\@tmpa "FF01=\XPGKOcharclassEX % ! FULLWIDTH EXCLAMATION MARK |
| 979 |
\@tmpa "FF1F=\XPGKOcharclassEX % ? FULLWIDTH QUESTION MARK |
| 980 |
|
| 981 |
% vim:ft=tex:tw=0:sw=4:ts=4:expandtab |