From 059fc69b2c7853b937ddb4cfc9d36304dee07893 Mon Sep 17 00:00:00 2001 From: Hans Hagen Date: Sat, 1 Apr 2023 10:50:35 +0200 Subject: 2023-04-01 09:31:00 --- tex/generic/context/luatex/luatex-fonts-merged.lua | 30 ++++++---- tex/generic/context/luatex/luatex-mplib.lua | 70 +++++++++------------- tex/generic/context/luatex/luatex-preprocessor.lua | 12 +--- 3 files changed, 48 insertions(+), 64 deletions(-) (limited to 'tex/generic') diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua index e885a56ed..7d9befa51 100644 --- a/tex/generic/context/luatex/luatex-fonts-merged.lua +++ b/tex/generic/context/luatex/luatex-fonts-merged.lua @@ -1,6 +1,6 @@ -- merged file : c:/data/develop/context/sources/luatex-fonts-merged.lua -- parent file : c:/data/develop/context/sources/luatex-fonts.lua --- merge date : 2023-03-20 15:42 +-- merge date : 2023-04-01 09:28 do -- begin closure to overcome local limits and interference @@ -37807,7 +37807,7 @@ local fonts=fonts local otf=fonts.handlers.otf local registerotffeature=otf.features.register local addotffeature=otf.addfeature -local specification={ +local tlig={ type="ligature", order={ "tlig" }, prepend=true, @@ -37816,12 +37816,17 @@ local specification={ [0x2014]={ 0x002D,0x002D,0x002D }, }, } -addotffeature("tlig",specification) -registerotffeature { - name="tlig", - description="tex ligatures", +local tquo={ + type="ligature", + order={ "tquo" }, + prepend=true, + data={ + [0x201C]={ 0x0060,0x0060 }, + [0x201D]={ 0x0027,0x0027 }, + [0x201E]={ 0x002C,0x002C }, + }, } -local specification={ +local trep={ type="substitution", order={ "trep" }, prepend=true, @@ -37829,11 +37834,12 @@ local specification={ [0x0027]=0x2019, }, } -addotffeature("trep",specification) -registerotffeature { - name="trep", - description="tex replacements", -} +addotffeature("trep",trep) +addotffeature("tlig",tlig) +addotffeature("tquo",tquo) +registerotffeature { name="tlig",description="tex ligatures" } +registerotffeature { name="tquo",description="tex quotes" } +registerotffeature { name="trep",description="tex replacements" } local anum_arabic={ [0x0030]=0x0660, [0x0031]=0x0661, diff --git a/tex/generic/context/luatex/luatex-mplib.lua b/tex/generic/context/luatex/luatex-mplib.lua index 1839c44ee..99a23b03c 100644 --- a/tex/generic/context/luatex/luatex-mplib.lua +++ b/tex/generic/context/luatex/luatex-mplib.lua @@ -6,19 +6,14 @@ if not modules then modules = { } end modules ['luatex-mplib'] = { license = "public domain", } ---[[ldx-- -

This module is a stripped down version of libraries that are used -by . It can be used in other macro packages and/or -serve as an example. Embedding in a macro package is upto others and -normally boils down to inputting supp-mpl.tex.

---ldx]]-- +-- This module is a stripped down version of libraries that are used by ConTeXt. It +-- can be used in other macro packages and/or serve as an example. Embedding in a +-- macro package is upto others and normally boils down to inputting 'supp-mpl.tex'. if metapost and metapost.version then - --[[ldx-- -

Let's silently quit and make sure that no one loads it - manually in .

- --ldx]]-- + -- Let's silently quit and make sure that no one loads it manually in + -- ConTeXt. else @@ -29,27 +24,25 @@ else local mplib = require ('mplib') local kpse = require ('kpse') - --[[ldx-- -

We create a namespace and some variables to it. If a namespace is - already defined it wil not be initialized. This permits hooking - in code beforehand.

+ -- We create a namespace and some variables to it. If a namespace is already + -- defined it wil not be initialized. This permits hooking in code beforehand. -

We don't make a format automatically. After all, distributions - might have their own preferences and normally a format (mem) file will - have some special place in the tree. Also, there can already - be format files, different memort settings and other nasty pitfalls that - we don't want to interfere with. If you want, you can define a function - metapost.make(name,mem_name) that does the job.

- --ldx]]-- + -- We don't make a format automatically. After all, distributions might have + -- their own preferences and normally a format (mem) file will have some + -- special place in the TeX tree. Also, there can already be format files, + -- different memort settings and other nasty pitfalls that we don't want to + -- interfere with. If you want, you can define a function + -- + -- metapost.make (name,mem_name) + -- + -- that does the job. metapost = metapost or { } metapost.version = 1.00 metapost.showlog = metapost.showlog or false metapost.lastlog = "" - --[[ldx-- -

A few helpers, taken from l-file.lua.

- --ldx]]-- + -- A few helpers, taken from 'l-file.lua'. local file = file or { } @@ -61,10 +54,7 @@ else return (string.gsub(filename,"%.[%a%d]+$","")) end - --[[ldx-- -

We use the library unless a finder is already - defined.

- --ldx]]-- + -- We use the KPSE library unless a finder is already defined. local mpkpse = kpse.new("luatex","mpost") @@ -76,10 +66,9 @@ else end end - --[[ldx-- -

You can use your own reported if needed, as long as it handles multiple - arguments and formatted strings.

- --ldx]]-- + -- You can use your own reported if needed, as long as it handles multiple + -- arguments and formatted strings. + metapost.report = metapost.report or function(...) if logs.report then @@ -89,11 +78,9 @@ else end end - --[[ldx-- -

The rest of this module is not documented. More info can be found in the - manual, articles in user group journals and the files that - ship with .

- --ldx]]-- + -- The rest of this module is not documented. More info can be found in the + -- LuaTeX manual, articles in user group journals and the files that ship + -- with ConTeXt. function metapost.resetlastlog() metapost.lastlog = "" @@ -329,9 +316,8 @@ else return true -- done end - --[[ldx-- -

We removed some message and tracing code. We might even remove the flusher

- --ldx]]-- + -- We removed some message and tracing code. We might even remove the + -- flusher. local function pdf_startfigure(n,llx,lly,urx,ury) tex.sprint(format("\\startMPLIBtoPDF{%s}{%s}{%s}{%s}",llx,lly,urx,ury)) @@ -443,9 +429,7 @@ else return t end - --[[ldx-- -

Support for specials has been removed.

- --ldx]]-- + -- Support for specials has been removed. function metapost.flush(result,flusher) if result then diff --git a/tex/generic/context/luatex/luatex-preprocessor.lua b/tex/generic/context/luatex/luatex-preprocessor.lua index 8faa0b47e..b1debcd5c 100644 --- a/tex/generic/context/luatex/luatex-preprocessor.lua +++ b/tex/generic/context/luatex/luatex-preprocessor.lua @@ -6,11 +6,9 @@ if not modules then modules = { } end modules ['luatex-preprocessor'] = { license = "see context related readme files" } ---[[ldx -

This is a stripped down version of the preprocessor. In - we have a bit more, use a different logger, and -use a few optimizations. A few examples are shown at the end.

---ldx]] +-- This is a stripped down version of the preprocessor. In ConTeXt we have a bit +-- more, use a different logger, and use a few optimizations. A few examples are +-- shown at the end. local rep, sub, gmatch = string.rep, string.sub, string.gmatch local insert, remove = table.insert, table.remove @@ -99,10 +97,6 @@ local parser = lpeg.Cs { "converter", converter = (lpeg.V("definition") + anything)^1, } ---[[ldx -

We provide a few commands.

---ldx]] - -- local texkpse local function find_file(...) -- cgit v1.2.3