diff options
author | Karl Berry <karl@freefriends.org> | 2009-09-27 23:17:40 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2009-09-27 23:17:40 +0000 |
commit | 523691ad983891609b53ee8edab9ad9cef4248a4 (patch) | |
tree | eae640246d1b3f086e0854f80688e99cc215fe5e /Master/texmf-dist/tex/lualatex | |
parent | a2ee29a725b5fa657e369a9daf0ecb6f66e79c49 (diff) |
luainputenc 0.94 (26sep09)
git-svn-id: svn://tug.org/texlive/trunk@15483 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/lualatex')
6 files changed, 217 insertions, 181 deletions
diff --git a/Master/texmf-dist/tex/lualatex/luainputenc/eu2enc.def b/Master/texmf-dist/tex/lualatex/luainputenc/eu2enc.def index 9699ee905d1..bf6f814128f 100644 --- a/Master/texmf-dist/tex/lualatex/luainputenc/eu2enc.def +++ b/Master/texmf-dist/tex/lualatex/luainputenc/eu2enc.def @@ -26,8 +26,7 @@ %% eu2enc.def, eu2lmr.fd and luainputenc.pdf %% -\ProvidesFile{eu2enc.def}[2009/04/15 v0.1 - a unicode font encoding for LuaTeX.] +\ProvidesFile{eu2enc.def}[2009/09/23 v0.1 a unicode font encoding for LuaTeX.] \DeclareFontEncoding{EU2}{}{} \DeclareErrorFont{EU2}{lmr}{m}{n}{10} \DeclareFontSubstitution{EU2}{lmr}{m}{n} diff --git a/Master/texmf-dist/tex/lualatex/luainputenc/eu2lmr.fd b/Master/texmf-dist/tex/lualatex/luainputenc/eu2lmr.fd index 141dbf55342..e231fc5f6aa 100644 --- a/Master/texmf-dist/tex/lualatex/luainputenc/eu2lmr.fd +++ b/Master/texmf-dist/tex/lualatex/luainputenc/eu2lmr.fd @@ -27,55 +27,55 @@ %% \ProvidesFile{eu2lmr.fd} - [2009/04/15 v0.1 Font defs for Latin Modern for LuaTeX's EU2 encoding] + [2009/09/23 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" - <5.5-6.5> "lmroman6-regular:+tlig;+tsub;+liga" - <6.5-7.5> "lmroman7-regular:+tlig;+tsub;+liga" - <7.5-8.5> "lmroman8-regular:+tlig;+tsub;+liga" - <8.5-9.5> "lmroman9-regular:+tlig;+tsub;+liga" - <9.5-11> "lmroman10-regular:+tlig;+tsub;+liga" - <11-15> "lmroman12-regular:+tlig;+tsub;+liga" - <15-> "lmroman17-regular:+tlig;+tsub;+liga" + {<-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" - <8.5-9.5> "lmroman9-oblique:+tlig;+tsub;+liga" - <9.5-11> "lmroman10-oblique:+tlig;+tsub;+liga" - <11-15> "lmroman12-oblique:+tlig;+tsub;+liga" - <15-> "lmroman17-oblique:+tlig;+tsub;+liga" + {<-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" - <7.5-8.5> "lmroman8-italic:+tlig;+tsub;+liga" - <8.5-9.5> "lmroman9-italic:+tlig;+tsub;+liga" - <9.5-11> "lmroman10-italic:+tlig;+tsub;+liga" - <11-> "lmroman12-italic:+tlig;+tsub;+liga" + {<-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"}{} + {<-> "lmroman10-capsregular:+tlig;+tsub;+liga;+rlig;"}{} \DeclareFontShape{EU2}{lmr}{m}{scsl}% - {<-> "lmroman10-capsoblique:+tlig;+tsub;+liga"}{} + {<-> "lmroman10-capsoblique:+tlig;+tsub;+liga;+rlig;"}{} %%%%%%% bold series \DeclareFontShape{EU2}{lmr}{b}{n} - {<-> "lmroman10-demi:+tlig;+tsub;+liga"}{} + {<-> "lmroman10-demi:+tlig;+tsub;+liga;+rlig;"}{} \DeclareFontShape{EU2}{lmr}{b}{sl} - {<-> "lmroman10-demioblique:+tlig;+tsub;+liga"}{} + {<-> "lmroman10-demioblique:+tlig;+tsub;+liga;+rlig;"}{} %%%%%%%% bold extended series \DeclareFontShape{EU2}{lmr}{bx}{n} - {<-5.5> "lmroman5-bold:+tlig;+tsub;+liga" - <5.5-6.5> "lmroman6-bold:+tlig;+tsub;+liga" - <6.5-7.5> "lmroman7-bold:+tlig;+tsub;+liga" - <7.5-8.5> "lmroman8-bold:+tlig;+tsub;+liga" - <8.5-9.5> "lmroman9-bold:+tlig;+tsub;+liga" - <9.5-11> "lmroman10-bold:+tlig;+tsub;+liga" - <11-> "lmroman12-bold:+tlig;+tsub;+liga" + {<-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"}{} + {<-> "lmroman10-bolditalic:+tlig;+tsub;+liga;+rlig;"}{} \DeclareFontShape{EU2}{lmr}{bx}{sl} - {<-> "lmroman10-boldoblique:+tlig;+tsub;+liga"}{} + {<-> "lmroman10-boldoblique:+tlig;+tsub;+liga;+rlig;"}{} \endinput %% diff --git a/Master/texmf-dist/tex/lualatex/luainputenc/luainputenc.lua b/Master/texmf-dist/tex/lualatex/luainputenc/luainputenc.lua index eb324f3459a..202493dff36 100644 --- a/Master/texmf-dist/tex/lualatex/luainputenc/luainputenc.lua +++ b/Master/texmf-dist/tex/lualatex/luainputenc/luainputenc.lua @@ -30,8 +30,8 @@ luainputenc = { } luainputenc.module = { name = "luainputenc", - version = 0.93, - date = "2009/04/15", + version = 0.94, + date = "2009/09/23", description = "Lua simple inputenc package.", author = "Elie Roux", copyright = "Elie Roux", @@ -46,183 +46,208 @@ luainputenc.log = luainputenc.log or function(...) luatextra.module_log('luainputenc', format(...)) end -local char, utfchar, byte, format, gsub = -string.char, unicode.utf8.char, string.byte, string.format, string.gsub +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 -local started, stopped = 1, 0 -luainputenc.state = stopped - -function luainputenc.setstate(state) - if state == luainputenc.state then - return - elseif state == started then - luainputenc.start() - else - luainputenc.stop() - end +function luainputenc.byte_to_utf(ch) + return utfchar(byte(ch)) end -function luainputenc.setstarted() - luainputenc.setstate(started) -end -function luainputenc.setstopped() - luainputenc.setstate(stopped) +function luainputenc.fake_utf_read(buf) + return gsub(buf,"(.)", luainputenc.byte_to_utf) end -function luainputenc.byte_to_utf(c) - return utfchar(byte(c)) +function luainputenc.utf_to_byte(ch) + return char(utfbyte(ch)) end -function luainputenc.fake_utf(buf) - return gsub(buf,"(.)", luainputenc.byte_to_utf) +function luainputenc.fake_utf_write(buf) + return utfgsub(buf,"(.)", luainputenc.utf_to_byte) end -function luainputenc.start() - callback.add('process_input_buffer', luainputenc.fake_utf, -'luainputenc.fake_utf') - luainputenc.state = started - if luainputenc.callback_registered == 0 then - luainputenc.register_callback() +if tex.luatexversion > 42 then + + function luainputenc.register_callbacks() + callback.add('process_output_buffer', luainputenc.fake_utf_write, 'luainputenc.fake_utf_write') + callback.add('process_input_buffer', luainputenc.fake_utf_read, 'luainputenc.fake_utf_read') end -end -function luainputenc.stop() - callback.remove('process_input_buffer', 'luainputenc.fake_utf') +else + + + local started, stopped = 1, 0 + luainputenc.state = stopped - return -end + function luainputenc.setstate(state) + if state == luainputenc.state then + return + elseif state == started then + luainputenc.start() + else + luainputenc.stop() + end + end -luainputenc.unicode_extentions = { - ['.aux'] = 1, -- basic files - ['.toc'] = 1, - ['.gls'] = 1, - ['.ind'] = 1, - ['.idx'] = 1, - ['.vrb'] = 1, -- beamer and powerdot - ['.nav'] = 1, -- other beamer extentions - ['.sol'] = 1, - ['.qsl'] = 1, - ['.snm'] = 1, - ['.pgn'] = 1, -- pagereference - ['.cpg'] = 1, -- AlProTeX - ['.pst'] = 1, -- pst-tree - ['.tmp'] = 1, -- sauerj/collect - ['.sym'] = 1, -- listofsymbols - ['.sub'] = 1, -- listofsymbols - ['.lof'] = 1, -- preprint - ['.lot'] = 1, -- preprint - ['mtc1'] = 1, -- minitoc - ['.ovr'] = 1, -- thumbss - ['.fff'] = 1, -- endplate - ['.sbb'] = 1, -- splitbib - ['.bbl'] = 1, -- latex - ['.ain'] = 1, -- authorindex - ['.abb'] = 1, -- juraabbrev - ['.ent'] = 1, -- endnotes - ['.end'] = 1, -- fn2end - ['.thm'] = 1, -- ntheorem - ['.xtr'] = 1, -- extract - ['.han'] = 1, -- linguho - ['.bnd'] = 1, -- bibref - ['.bbl'] = 1, -- bibref - ['.col'] = 1, -- mwrite - ['.ttt'] = 1, -- endfloat - ['.fax'] = 1, -- lettre - ['.tns'] = 1, -- lettre - ['.odt'] = 1, -- lettre - ['.etq'] = 1, -- lettre - ['.emd'] = 1, -- poemscol - ['.emx'] = 1, -- poemscol - ['.ctn'] = 1, -- poemscol - ['.hst'] = 1, -- vhistory - ['.acr'] = 1, -- crosswrd - ['.dwn'] = 1, -- crosswrd - ['.ttc'] = 1, -- talk - -- ['.txt'] = 1, -- coverpage, but not sure it's safe to include it... - ['.eve'] = 1, -- calend0 - ['.scn'] = 1, -- cwebmac - } - - -luainputenc.unicode_files = {} - -luainputenc.non_unicode_files = {} - -function luainputenc.set_unicode_file(filename) - if luainputenc.non_unicode_files[filename] == 1 then - luainputenc.non_unicode_files[filename] = nil + function luainputenc.setstarted() + luainputenc.setstate(started) end - luainputenc.unicode_files[filename] = 1 -end -function luainputenc.set_non_unicode_file(filename) - if luainputenc.unicode_files[filename] == 1 then - luainputenc.unicode_files[filename] = nil + function luainputenc.setstopped() + luainputenc.setstate(stopped) end - luainputenc.non_unicode_files[filename] = 1 -end -function luainputenc.set_unicode_extention(ext) - luainputenc.unicode_extention[ext] = 1 -end + function luainputenc.start() + callback.add('process_input_buffer', luainputenc.fake_utf_read, + 'luainputenc.fake_utf_read') + luainputenc.state = started + if luainputenc.callback_registered == 0 then + luainputenc.register_callback() + end + end -function luainputenc.set_non_unicode_extention(ext) - if luainputenc.unicode_extentions[ext] == 1 then - luainputenc.unicode_extentions[ext] = nil + function luainputenc.stop() + callback.remove('process_input_buffer', 'luainputenc.fake_utf_read') + luainputenc.state = stopped + return end -end -function luainputenc.unset_file(filename) - if luainputenc.unicode_files[filename] == 1 then - luainputenc.unicode_files[filename] = nil - elseif luainputenc.non_unicode_files[filename] == 1 then - luainputenc.non_unicode_files[filename] = nil + + luainputenc.unicode_extentions = { + ['.aux'] = 1, -- basic files + ['.toc'] = 1, + ['.gls'] = 1, + ['.ind'] = 1, + ['.idx'] = 1, + ['.vrb'] = 1, -- beamer and powerdot + ['.nav'] = 1, -- other beamer extentions + ['.sol'] = 1, + ['.qsl'] = 1, + ['.snm'] = 1, + ['.pgn'] = 1, -- pagereference + ['.cpg'] = 1, -- AlProTeX + ['.pst'] = 1, -- pst-tree + ['.tmp'] = 1, -- sauerj/collect + ['.sym'] = 1, -- listofsymbols + ['.sub'] = 1, -- listofsymbols + ['.lof'] = 1, -- preprint + ['.lot'] = 1, -- preprint + ['mtc1'] = 1, -- minitoc + ['.ovr'] = 1, -- thumbss + ['.fff'] = 1, -- endplate + ['.sbb'] = 1, -- splitbib + ['.bbl'] = 1, -- latex + ['.ain'] = 1, -- authorindex + ['.abb'] = 1, -- juraabbrev + ['.ent'] = 1, -- endnotes + ['.end'] = 1, -- fn2end + ['.thm'] = 1, -- ntheorem + ['.xtr'] = 1, -- extract + ['.han'] = 1, -- linguho + ['.bnd'] = 1, -- bibref + ['.bbl'] = 1, -- bibref + ['.col'] = 1, -- mwrite + ['.ttt'] = 1, -- endfloat + ['.fax'] = 1, -- lettre + ['.tns'] = 1, -- lettre + ['.odt'] = 1, -- lettre + ['.etq'] = 1, -- lettre + ['.emd'] = 1, -- poemscol + ['.emx'] = 1, -- poemscol + ['.ctn'] = 1, -- poemscol + ['.hst'] = 1, -- vhistory + ['.acr'] = 1, -- crosswrd + ['.dwn'] = 1, -- crosswrd + ['.ttc'] = 1, -- talk + -- ['.txt'] = 1, -- coverpage, but not sure it's safe to include it... + ['.eve'] = 1, -- calend0 + ['.scn'] = 1, -- cwebmac + } + + + luainputenc.unicode_files = {} + + luainputenc.non_unicode_files = {} + + function luainputenc.set_unicode_file(filename) + if luainputenc.non_unicode_files[filename] == 1 then + luainputenc.non_unicode_files[filename] = nil + end + luainputenc.unicode_files[filename] = 1 end -end -local unicode, non_unicode = stopped, started - -function luainputenc.find_state(filename) - if luainputenc.unicode_files[filename] == 1 then - return unicode - elseif luainputenc.non_unicode_files[filename] == 1 then - return non_unicode - else - local ext = filename:sub(-4) - if luainputenc.unicode_extentions[ext] == 1 then - return unicode - else + function luainputenc.set_non_unicode_file(filename) + if luainputenc.unicode_files[filename] == 1 then + luainputenc.unicode_files[filename] = nil + end + luainputenc.non_unicode_files[filename] = 1 + end + + function luainputenc.set_unicode_extention(ext) + luainputenc.unicode_extention[ext] = 1 + end + + function luainputenc.set_non_unicode_extention(ext) + if luainputenc.unicode_extentions[ext] == 1 then + luainputenc.unicode_extentions[ext] = nil + end + end + + function luainputenc.unset_file(filename) + if luainputenc.unicode_files[filename] == 1 then + luainputenc.unicode_files[filename] = nil + elseif luainputenc.non_unicode_files[filename] == 1 then + luainputenc.non_unicode_files[filename] = nil + end + end + + local unicode, non_unicode = stopped, started + + function luainputenc.find_state(filename) + if luainputenc.unicode_files[filename] == 1 then + return unicode + elseif luainputenc.non_unicode_files[filename] == 1 then return non_unicode - end + else + local ext = filename:sub(-4) + if luainputenc.unicode_extentions[ext] == 1 then + return unicode + else + return non_unicode + end + end end -end -function luainputenc.pre_read_file(env) - local currentstate = luainputenc.state - luainputenc.setstate(luainputenc.find_state(env.filename)) - env.previousstate = currentstate -end + function luainputenc.pre_read_file(env) + if not env.path then + return + end + local currentstate = luainputenc.state + luainputenc.setstate(luainputenc.find_state(env.filename)) + env.previousstate = currentstate + end -function luainputenc.close(env) - luainputenc.setstate(env.previousstate) -end + function luainputenc.close(env) + luainputenc.setstate(env.previousstate) + end -luainputenc.callback_registered = 0 + luainputenc.callback_registered = 0 -function luainputenc.register_callback() - if luainputenc.callback_registered == 0 then - callback.add('pre_read_file', luainputenc.pre_read_file, -'luainputenc.pre_read_file') - callback.add('file_close', luainputenc.close, 'luainputenc.close') - luainputenc.callback_registered = 1 + function luainputenc.register_callback() + if luainputenc.callback_registered == 0 then + callback.add('pre_read_file', luainputenc.pre_read_file, + 'luainputenc.pre_read_file') + callback.add('file_close', luainputenc.close, 'luainputenc.close') + luainputenc.callback_registered = 1 + end end + end diff --git a/Master/texmf-dist/tex/lualatex/luainputenc/luainputenc.sty b/Master/texmf-dist/tex/lualatex/luainputenc/luainputenc.sty index 9275c6b9746..495e2ee19e9 100644 --- a/Master/texmf-dist/tex/lualatex/luainputenc/luainputenc.sty +++ b/Master/texmf-dist/tex/lualatex/luainputenc/luainputenc.sty @@ -28,7 +28,7 @@ \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{luainputenc} - [2009/04/15 v0.93 inputenc package for LuaTeX] + [2009/09/23 v0.94 inputenc package for LuaTeX] %% This file was adapted from inputenc.sty, which copyright is: %% Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 @@ -74,7 +74,7 @@ \RequirePackage{luatextra} -\luaUseModule{luainputenc} +\luatexUseModule{luainputenc} \def\DeclareInputMath#1{% @@ -102,6 +102,7 @@ \noexpand\IeC \fi } + \def\inputencoding#1{% \the\inpenc@prehook \gdef\@inpenc@test{\global\let\@inpenc@test\relax}% @@ -175,6 +176,15 @@ } +\ifnum\luatexversion>42 + + \newcommand*{\lIE@activate}[0]{% + \luadirect{luainputenc.register_callbacks()}% + } + +\else + + \newcommand*\lIE@setstarted[0]{% \ifnum\lIE@activated=1 % \luadirect{luainputenc.setstarted()}% @@ -248,6 +258,8 @@ \fi% } +\fi + \ProcessOptions* \endinput diff --git a/Master/texmf-dist/tex/lualatex/luainputenc/lutf8.def b/Master/texmf-dist/tex/lualatex/luainputenc/lutf8.def index a8883724276..e388d713f06 100644 --- a/Master/texmf-dist/tex/lualatex/luainputenc/lutf8.def +++ b/Master/texmf-dist/tex/lualatex/luainputenc/lutf8.def @@ -44,7 +44,7 @@ \ProvidesFile{lutf8.def} - [2009/04/15 v0.93 UTF-8 support for luainputenc] + [2009/09/23 v0.94 UTF-8 support for luainputenc] \makeatletter \catcode`\ \saved@space@catcode diff --git a/Master/texmf-dist/tex/lualatex/luainputenc/lutf8x.def b/Master/texmf-dist/tex/lualatex/luainputenc/lutf8x.def index 8b910c74a15..90919e1d47c 100644 --- a/Master/texmf-dist/tex/lualatex/luainputenc/lutf8x.def +++ b/Master/texmf-dist/tex/lualatex/luainputenc/lutf8x.def @@ -44,7 +44,7 @@ \ProvidesFile{lutf8x.def} - [2009/04/15 v0.93 UTF-8 support for luainputenc] + [2009/09/23 v0.94 UTF-8 support for luainputenc] \makeatletter \catcode`\ \saved@space@catcode |