| 1 |
%% |
| 2 |
%% This is file `lutf8x.def', |
| 3 |
%% generated with the docstrip utility. |
| 4 |
%% |
| 5 |
%% The original source files were: |
| 6 |
%% |
| 7 |
%% luainputenc.dtx (with options: `defx') |
| 8 |
%% This is a generated file. |
| 9 |
%% |
| 10 |
%% Written in 2009, 2010 by Manuel Pegourie-Gonnard and Elie Roux. |
| 11 |
%% |
| 12 |
%% This work is under the CC0 license. As an exception, the files |
| 13 |
%% luainputenc.sty, lutf8.def and lutf8x.def have more restrictions. |
| 14 |
%% See these file for more details. |
| 15 |
%% |
| 16 |
%% People who helped on this package: |
| 17 |
%% Javier Bezos |
| 18 |
%% Will Robertson |
| 19 |
%% Hans Hagen |
| 20 |
%% Heiko Oberdiek |
| 21 |
%% Javier Mugica |
| 22 |
%% |
| 23 |
%% This work consists of the main source file luainputenc.dtx |
| 24 |
%% and the derived files |
| 25 |
%% luainputenc.sty, luainputenc.lua, lutf8.def, lutf8x.def, |
| 26 |
%% and luainputenc.pdf |
| 27 |
%% |
| 28 |
%% This file was adapted from utf8.def, which copyright is: |
| 29 |
%% Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 |
| 30 |
%% 2004 2005 2006 The LaTeX3 Project. |
| 31 |
%% |
| 32 |
%% utf8.def is under the lppl version 1.3c or later, and can be found |
| 33 |
%% in the base LaTeX system. |
| 34 |
%% |
| 35 |
%% The lppl can be found at http://www.latex-project.org/lppl.txt |
| 36 |
%% |
| 37 |
%% The changes to utf8.def are Copyright 2009 Elie Roux, and are under |
| 38 |
%% the CC0 license. |
| 39 |
%% |
| 40 |
%% The changes are LuaTeX support. |
| 41 |
%% |
| 42 |
%% This file is distributed under the CC0 license, with clause 6 of the |
| 43 |
%% lppl as additional restrictions. |
| 44 |
|
| 45 |
|
| 46 |
\ProvidesFile{lutf8x.def} |
| 47 |
[2010/05/10 v0.97 UTF-8 support for luainputenc] |
| 48 |
|
| 49 |
\makeatletter |
| 50 |
\catcode`\ \saved@space@catcode |
| 51 |
|
| 52 |
\@inpenc@test |
| 53 |
|
| 54 |
\ifx\@begindocumenthook\@undefined |
| 55 |
\makeatother |
| 56 |
\endinput \fi |
| 57 |
|
| 58 |
|
| 59 |
\gdef\DeclareUnicodeCharacter#1#2{% |
| 60 |
\@tempcnta"#1% |
| 61 |
\luatexbase@directlua{luainputenc.declare_character('\the\@tempcnta')}% |
| 62 |
\catcode\@tempcnta\active % |
| 63 |
\DeclareInputText{\the\@tempcnta}{#2}% |
| 64 |
} |
| 65 |
|
| 66 |
\@onlypreamble\DeclareUnicodeCharacter |
| 67 |
|
| 68 |
\def\cdp@elt#1#2#3#4{% |
| 69 |
\wlog{Now handling font encoding #1 ...}% |
| 70 |
\lowercase{% |
| 71 |
\InputIfFileExists{#1enc.dfu}}% |
| 72 |
{\wlog{... processing UTF-8 mapping file for font encoding |
| 73 |
#1}% |
| 74 |
\catcode`\ 9\relax}% |
| 75 |
{\wlog{... no UTF-8 mapping file for font encoding #1}}% |
| 76 |
} |
| 77 |
\cdp@list |
| 78 |
|
| 79 |
|
| 80 |
\def\lIE@ActivateUnicodeCatcodes{% |
| 81 |
\luatexbase@directlua{luainputenc.activate_characters()}% |
| 82 |
} |
| 83 |
|
| 84 |
\def\lIE@DesactivateUnicodeCatcodes{% |
| 85 |
\luatexbase@directlua{luainputenc.desactivate_characters()}% |
| 86 |
} |
| 87 |
|
| 88 |
\def\lIE@CharactersActivated{% |
| 89 |
\luatexbase@directlua{luainputenc.force_characters_activated()} |
| 90 |
} |
| 91 |
|
| 92 |
\edef\lIE@EU{EU2} |
| 93 |
|
| 94 |
|
| 95 |
\def\DeclareFontEncoding@#1#2#3{% |
| 96 |
\edef\lIE@test{#1}% |
| 97 |
\ifx\lIE@test\lIE@EU % |
| 98 |
\ifx\LastDeclaredEncoding\lIE@EU\else % |
| 99 |
\lIE@CharactersActivated % |
| 100 |
\lIE@DesactivateUnicodeCatcodes % |
| 101 |
\fi |
| 102 |
\gdef\@@enc@update{% |
| 103 |
\edef\lIE@test{#1}% |
| 104 |
\ifx\f@encoding\lIE@EU % |
| 105 |
\lIE@DesactivateUnicodeCatcodes % |
| 106 |
\else % |
| 107 |
\lIE@ActivateUnicodeCatcodes % |
| 108 |
\fi |
| 109 |
\expandafter\let\csname\cf@encoding-cmd\endcsname\@changed@cmd |
| 110 |
\expandafter\let\csname\f@encoding-cmd\endcsname\@current@cmd |
| 111 |
\default@T |
| 112 |
\csname T@\f@encoding\endcsname |
| 113 |
\csname D@\f@encoding\endcsname |
| 114 |
\let\enc@update\relax |
| 115 |
\let\cf@encoding\f@encoding |
| 116 |
} |
| 117 |
\else % |
| 118 |
\expandafter % |
| 119 |
\ifx\csname T@#1\endcsname\relax % |
| 120 |
\def\cdp@elt{\noexpand\cdp@elt}% |
| 121 |
\xdef\cdp@list{\cdp@list\cdp@elt{#1}% |
| 122 |
{\default@family}{\default@series}% |
| 123 |
{\default@shape}}% |
| 124 |
\expandafter\let\csname#1-cmd\endcsname\@changed@cmd % |
| 125 |
\begingroup % |
| 126 |
\wlog{Now handling font encoding #1 ...}% |
| 127 |
\lowercase{% |
| 128 |
\InputIfFileExists{#1enc.dfu}}% |
| 129 |
{\wlog{... processing UTF-8 mapping file for font encoding #1}}% |
| 130 |
{\wlog{... no UTF-8 mapping file for font encoding #1}}% |
| 131 |
\endgroup |
| 132 |
\else |
| 133 |
\@font@info{Redeclaring font encoding #1}% |
| 134 |
\fi |
| 135 |
\fi % |
| 136 |
\global\@namedef{T@#1}{#2}% |
| 137 |
\global\@namedef{M@#1}{\default@M#3}% |
| 138 |
\xdef\LastDeclaredEncoding{#1}% |
| 139 |
} |
| 140 |
|
| 141 |
\DeclareUnicodeCharacter{00A9}{\textcopyright} |
| 142 |
\DeclareUnicodeCharacter{00AA}{\textordfeminine} |
| 143 |
\DeclareUnicodeCharacter{00AE}{\textregistered} |
| 144 |
\DeclareUnicodeCharacter{00BA}{\textordmasculine} |
| 145 |
\DeclareUnicodeCharacter{02C6}{\textasciicircum} |
| 146 |
\DeclareUnicodeCharacter{02DC}{\textasciitilde} |
| 147 |
\DeclareUnicodeCharacter{200C}{\textcompwordmark} |
| 148 |
\DeclareUnicodeCharacter{2026}{\textellipsis} |
| 149 |
\DeclareUnicodeCharacter{2122}{\texttrademark} |
| 150 |
\DeclareUnicodeCharacter{2423}{\textvisiblespace} |
| 151 |
|
| 152 |
\endinput |
| 153 |
%% |
| 154 |
%% End of file `lutf8x.def'. |