summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/lualatex/luainputenc/lutf8.def
blob: 79322a6507e37dc6f4ba22fd9542e7fa8bb7b80e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
%%
%% This is file `lutf8.def',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% luainputenc.dtx  (with options: `def')
%% This is a generated file.
%% 
%% Written in 2009, 2010 by Manuel Pegourie-Gonnard and Elie Roux.
%% 
%% This work is under the CC0 license. As an exception, the files
%% luainputenc.sty, lutf8.def and lutf8x.def have more restrictions.
%% See these file for more details.
%% 
%% People who helped on this package:
%%   Javier Bezos
%%   Will Robertson
%%   Hans Hagen
%%   Heiko Oberdiek
%%   Javier Mugica
%% 
%% This work consists of the main source file luainputenc.dtx
%% and the derived files
%%    luainputenc.sty, luainputenc.lua, lutf8.def, lutf8x.def,
%%    and luainputenc.pdf
%% 
%% This file was adapted from utf8.def, which copyright is:
%% Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003
%% 2004 2005 2006 The LaTeX3 Project.
%%
%% utf8.def is under the lppl version 1.3c or later, and can be found
%% in the base LaTeX system.
%%
%% The lppl can be found at http://www.latex-project.org/lppl.txt
%%
%% The changes to utf8.def are Copyright 2009 Elie Roux, and are under
%% the CC0 license.
%%
%% The changes are LuaTeX support.
%%
%% This file is distributed under the CC0 license, with clause 6 of the
%% lppl as additional restrictions.


\ProvidesFile{lutf8.def}
   [2010/05/10 v0.97 UTF-8 support for luainputenc]

\makeatletter
\catcode`\ \saved@space@catcode

\@inpenc@test

\ifx\@begindocumenthook\@undefined
  \makeatother
  \endinput \fi


\gdef\DeclareUnicodeCharacter#1#2{%
 \@tempcnta"#1%
 \catcode\@tempcnta\active %
 \DeclareInputText{\the\@tempcnta}{#2}%
}

\@onlypreamble\DeclareUnicodeCharacter

\def\cdp@elt#1#2#3#4{%
  \wlog{Now handling font encoding #1 ...}%
  \lowercase{%
      \InputIfFileExists{#1enc.dfu}}%
         {\wlog{... processing UTF-8 mapping file for font encoding
                #1}%
          \catcode`\ 9\relax}%
        {\wlog{... no UTF-8 mapping file for font encoding #1}}%
}
\cdp@list

\def\DeclareFontEncoding@#1#2#3{%
  \expandafter %
  \ifx\csname T@#1\endcsname\relax %
    \def\cdp@elt{\noexpand\cdp@elt}%
    \xdef\cdp@list{\cdp@list\cdp@elt{#1}%
                    {\default@family}{\default@series}%
                    {\default@shape}}%
    \expandafter\let\csname#1-cmd\endcsname\@changed@cmd %
    \begingroup %
      \wlog{Now handling font encoding #1 ...}%
      \lowercase{%
        \InputIfFileExists{#1enc.dfu}}%
           {\wlog{... processing UTF-8 mapping file for font encoding #1}}%
           {\wlog{... no UTF-8 mapping file for font encoding #1}}%
    \endgroup
  \else
     \@font@info{Redeclaring font encoding #1}%
  \fi
  \global\@namedef{T@#1}{#2}%
  \global\@namedef{M@#1}{\default@M#3}%
  \xdef\LastDeclaredEncoding{#1}%
}

\DeclareUnicodeCharacter{00A9}{\textcopyright}
\DeclareUnicodeCharacter{00AA}{\textordfeminine}
\DeclareUnicodeCharacter{00AE}{\textregistered}
\DeclareUnicodeCharacter{00BA}{\textordmasculine}
\DeclareUnicodeCharacter{02C6}{\textasciicircum}
\DeclareUnicodeCharacter{02DC}{\textasciitilde}
\DeclareUnicodeCharacter{200C}{\textcompwordmark}
\DeclareUnicodeCharacter{2026}{\textellipsis}
\DeclareUnicodeCharacter{2122}{\texttrademark}
\DeclareUnicodeCharacter{2423}{\textvisiblespace}

\endinput
%%
%% End of file `lutf8.def'.