diff options
author | Karl Berry <karl@freefriends.org> | 2010-02-14 00:13:21 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2010-02-14 00:13:21 +0000 |
commit | 08fc1629b2ad79d9d2b0526b720745e58535b65f (patch) | |
tree | 1c09cc3a157a7e59a632b97d5d4dd267cec06ace /Master/texmf-dist/source/lualatex | |
parent | caf27f98dd109e15fcda5323dce0c3a9f3e6eed0 (diff) |
luainputenc update (13feb10)
git-svn-id: svn://tug.org/texlive/trunk@16999 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/lualatex')
-rw-r--r-- | Master/texmf-dist/source/lualatex/luainputenc/Makefile | 6 | ||||
-rw-r--r-- | Master/texmf-dist/source/lualatex/luainputenc/luainputenc.dtx | 160 |
2 files changed, 50 insertions, 116 deletions
diff --git a/Master/texmf-dist/source/lualatex/luainputenc/Makefile b/Master/texmf-dist/source/lualatex/luainputenc/Makefile index e3857b9057c..5978cfc0373 100644 --- a/Master/texmf-dist/source/lualatex/luainputenc/Makefile +++ b/Master/texmf-dist/source/lualatex/luainputenc/Makefile @@ -6,15 +6,15 @@ DTX = $(NAME).dtx # Files grouped by generation mode COMPILED = $(DOC) -UNPACKED = eu2enc.def lutf8.def lutf8x.def eu2lmr.fd inputenc.sty.diff \ +UNPACKED = lutf8.def lutf8x.def inputenc.sty.diff \ luainputenc.sty luainputenc.lua -SOURCE = $(DTX) README Makefile +SOURCE = $(DTX) README Makefile News GENERATED = $(COMPILED) $(UNPACKED) # Files grouped by installation location UNPACKED_DOC = inputenc.sty.diff RUNFILES = $(filter-out $(UNPACKED_DOC), $(UNPACKED)) -DOCFILES = $(DOC) $(UNPACKED_DOC) README +DOCFILES = $(DOC) $(UNPACKED_DOC) README News SRCFILES = $(DTX) Makefile # The following definitions should be equivalent diff --git a/Master/texmf-dist/source/lualatex/luainputenc/luainputenc.dtx b/Master/texmf-dist/source/lualatex/luainputenc/luainputenc.dtx index 9d61411b298..67a3710c61c 100644 --- a/Master/texmf-dist/source/lualatex/luainputenc/luainputenc.dtx +++ b/Master/texmf-dist/source/lualatex/luainputenc/luainputenc.dtx @@ -16,7 +16,7 @@ % This work consists of the main source file luainputenc.dtx % and the derived files % luainputenc.sty, luainputenc.lua, lutf8.def, lutf8x.def, -% eu2enc.def, eu2lmr.fd and luainputenc.pdf +% and luainputenc.pdf % % Unpacking: % tex luainputenc.dtx @@ -41,7 +41,7 @@ \input docstrip.tex \Msg{************************************************************************} \Msg{* Installation} -\Msg{* Package: luainputenc 2009/11/20 v0.95 inputenc package for LuaTeX} +\Msg{* Package: luainputenc 2010/02/07 v0.96 inputenc package for LuaTeX} \Msg{************************************************************************} \keepsilent @@ -68,7 +68,7 @@ People who helped on this package: This work consists of the main source file luainputenc.dtx and the derived files luainputenc.sty, luainputenc.lua, lutf8.def, lutf8x.def, - eu2enc.def, eu2lmr.fd and luainputenc.pdf + and luainputenc.pdf \endpreamble @@ -79,8 +79,6 @@ and the derived files \file{luainputenc.sty}{\from{luainputenc.dtx}{package}}% \file{lutf8.def}{\from{luainputenc.dtx}{def}}% \file{lutf8x.def}{\from{luainputenc.dtx}{defx}}% - \file{eu2enc.def}{\from{luainputenc.dtx}{eu2}}% - \file{eu2lmr.fd}{\from{luainputenc.dtx}{lmr}}% } % The following hacks are to generate a lua file with lua comments starting by @@ -114,7 +112,6 @@ and the derived files \Msg{* files into a directory searched by TeX:} \Msg{*} \Msg{* luainputenc.sty luainputenc.lua lutf8.def lutf8x.def} -\Msg{* eu2enc.def eu2lmr.fd} \Msg{*} \Msg{* Happy TeXing!} \Msg{*} @@ -129,7 +126,7 @@ and the derived files %<package> %<package>\NeedsTeXFormat{LaTeX2e} %<package>\ProvidesPackage{luainputenc} -%<package> [2009/11/20 v0.95 inputenc package for LuaTeX] +%<package> [2010/02/07 v0.96 inputenc package for LuaTeX] %<package> % \fi %<*driver> @@ -164,7 +161,7 @@ and the derived files % \GetFileInfo{luainputenc.sty} % % \title{The \textsf{luainputenc} package} -% \date{2009/11/20 v0.95} +% \date{2010/02/07 v0.96} % \author{Elie Roux \\ \texttt{elie.roux@telecom-bretagne.eu}} % % \maketitle @@ -259,10 +256,10 @@ and the derived files % \texttt{\string\char\ 233} in the unicode fonts, and produce a \texttt{\'e}. % We will call this behaviour the \emph{unicode font mode}. To enable this % mode, you can use the option \texttt{unactivate} in \textsf{luainputenc}, -% and you must use the font encoding \texttt{EU2} provided by this package -% too. See section \ref{s:eu2} for more details about \texttt{EU2}. To use -% this mode with \texttt{EU2}, you must be able to open OTF fonts. A simple -% way to do so it by using the package \textsf{luaotfload}. +% and you must use the font encoding \texttt{EU2} provided by the \textsf{euenc} +% package. See documentation of \textsf{euenc} package for more details about +% \texttt{EU2}. To use this mode with \texttt{EU2}, you must be able to open OTF +% fonts. A simple way to do so it by using the package \textsf{luaotfload}. % % \subsubsection{mixed mode} % @@ -277,6 +274,13 @@ and the derived files % old documents. To get the \emph{mixed mode}, you must pass the option % \texttt{lutf8x} to \textsf{luainputenc}. This mode is the most experimental. % +% \section{Accessing the encoding in lua} +% +% In order to access the encoding and the package option in lua, two variables +% are set: |luainputenc.package_option| contains the option passed to the +% package, and |luainputenc.encoding| that contains the encoding (defaults to +% utf8, and is utf8 even with the options |unactivate|, |utf8x|, etc.). +% % \section{Files} % % This package contains a \texttt{.sty} file for both \LaTeX\ and Plain, a @@ -463,6 +467,7 @@ and the derived files by input encoding change to `#1'\MessageBreak}% \fi \the\inpenc@posthook + \luadirect{luainputenc.set_option([[#1]])} } \newtoks\inpenc@prehook \newtoks\inpenc@posthook @@ -519,6 +524,7 @@ and the derived files \DeclareOption{unactivate}{% \edef\inputencodingname{unactivate}% + \luadirect{luainputenc.set_option([[unactivate]])} } % \end{macrocode} @@ -770,7 +776,7 @@ and the derived files \ProvidesFile{lutf8.def} - [2009/11/20 v0.95 UTF-8 support for luainputenc] + [2010/02/07 v0.96 UTF-8 support for luainputenc] \makeatletter \catcode`\ \saved@space@catcode @@ -886,7 +892,7 @@ and the derived files % \begin{macrocode} \ProvidesFile{lutf8x.def} - [2009/11/20 v0.95 UTF-8 support for luainputenc] + [2010/02/07 v0.96 UTF-8 support for luainputenc] \makeatletter \catcode`\ \saved@space@catcode @@ -1016,102 +1022,6 @@ and the derived files %</defx> % \fi % -% \iffalse -%<*eu2> -% \fi -% -% \subsection{\texttt{eu2enc.def}\label{s:eu2}} -% -% This file is extremely short. It just declares the encoding, with the -% default font. The default font here is lmr, which means that \LaTeX\ will -% read \texttt{eu2lmr.fd}. The problem is that all unicode fonts are OTF -% fonts, so \texttt{eu2lmr.fd} will call OTF fonts. Thus, to use -% \texttt{EU2}, you need to be able to read OTF fonts. The package -% \textsf{luaotfload} is a good choice to be able to do so. -% -% \begin{macrocode} - -\ProvidesFile{eu2enc.def}[2009/11/20 v0.1 a unicode font encoding for LuaTeX.] -\DeclareFontEncoding{EU2}{}{} -\DeclareErrorFont{EU2}{lmr}{m}{n}{10} -\DeclareFontSubstitution{EU2}{lmr}{m}{n} - -% \end{macrocode} -% -% \iffalse -%</eu2> -% \fi -% -% \iffalse -%<*lmr> -% \fi -% -% \subsection{\texttt{eu2lmr.fd}} -% -% This file simply describes the default (lmr) font of the \texttt{EU2} -% encoding. It loads the otf fonts with some default features enabled. This -% file may change, don't rely on it too much. -% -% \begin{macrocode} - -\ProvidesFile{eu2lmr.fd} - [2009/11/20 v0.2 Font defs for Latin Modern for LuaTeX's EU2 encoding] -\DeclareFontFamily{EU2}{lmr}{} -\DeclareFontShape{EU2}{lmr}{m}{n}% - {<-5.5> "lmroman5-regular:+tlig;+tsub;+liga;+rlig;" - <5.5-6.5> "lmroman6-regular:+tlig;+tsub;+liga;+rlig;" - <6.5-7.5> "lmroman7-regular:+tlig;+tsub;+liga;+rlig;" - <7.5-8.5> "lmroman8-regular:+tlig;+tsub;+liga;+rlig;" - <8.5-9.5> "lmroman9-regular:+tlig;+tsub;+liga;+rlig;" - <9.5-11> "lmroman10-regular:+tlig;+tsub;+liga;+rlig;" - <11-15> "lmroman12-regular:+tlig;+tsub;+liga;+rlig;" - <15-> "lmroman17-regular:+tlig;+tsub;+liga;+rlig;" - }{} -\DeclareFontShape{EU2}{lmr}{m}{sl}% - {<-8.5> "lmroman8-oblique:+tlig;+tsub;+liga;+rlig;" - <8.5-9.5> "lmroman9-oblique:+tlig;+tsub;+liga;+rlig;" - <9.5-11> "lmroman10-oblique:+tlig;+tsub;+liga;+rlig;" - <11-15> "lmroman12-oblique:+tlig;+tsub;+liga;+rlig;" - <15-> "lmroman17-oblique:+tlig;+tsub;+liga;+rlig;" - }{} -\DeclareFontShape{EU2}{lmr}{m}{it}% - {<-7.5> "lmroman7-italic:+tlig;+tsub;+liga;+rlig;" - <7.5-8.5> "lmroman8-italic:+tlig;+tsub;+liga;+rlig;" - <8.5-9.5> "lmroman9-italic:+tlig;+tsub;+liga;+rlig;" - <9.5-11> "lmroman10-italic:+tlig;+tsub;+liga;+rlig;" - <11-> "lmroman12-italic:+tlig;+tsub;+liga;+rlig;" - }{} -\DeclareFontShape{EU2}{lmr}{m}{sc}% - {<-> "lmroman10-capsregular:+tlig;+tsub;+liga;+rlig;"}{} -% -% Is this the right 'shape'?: -\DeclareFontShape{EU2}{lmr}{m}{scsl}% - {<-> "lmroman10-capsoblique:+tlig;+tsub;+liga;+rlig;"}{} -%%%%%%% bold series -\DeclareFontShape{EU2}{lmr}{b}{n} - {<-> "lmroman10-demi:+tlig;+tsub;+liga;+rlig;"}{} -\DeclareFontShape{EU2}{lmr}{b}{sl} - {<-> "lmroman10-demioblique:+tlig;+tsub;+liga;+rlig;"}{} -%%%%%%%% bold extended series -\DeclareFontShape{EU2}{lmr}{bx}{n} - {<-5.5> "lmroman5-bold:+tlig;+tsub;+liga;+rlig;" - <5.5-6.5> "lmroman6-bold:+tlig;+tsub;+liga;+rlig;" - <6.5-7.5> "lmroman7-bold:+tlig;+tsub;+liga;+rlig;" - <7.5-8.5> "lmroman8-bold:+tlig;+tsub;+liga;+rlig;" - <8.5-9.5> "lmroman9-bold:+tlig;+tsub;+liga;+rlig;" - <9.5-11> "lmroman10-bold:+tlig;+tsub;+liga;+rlig;" - <11-> "lmroman12-bold:+tlig;+tsub;+liga;+rlig;" - }{} -\DeclareFontShape{EU2}{lmr}{bx}{it} - {<-> "lmroman10-bolditalic:+tlig;+tsub;+liga;+rlig;"}{} -\DeclareFontShape{EU2}{lmr}{bx}{sl} - {<-> "lmroman10-boldoblique:+tlig;+tsub;+liga;+rlig;"}{} - -% \end{macrocode} -% -% \iffalse -%</lmr> -% \fi % % \subsection{\texttt{luainputenc.lua}} % @@ -1128,8 +1038,8 @@ luainputenc = { } luainputenc.module = { name = "luainputenc", - version = 0.95, - date = "2009/11/20", + version = 0.96, + date = "2010/02/07", description = "Lua simple inputenc package.", author = "Elie Roux", copyright = "Elie Roux", @@ -1144,6 +1054,30 @@ luainputenc.log = luainputenc.log or function(...) luatextra.module_log('luainputenc', format(...)) end +% \end{macrocode} +% +% We keep the option and the true encoding in two variables. +% +% \begin{macrocode} + +luainputenc.encoding = "utf8" +luainputenc.package_option = nil + +function luainputenc.set_option(option) + luainputenc.package_option = option + if option == "lutf8" or option == "lutf8x" or option == "utf8x" or option == "unactivate" then + luainputenc.encoding = "utf8" + else + luainputenc.encoding = option + end +end + +% \end{macrocode} +% +% Some local declarations. +% +% \begin{macrocode} + local char, utfchar, byte, format, gsub, utfbyte, utfgsub = string.char, unicode.utf8.char, string.byte, string.format, string.gsub, unicode.utf8.byte, unicode.utf8.gsub @@ -1450,4 +1384,4 @@ end % \fi % % \Finale -\endinput
\ No newline at end of file +\endinput |