| 1 |
% utf8-csf.tex |
| 2 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 3 |
% This file implements the conversion from UTF8 to ISO-8859-2 |
| 4 |
% encoding (used by CSfonts in csplain and cslatex). |
| 5 |
% The conversion is done by encTeX v. Dec 2002 or higher. |
| 6 |
% |
| 7 |
% Copyright (C) 2002-2003 Petr Olsak |
| 8 |
% Copyright (C) 2003 David Necas (Yeti) |
| 9 |
% |
| 10 |
% This program is free software; you can redistribute it and/or modify |
| 11 |
% it under the terms of the GNU General Public License as published by |
| 12 |
% the Free Software Foundation; either version 2 of the License, or |
| 13 |
% (at your option) any later version. |
| 14 |
% |
| 15 |
% This program is distributed in the hope that it will be useful, |
| 16 |
% but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 17 |
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 18 |
% GNU General Public License for more details. |
| 19 |
% |
| 20 |
% You should have received a copy of the GNU General Public License |
| 21 |
% along with this program; if not, write to the Free Software |
| 22 |
% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 23 |
|
| 24 |
\ifx\mubyte\undefined |
| 25 |
\errhelp{Sorry, you can't use this file without encTeX ver. Jan. 2003.} |
| 26 |
\errmessage{The encTeX extension of TeX is not found} |
| 27 |
\endinput \fi |
| 28 |
|
| 29 |
% first, we set the identity mapping in xord/xchr: |
| 30 |
|
| 31 |
\bgroup |
| 32 |
\ifx\xordcode\undefined |
| 33 |
\errhelp{May be, you are using this file from csplain which disables |
| 34 |
the \xordcode primitive. Use |
| 35 |
initex \let\enc=u \input csplain.ini |
| 36 |
for csplain generation instead this file. |
| 37 |
If you are using ISO8859-2 input encoding in csplain, |
| 38 |
you can skip this error message.} |
| 39 |
\errmessage{I can't set the xord/xchr to identity mapping} |
| 40 |
\def\xchrcode\count255=\count255{} \def\xordcode\count255=\count255{} |
| 41 |
\fi |
| 42 |
\count255=128 |
| 43 |
\loop \xordcode\count255=\count255 |
| 44 |
\xchrcode\count255=\count255 |
| 45 |
\advance\count255 by 1 |
| 46 |
\ifnum \count255<256 \repeat |
| 47 |
\egroup |
| 48 |
|
| 49 |
|
| 50 |
% we remove the current conversion table, if exists: |
| 51 |
|
| 52 |
{\catcode`\^^@=12 |
| 53 |
\gdef\clearmubytes{\bgroup \count255=1 |
| 54 |
\loop \uccode`X=\count255 |
| 55 |
\uppercase{\mubyte XX\endmubyte}% |
| 56 |
\advance\count255 by1 |
| 57 |
\ifnum\count255<256 \repeat |
| 58 |
\mubyte ^^@^^@\endmubyte |
| 59 |
\egroup} |
| 60 |
} |
| 61 |
\clearmubytes |
| 62 |
|
| 63 |
% include these first, so we can redefine some characters better later here |
| 64 |
|
| 65 |
\input utf8cseq |
| 66 |
\input utf8math |
| 67 |
\input utf8unkn |
| 68 |
|
| 69 |
% now, the conversion table is created: |
| 70 |
|
| 71 |
\mubyte ^^c1 ^^c3^^81\endmubyte % \'A |
| 72 |
\mubyte ^^e1 ^^c3^^a1\endmubyte % \'a |
| 73 |
\mubyte ^^c9 ^^c3^^89\endmubyte % \'E |
| 74 |
\mubyte ^^e9 ^^c3^^a9\endmubyte % \'e |
| 75 |
\mubyte ^^cd ^^c3^^8d\endmubyte % \'I |
| 76 |
\mubyte ^^ed ^^c3^^ad\endmubyte % \'i |
| 77 |
\mubyte ^^d3 ^^c3^^93\endmubyte % \'O |
| 78 |
\mubyte ^^f3 ^^c3^^b3\endmubyte % \'o |
| 79 |
\mubyte ^^da ^^c3^^9a\endmubyte % \'U |
| 80 |
\mubyte ^^fa ^^c3^^ba\endmubyte % \'u |
| 81 |
\mubyte ^^dd ^^c3^^9d\endmubyte % \'Y |
| 82 |
\mubyte ^^fd ^^c3^^bd\endmubyte % \'y |
| 83 |
\mubyte ^^d4 ^^c3^^94\endmubyte % \^O |
| 84 |
\mubyte ^^f4 ^^c3^^b4\endmubyte % \^o |
| 85 |
\mubyte ^^c4 ^^c3^^84\endmubyte % \"A |
| 86 |
\mubyte ^^e4 ^^c3^^a4\endmubyte % \"a |
| 87 |
\mubyte ^^d6 ^^c3^^96\endmubyte % \"O |
| 88 |
\mubyte ^^f6 ^^c3^^b6\endmubyte % \"o |
| 89 |
\mubyte ^^dc ^^c3^^9c\endmubyte % \"U |
| 90 |
\mubyte ^^fc ^^c3^^bc\endmubyte % \"u |
| 91 |
|
| 92 |
\mubyte ^^c8 ^^c4^^8c\endmubyte % \v C |
| 93 |
\mubyte ^^e8 ^^c4^^8d\endmubyte % \v c |
| 94 |
\mubyte ^^cf ^^c4^^8e\endmubyte % \v D |
| 95 |
\mubyte ^^ef ^^c4^^8f\endmubyte % \v d |
| 96 |
\mubyte ^^cc ^^c4^^9a\endmubyte % \v E |
| 97 |
\mubyte ^^ec ^^c4^^9b\endmubyte % \v e |
| 98 |
\mubyte ^^c5 ^^c4^^b9\endmubyte % \' L |
| 99 |
\mubyte ^^e5 ^^c4^^ba\endmubyte % \' l |
| 100 |
\mubyte ^^a5 ^^c4^^bd\endmubyte % \v L |
| 101 |
\mubyte ^^b5 ^^c4^^be\endmubyte % \v l |
| 102 |
|
| 103 |
\mubyte ^^d2 ^^c5^^87\endmubyte % \v N |
| 104 |
\mubyte ^^f2 ^^c5^^88\endmubyte % \v n |
| 105 |
\mubyte ^^d8 ^^c5^^98\endmubyte % \v R |
| 106 |
\mubyte ^^f8 ^^c5^^99\endmubyte % \v r |
| 107 |
\mubyte ^^a9 ^^c5^^a0\endmubyte % \v S |
| 108 |
\mubyte ^^b9 ^^c5^^a1\endmubyte % \v s |
| 109 |
\mubyte ^^ab ^^c5^^a4\endmubyte % \v T |
| 110 |
\mubyte ^^bb ^^c5^^a5\endmubyte % \v t |
| 111 |
\mubyte ^^d9 ^^c5^^ae\endmubyte % \r U |
| 112 |
\mubyte ^^f9 ^^c5^^af\endmubyte % \r u |
| 113 |
\mubyte ^^ae ^^c5^^bd\endmubyte % \v Z |
| 114 |
\mubyte ^^be ^^c5^^be\endmubyte % \v z |
| 115 |
\mubyte ^^c0 ^^c5^^94\endmubyte % \' R |
| 116 |
\mubyte ^^e0 ^^c5^^95\endmubyte % \' r |
| 117 |
|
| 118 |
% Non-characters |
| 119 |
\chardef\erqq="22 |
| 120 |
\mubyte \erqq ^^e2^^80^^9d\endmubyte % right double quotation mark |
| 121 |
\chardef\erq="27 |
| 122 |
\mubyte \erq ^^e2^^80^^99\endmubyte % right single quotation mark |
| 123 |
% there's no \elqq, \elq, they are the same Unicode character as \crqq, \crq |
| 124 |
\chardef\endash="7B |
| 125 |
\chardef\emdash="7C |
| 126 |
\mubyte \endash ^^e2^^80^^93\endmubyte % en dash |
| 127 |
\mubyte \emdash ^^e2^^80^^94\endmubyte % em dash |
| 128 |
\chardef\utfinvexclamation="3C |
| 129 |
\chardef\utfinvquestion="3E |
| 130 |
\mubyte \utfinvexclamation ^^c2^^a1\endmubyte % inverted exclamation mark |
| 131 |
\mubyte \utfinvquestion ^^c2^^bf\endmubyte % inverted question mark |
| 132 |
\chardef\utfligatureff="0B |
| 133 |
\chardef\utfligaturefi="0C |
| 134 |
\chardef\utfligaturefl="0D |
| 135 |
\chardef\utfligatureffi="0E |
| 136 |
\chardef\utfligatureffl="0F |
| 137 |
\mubyte \utfligatureff ^^ef^^ac^^80\endmubyte % latin small ligature ff |
| 138 |
\mubyte \utfligaturefi ^^ef^^ac^^81\endmubyte % latin small ligature fi |
| 139 |
\mubyte \utfligaturefl ^^ef^^ac^^82\endmubyte % latin small ligature fl |
| 140 |
\mubyte \utfligatureffi ^^ef^^ac^^83\endmubyte % latin small ligature ffi |
| 141 |
\mubyte \utfligatureffl ^^ef^^ac^^84\endmubyte % latin small ligature ffl |
| 142 |
|
| 143 |
% You can add more UTF-8 codes here. You can map these codes to |
| 144 |
% control sequences (see encdoc.tex for more datails) so, |
| 145 |
% the number of UTF-8 codes examined by TeX is unlimited. |
| 146 |
|
| 147 |
% ... |
| 148 |
|
| 149 |
\mubytein=1 \mubyteout=3 |
| 150 |
|
| 151 |
%% for compatibility with hyphen.lan file: |
| 152 |
\let\csaccents=\relax \let\cmaccents=\relax |
| 153 |
|
| 154 |
% now we still have to deal with accents |
| 155 |
\input csfmacro \input encmacro |
| 156 |
|
| 157 |
% This needed for hyphenation patterns. |
| 158 |
|
| 159 |
% (1) Czech/Slovak alphabet |
| 160 |
% input TeX lc uc sf cat prn sequence |
| 161 |
\setcharcode ? "C1 "E1 "C1 999 11 1 \texaccent \'A |
| 162 |
\setcharcode ? "E1 "E1 "C1 1000 11 1 \texaccent \'a |
| 163 |
\setcharcode ? "C4 "E4 "C4 999 11 1 \texaccent \"A |
| 164 |
\setcharcode ? "E4 "E4 "C4 1000 11 1 \texaccent \"a |
| 165 |
\setcharcode ? "C8 "E8 "C8 999 11 1 \texaccent \v C |
| 166 |
\setcharcode ? "E8 "E8 "C8 1000 11 1 \texaccent \v c |
| 167 |
\setcharcode ? "CF "EF "CF 999 11 1 \texaccent \v D |
| 168 |
\setcharcode ? "EF "EF "CF 1000 11 1 \texaccent \v d |
| 169 |
\setcharcode ? "C9 "E9 "C9 999 11 1 \texaccent \'E |
| 170 |
\setcharcode ? "E9 "E9 "C9 1000 11 1 \texaccent \'e |
| 171 |
\setcharcode ? "CC "EC "CC 999 11 1 \texaccent \v E |
| 172 |
\setcharcode ? "EC "EC "CC 1000 11 1 \texaccent \v e |
| 173 |
\setcharcode ? "CD "ED "CD 999 11 1 \texaccent \'I |
| 174 |
\setcharcode ? "ED "ED "CD 1000 11 1 \texaccent \'i \texaccent \'\i |
| 175 |
\setcharcode ? "C5 "E5 "C5 999 11 1 \texaccent \'L |
| 176 |
\setcharcode ? "E5 "E5 "C5 1000 11 1 \texaccent \'l |
| 177 |
\setcharcode ? "A5 "B5 "A5 999 11 1 \texaccent \v L |
| 178 |
\setcharcode ? "B5 "B5 "A5 1000 11 1 \texaccent \v l |
| 179 |
\setcharcode ? "D2 "F2 "D2 999 11 1 \texaccent \v N |
| 180 |
\setcharcode ? "F2 "F2 "D2 1000 11 1 \texaccent \v n |
| 181 |
\setcharcode ? "D3 "F3 "D3 999 11 1 \texaccent \'O |
| 182 |
\setcharcode ? "F3 "F3 "D3 1000 11 1 \texaccent \'o |
| 183 |
\setcharcode ? "D4 "F4 "D4 999 11 1 \texaccent \^O |
| 184 |
\setcharcode ? "F4 "F4 "D4 1000 11 1 \texaccent \^o |
| 185 |
\setcharcode ? "D6 "F6 "D6 999 11 1 \texaccent \"O |
| 186 |
\setcharcode ? "F6 "F6 "D6 1000 11 1 \texaccent \"o |
| 187 |
\setcharcode ? "C0 "E0 "C0 999 11 1 \texaccent \'R |
| 188 |
\setcharcode ? "E0 "E0 "C0 1000 11 1 \texaccent \'r |
| 189 |
\setcharcode ? "D8 "F8 "D8 999 11 1 \texaccent \v R |
| 190 |
\setcharcode ? "F8 "F8 "D8 1000 11 1 \texaccent \v r |
| 191 |
\setcharcode ? "A9 "B9 "A9 999 11 1 \texaccent \v S |
| 192 |
\setcharcode ? "B9 "B9 "A9 1000 11 1 \texaccent \v s |
| 193 |
\setcharcode ? "AB "BB "AB 999 11 1 \texaccent \v T |
| 194 |
\setcharcode ? "BB "BB "AB 1000 11 1 \texaccent \v t |
| 195 |
\setcharcode ? "DA "FA "DA 999 11 1 \texaccent \'U |
| 196 |
\setcharcode ? "FA "FA "DA 1000 11 1 \texaccent \'u |
| 197 |
\setcharcode ? "D9 "F9 "D9 999 11 1 \texaccent \r U |
| 198 |
\setcharcode ? "F9 "F9 "D9 1000 11 1 \texaccent \r u |
| 199 |
\setcharcode ? "DC "FC "DC 999 11 1 \texaccent \"U |
| 200 |
\setcharcode ? "FC "FC "DC 1000 11 1 \texaccent \"u |
| 201 |
\setcharcode ? "DD "FD "DD 999 11 1 \texaccent \'Y |
| 202 |
\setcharcode ? "FD "FD "DD 1000 11 1 \texaccent \'y |
| 203 |
\setcharcode ? "AE "BE "AE 999 11 1 \texaccent \v Z |
| 204 |
\setcharcode ? "BE "BE "AE 1000 11 1 \texaccent \v z |
| 205 |
|
| 206 |
\redefaccent \' |
| 207 |
\redefaccent \v |
| 208 |
\redefaccent \" |
| 209 |
\redefaccent \^ |
| 210 |
\redefaccent \r |
| 211 |
|
| 212 |
% finally, we can forbid the encTeX primitives in document |
| 213 |
% (this is commented out here because it is only an example): |
| 214 |
|
| 215 |
% \let\xordcode=\undefined \let\xchrcode=\undefined\let |
| 216 |
% \let\xprncode=\undefined |
| 217 |
% \let\mubytein=\undefined \let\mubyteout=\undefined |
| 218 |
% \let\mubyte=\undefined \let\endmubyte=\undefined |
| 219 |
|
| 220 |
\endinput |
| 221 |
|