summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2019-05-04 22:48:20 +0000
committerKarl Berry <karl@freefriends.org>2019-05-04 22:48:20 +0000
commitcd83806db3427557043949f1d0ef6f369e681791 (patch)
tree5545a22648580cd465c7c216b9b669730d12b033
parentc0bef3346513bd933c0e451415a1cbf6120264d2 (diff)
luavlna (16apr19)
git-svn-id: svn://tug.org/texlive/trunk@50993 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Master/texmf-dist/doc/luatex/luavlna/README.md2
-rw-r--r--Master/texmf-dist/doc/luatex/luavlna/luavlna-doc.pdfbin87276 -> 87293 bytes
-rw-r--r--Master/texmf-dist/doc/luatex/luavlna/luavlna-doc.tex7
-rw-r--r--Master/texmf-dist/doc/luatex/luavlna/luavlna.tex17
-rw-r--r--Master/texmf-dist/tex/luatex/luavlna/luavlna-csplain-langs.lua80
-rw-r--r--Master/texmf-dist/tex/luatex/luavlna/luavlna-langno.lua3
-rw-r--r--Master/texmf-dist/tex/luatex/luavlna/luavlna.lua6
7 files changed, 35 insertions, 80 deletions
diff --git a/Master/texmf-dist/doc/luatex/luavlna/README.md b/Master/texmf-dist/doc/luatex/luavlna/README.md
index 871d2900b49..366cd21700c 100644
--- a/Master/texmf-dist/doc/luatex/luavlna/README.md
+++ b/Master/texmf-dist/doc/luatex/luavlna/README.md
@@ -1,4 +1,4 @@
-# Luavlna, version v0.1b, 2018-05-31
+# Luavlna, version v0.1c, 2019-04-16
# Introduction
diff --git a/Master/texmf-dist/doc/luatex/luavlna/luavlna-doc.pdf b/Master/texmf-dist/doc/luatex/luavlna/luavlna-doc.pdf
index b96633d362b..c9295780139 100644
--- a/Master/texmf-dist/doc/luatex/luavlna/luavlna-doc.pdf
+++ b/Master/texmf-dist/doc/luatex/luavlna/luavlna-doc.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/luatex/luavlna/luavlna-doc.tex b/Master/texmf-dist/doc/luatex/luavlna/luavlna-doc.tex
index 7a4ac630657..1519d7fe9f7 100644
--- a/Master/texmf-dist/doc/luatex/luavlna/luavlna-doc.tex
+++ b/Master/texmf-dist/doc/luatex/luavlna/luavlna-doc.tex
@@ -227,7 +227,7 @@ the other way. Lua\LaTeX, Lua\TeX\ and CSplain formats are supported at the mome
\subsection{Recognized languages}
\subsubsection{Lua\TeX\ and Lua\LaTeX}
-File \verb|language.dat| is processed to load language names, aliases and assigned numbers. These language names are the same as supported by \verb|babel| package.
+File \verb|language.dat| is processed to load language names, aliases and assigned numbers. These language names are the same as names supported by the \verb|babel| package.
\begin{quotation}
\small\noindent
@@ -248,10 +248,7 @@ File \verb|language.dat| is processed to load language names, aliases and assign
\subsubsection{CSplain}
-Different method is used. File \verb|hyphen.lan| is included in CSplain, where
-language numbers are assigned to ISO-639-1 or ISO-639-2 language codes.
-These language codes were then normalized to names used vy \verb|babel|, or
-standard English language names.
+Different method is used with the CSplain format. The \verb|lua-hyphen.lan| file is parsed for the language codes.
\begin{quotation}
\small\noindent
diff --git a/Master/texmf-dist/doc/luatex/luavlna/luavlna.tex b/Master/texmf-dist/doc/luatex/luavlna/luavlna.tex
index 33134a800c9..f3c44f1b695 100644
--- a/Master/texmf-dist/doc/luatex/luavlna/luavlna.tex
+++ b/Master/texmf-dist/doc/luatex/luavlna/luavlna.tex
@@ -1,16 +1,12 @@
-% detect LaTeX and use the correct method for luatexbase inclusion
-\ifx\RequirePackage\undefined
- \input{luatexbase.sty}%
-\else
- \RequirePackage{luatexbase}
-\fi
-
-\newluatexattribute\preventsinglestatus
% Modify pre_linebreak_filter callback so the spaces can be inserted
\directlua{%
luavlna = require "luavlna"
langno = require "luavlna-langno"
-luatexbase.add_to_callback("pre_linebreak_filter", luavlna.preventsingle," ")
+
+require "ltluatex"
+luatexbase.add_to_callback("pre_linebreak_filter", luavlna.preventsingle,"LuaVlna")
+% -- define the attribute number
+luavlna.preventsingleid = math.random(2^16)
local languages = langno.load_languages()
local get_lang_id = function(lang)
@@ -78,6 +74,9 @@ end
\directlua{set_main_language("#1")}
}
+%\newluatexattribute\preventsinglestatus
+\attributedef\preventsinglestatus=\directlua{tex.print(luavlna.preventsingleid)} % just a random number
+
\def\preventsingleon{%
\preventsinglestatus=2
}
diff --git a/Master/texmf-dist/tex/luatex/luavlna/luavlna-csplain-langs.lua b/Master/texmf-dist/tex/luatex/luavlna/luavlna-csplain-langs.lua
index b061bee4297..f4e1ccea168 100644
--- a/Master/texmf-dist/tex/luatex/luavlna/luavlna-csplain-langs.lua
+++ b/Master/texmf-dist/tex/luatex/luavlna/luavlna-csplain-langs.lua
@@ -1,59 +1,21 @@
-return {
-["spanish; castilian"]={26, 126},
-["magyar; hungarian"]={30, 130},
-["english; usenglish; american"]={100},
-["icelandic"]={42, 142},
-["basque"]={33, 133},
-["coptic"]={205},
-["catalan; valencian"]={204},
-["welsh"]={24, 124},
-["irish"]={34, 134},
-["armenian"]={210},
-["chinese"]={41, 141},
-["danish"]={25, 125},
-["turkish"]={31, 131},
-["interlingua "]={103},
-["slovak"]={6, 16, 116},
-["english; ukenglish; british"]={101},
-["ukrainian"]={209},
-["turkmen"]={47, 147},
-["sanskrit"]={207},
-["hindi"]={212},
-["lao"]={214},
-["finnish"]={29, 129},
-["assamese"]={211},
-["greek; polutonikogreek"]={203},
-["czech"]={5, 15, 115},
-["tamil"]={221},
-["italian"]={102},
-["french; francais; canadien; acadian"]={22, 122},
-["telugu"]={222},
-["croatian"]={40, 140},
-["panjabi; punjabi"]={220},
-["oriya"]={219},
-["russian"]={208},
-["malayalam"]={217},
-["marathi"]={218},
-["uppersorbian"]={43, 143},
-["portuges; portuguese; brazilian; brazil"]={38, 138},
-["galician"]={45, 145},
-["latvian"]={215},
-["afrikaans"]={44, 144},
-["lithuanian"]={216},
-["slovenian;slovene"]={28, 128},
-["mongolian"]={206},
-["greek; polutonikogreek"]={202},
-["latin"]={48, 148},
-["indonesian; indon; bahasai; bahasam; malay; meyalu"]={104},
-["polish"]={23, 123},
-["bokmål"]={35, 135},
-["dutch; flemish"]={37, 137},
-["greek; polutonikogreek"]={201},
-["norsk; nynorsk; norwegian"]={36, 136},
-["kannada"]={213},
-["estonian"]={32, 132},
-["english; usenglish; american; ukenglish; british; canadian; australian; newzealand"]={0},
-["romanian; moldavian; moldovan"]={39, 139},
-["german; germanb; ngerman; naustrian"]={21, 121},
-["kurdish"]={46, 146},
-}
+local languages = {}
+local function parse_language_lan(content)
+ for name, id in content:gmatch("preplang%s+.-%s+(.-)%s+.-%s(.-)%s+") do
+ -- skip invalid languages
+ if not name:match("%#") then
+ languages[name] = id
+ end
+ end
+end
+
+local langfile = kpse.find_file("lua-hyphen.lan")
+if langfile then
+ local f = io.open(langfile, "r")
+ local content = f:read("*all")
+ parse_language_lan(content)
+ f:close()
+end
+
+
+return languages
+
diff --git a/Master/texmf-dist/tex/luatex/luavlna/luavlna-langno.lua b/Master/texmf-dist/tex/luatex/luavlna/luavlna-langno.lua
index f4c654ff5fa..f703e4328a9 100644
--- a/Master/texmf-dist/tex/luatex/luavlna/luavlna-langno.lua
+++ b/Master/texmf-dist/tex/luatex/luavlna/luavlna-langno.lua
@@ -67,7 +67,6 @@ local load_csplain= function()
local numlang = {}
for k, v in pairs(l) do
local first = k:gsub(" *;.*","")
- --print(first)
langnum[first] = v
for _,i in ipairs(v) do
numlang[i] = first
@@ -85,7 +84,7 @@ drivers["luatex"] = load_lang_dat
drivers["default"] = load_lang_dat
drivers["csplain"] = load_csplain
drivers["pdfcsplain"] = load_csplain
-drivers["luaplain"] = load_csplain
+drivers["luacsplain"] = load_csplain
local load_languages = function(name)
local name = name or format
diff --git a/Master/texmf-dist/tex/luatex/luavlna/luavlna.lua b/Master/texmf-dist/tex/luatex/luavlna/luavlna.lua
index ce596bc2588..84d4c3f82cd 100644
--- a/Master/texmf-dist/tex/luatex/luavlna/luavlna.lua
+++ b/Master/texmf-dist/tex/luatex/luavlna/luavlna.lua
@@ -47,15 +47,12 @@ local tex4ht = false
-- must be table in the {char = true, char2=true} form
local set_singlechars= function(lang,c)
--print("Set single chars lua")
- print(type(lang), lang)
if type(lang) == "table" then
for _,l in pairs(lang) do
- print("language: ",l)
singlechars[l] = c
end
else
local lang = tonumber(lang)
- print("language: ",lang)
-- for k,_ in pairs(c) do print(k) end
singlechars[lang] = c
end
@@ -231,7 +228,8 @@ local function prevent_single_letter (head)
while head do
local id = head.id
local nextn = head.next
- local skip = node.has_attribute(head, luatexbase.attributes.preventsinglestatus)
+ -- local skip = node.has_attribute(head, luatexbase.attributes.preventsinglestatus)
+ local skip = node.has_attribute(head, M.preventsingleid)
if id == math_id then
if head.subtype == 0 then
word = ""