summaryrefslogtreecommitdiff
path: root/tex/context/base
diff options
context:
space:
mode:
Diffstat (limited to 'tex/context/base')
-rw-r--r--tex/context/base/cont-new.mkiv2
-rw-r--r--tex/context/base/context-version.pdfbin4138 -> 2934 bytes
-rw-r--r--tex/context/base/context.mkiv3
-rw-r--r--tex/context/base/font-gds.lua15
-rw-r--r--tex/context/base/font-lib.mkvi3
-rw-r--r--tex/context/base/font-log.lua12
-rw-r--r--tex/context/base/font-syn.lua12
-rw-r--r--tex/context/base/font-trt.lua57
-rw-r--r--tex/context/base/l-file.lua6
-rw-r--r--tex/context/base/lang-def.lua9
-rw-r--r--tex/context/base/lang-def.mkiv20
-rw-r--r--tex/context/base/meta-ini.mkiv16
-rw-r--r--tex/context/base/mlib-run.lua7
-rw-r--r--tex/context/base/mult-sys.mkiv1
-rw-r--r--tex/context/base/status-files.pdfbin24716 -> 24700 bytes
-rw-r--r--tex/context/base/status-lua.pdfbin211592 -> 211726 bytes
-rw-r--r--tex/context/base/status-mkiv.lua6
-rw-r--r--tex/context/base/typo-dig.lua2
-rw-r--r--tex/context/base/typo-dig.mkiv2
19 files changed, 152 insertions, 21 deletions
diff --git a/tex/context/base/cont-new.mkiv b/tex/context/base/cont-new.mkiv
index cf920d0e6..754a1dc1b 100644
--- a/tex/context/base/cont-new.mkiv
+++ b/tex/context/base/cont-new.mkiv
@@ -11,7 +11,7 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-\newcontextversion{2013.05.13 23:17}
+\newcontextversion{2013.05.14 19:42}
%D This file is loaded at runtime, thereby providing an excellent place for
%D hacks, patches, extensions and new features.
diff --git a/tex/context/base/context-version.pdf b/tex/context/base/context-version.pdf
index 1fd737dca..a1e2aa468 100644
--- a/tex/context/base/context-version.pdf
+++ b/tex/context/base/context-version.pdf
Binary files differ
diff --git a/tex/context/base/context.mkiv b/tex/context/base/context.mkiv
index ae05c55f3..f6f4f2d1b 100644
--- a/tex/context/base/context.mkiv
+++ b/tex/context/base/context.mkiv
@@ -25,7 +25,7 @@
%D up and the dependencies are more consistent.
\edef\contextformat {\jobname}
-\edef\contextversion{2013.05.13 23:17}
+\edef\contextversion{2013.05.14 19:42}
\edef\contextkind {beta}
%D For those who want to use this:
@@ -199,6 +199,7 @@
\loadmarkfile{lang-url}
\loadmarkfile{lang-def}
\loadmarkfile{lang-wrd} % can be optional
+%loadmarkfile{lang-rep} % can be optional (will be added after the 2013 code freeze, maybe nice for a ctx 2013 presentation)
\loadmkvifile{file-job} % why so late?
diff --git a/tex/context/base/font-gds.lua b/tex/context/base/font-gds.lua
index 91a5ea66c..6332f40b0 100644
--- a/tex/context/base/font-gds.lua
+++ b/tex/context/base/font-gds.lua
@@ -604,6 +604,21 @@ end
fontgoodies.register("compositions", initialize)
+-- extra treatments (on top of defaults): \loadfontgoodies[mytreatments]
+
+local treatmentdata = fonts.treatments.data
+
+local function initialize(goodies)
+ local treatments = goodies.treatments
+ if treatments then
+ for name, data in next, treatments do
+ treatmentdata[name] = data -- always wins
+ end
+ end
+end
+
+fontgoodies.register("treatments", initialize)
+
local filenames = fontgoodies.filenames or allocate()
fontgoodies.filenames = filenames
diff --git a/tex/context/base/font-lib.mkvi b/tex/context/base/font-lib.mkvi
index da930da78..4bacef10b 100644
--- a/tex/context/base/font-lib.mkvi
+++ b/tex/context/base/font-lib.mkvi
@@ -56,7 +56,8 @@
\registerctxluafile{font-vf} {1.001}
\registerctxluafile{font-enh}{1.001}
-\registerctxluafile{font-gds}{1.001} % currently only otf
+\registerctxluafile{font-trt}{1.001}
+\registerctxluafile{font-gds}{1.001}
\registerctxluafile{font-def}{1.001}
\registerctxluafile{font-ctx}{1.001} % after def as it overloads
diff --git a/tex/context/base/font-log.lua b/tex/context/base/font-log.lua
index 773108e44..41da75378 100644
--- a/tex/context/base/font-log.lua
+++ b/tex/context/base/font-log.lua
@@ -67,14 +67,20 @@ end
statistics.register("loaded fonts", function()
if next(usedfonts) then
local t, n = { }, 0
+ local treatmentdata = fonts.treatments.data
for name, used in table.sortedhash(usedfonts) do
n = n + 1
+ local base = basename(name)
if complete then
- t[n] = used .. "->" .. basename(name)
+ t[n] = format("%s -> %s",used,base)
else
- t[n] = basename(name)
+ t[n] = base
+ end
+ local treatment = treatmentdata[base]
+ if treatment and treatment.comment then
+ t[n] = format("%s (%s)",t[n],treatment.comment)
end
end
- return n > 0 and format("%s files: %s",n,concat(t," ")) or "none"
+ return n > 0 and format("%s files: %s",n,concat(t,", ")) or "none"
end
end)
diff --git a/tex/context/base/font-syn.lua b/tex/context/base/font-syn.lua
index 81e27afd6..27176dade 100644
--- a/tex/context/base/font-syn.lua
+++ b/tex/context/base/font-syn.lua
@@ -28,6 +28,7 @@ local nameonly = file.nameonly
local pathpart = file.pathpart
local filejoin = file.join
local is_qualified_path = file.is_qualified_path
+local exists = io.exists
local findfile = resolvers.findfile
local cleanpath = resolvers.cleanpath
@@ -719,17 +720,24 @@ local function analyzefiles(olddata)
local oldindices = olddata and olddata.indices or { }
local oldspecifications = olddata and olddata.specifications or { }
local oldrejected = olddata and olddata.rejected or { }
+ local treatmentdata = fonts.treatments.data
local function identify(completename,name,suffix,storedname)
local pathpart, basepart = splitbase(completename)
nofread = nofread + 1
- if done[name] then
+ local treatment = treatmentdata[completename] or treatmentdata[basepart]
+ if treatment and treatment.ignored then
+ if trace_names then
+ report_names("%s font %a is ignored, reason %a",suffix,completename,treatment.comment or "unknown")
+ end
+ nofskipped = nofskipped + 1
+ elseif done[name] then
-- already done (avoid otf afm clash)
if trace_names then
report_names("%s font %a already done",suffix,completename)
end
nofduplicates = nofduplicates + 1
nofskipped = nofskipped + 1
- elseif not io.exists(completename) then
+ elseif not exists(completename) then
-- weird error
if trace_names then
report_names("%s font %a does not really exist",suffix,completename)
diff --git a/tex/context/base/font-trt.lua b/tex/context/base/font-trt.lua
new file mode 100644
index 000000000..6fc8028d1
--- /dev/null
+++ b/tex/context/base/font-trt.lua
@@ -0,0 +1,57 @@
+if not modules then modules = { } end modules ['font-trt'] = {
+ version = 1.001,
+ comment = "companion to font-ini.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+local rawget, dofile, next = rawget, dofile, next
+
+--[[ldx--
+<p>We provide a simple treatment mechanism (mostly because I want to demonstrate
+something in a manual). It's one of the few places where an lfg file gets loaded
+outside the goodies manager.</p>
+--ldx]]--
+
+local treatments = utilities.storage.allocate()
+fonts.treatments = treatments
+local treatmentdata = { }
+treatments.data = treatmentdata
+treatments.filename = "treatments.lfg"
+
+-- function treatments.load(name)
+-- local filename = resolvers.findfile(name)
+-- if filename and filename ~= "" then
+-- local goodies = dofile(filename)
+-- if goodies then
+-- local treatments = goodies.treatments
+-- if treatments then
+-- for name, data in next, treatments do
+-- treatmentdata[name] = data -- always wins
+-- end
+-- end
+-- end
+-- end
+-- end
+
+table.setmetatableindex(treatmentdata,function(t,k)
+ local files = resolvers.findfiles(treatments.filename)
+ if files then
+ for i=1,#files do
+ local goodies = dofile(files[i])
+ if goodies then
+ local treatments = goodies.treatments
+ if treatments then
+ for name, data in next, treatments do
+ if not rawget(t,name) then
+ t[name] = data
+ end
+ end
+ end
+ end
+ end
+ end
+ table.setmetatableindex(treatmentdata,nil)
+ return treatmentdata[k]
+end)
diff --git a/tex/context/base/l-file.lua b/tex/context/base/l-file.lua
index 29416caf0..acb4216b0 100644
--- a/tex/context/base/l-file.lua
+++ b/tex/context/base/l-file.lua
@@ -153,7 +153,11 @@ function file.splitname(str,splitdrive)
end
function file.splitbase(str)
- return str and lpegmatch(pattern_d,str) -- returns path, base+suffix
+ if str then
+ return lpegmatch(pattern_d,str) -- returns path, base+suffix (path has / appended, might change at some point)
+ else
+ return "", str -- assume no path
+ end
end
---- stripslash = C((1 - P("/")^1*P(-1))^0)
diff --git a/tex/context/base/lang-def.lua b/tex/context/base/lang-def.lua
index 6656d8ed9..c0c3981f7 100644
--- a/tex/context/base/lang-def.lua
+++ b/tex/context/base/lang-def.lua
@@ -342,6 +342,15 @@ local specifications = allocate {
["variant"] = "sv",
},
{
+ ["description"] = "Thai",
+ ["script"] = "thai",
+ -- ["bibliographical"] = "",
+ -- ["terminological"] = "",
+ ["context"] = "th",
+ ["opentype"] = "tha",
+ -- ["variant"] = "",
+ },
+ {
["description"] = "Turkish",
["script"] = "latn",
["bibliographical"] = "tur",
diff --git a/tex/context/base/lang-def.mkiv b/tex/context/base/lang-def.mkiv
index d4e40dad1..9f84e90f0 100644
--- a/tex/context/base/lang-def.mkiv
+++ b/tex/context/base/lang-def.mkiv
@@ -678,6 +678,26 @@
\installlanguage [\s!vietnamese] [\s!vi]
+% Thai (teaser for Mojca)
+
+\installlanguage
+ [\s!th]
+ [\c!spacing=\v!broad,
+ \c!leftsentence=\emdash,
+ \c!rightsentence=\emdash,
+ \c!leftsubsentence=\emdash,
+ \c!rightsubsentence=\emdash,
+ \c!leftquote=\upperleftsinglesixquote,
+ \c!rightquote=\upperrightsingleninequote,
+ \c!leftquotation=\upperleftdoublesixquote,
+ \c!rightquotation=\upperrightdoubleninequote,
+ \c!date={\v!month,\space,\v!day,{,\space},\v!year},
+ \s!patterns=\s!th,
+ \s!lefthyphenmin=2,
+ \s!righthyphenmin=3]
+
+\installlanguage [\s!thai] [\s!th]
+
%D Todo: generate this one from languages.data
\installlanguage[nld][\s!nl]
diff --git a/tex/context/base/meta-ini.mkiv b/tex/context/base/meta-ini.mkiv
index 00b1da032..4281eef06 100644
--- a/tex/context/base/meta-ini.mkiv
+++ b/tex/context/base/meta-ini.mkiv
@@ -110,7 +110,7 @@
\let\stopMPextensions\relax
-\unexpanded\def\startMPinitializations#1\stopMPinitializations % for all instances, when enables
+\unexpanded\def\startMPinitializations#1\stopMPinitializations % for all instances, when enabled
{\global\t_meta_initializations\expandafter{\the\t_meta_initializations#1}}
\let\stopMPinitializations\relax
@@ -432,7 +432,7 @@
\startMPextensions
string contextversion;
- contextversion:="\contextversion";
+ contextversion:="\contextversion"; % expanded
\stopMPextensions
%D \macros
@@ -838,12 +838,12 @@
\def\MPdataMPOfile{\jobname-mpgraph.mpo}
\def\MPdataMPYfile{\jobname-mpgraph.mpy}
-\startMPextensions
+\startMPinitializations
boolean collapse_data; collapse_data:=true;
def data_mpd_file = "\MPdataMPDfile" enddef ;
def data_mpo_file = "\MPdataMPOfile" enddef ;
def data_mpy_file = "\MPdataMPYfile" enddef ;
-\stopMPextensions
+\stopMPinitializations
\unexpanded\def\getMPdata
{\let\MPdata\secondoftwoarguments
@@ -1175,11 +1175,13 @@
vardef ForegroundBox =
unitsquare xysized(HSize,VSize)
enddef ;
- vardef PageFraction =
- if \lastpage>1: (\realfolio-1)/(\lastpage-1) else: 1 fi
- enddef ;
+ PageFraction := 1 ;
\stopMPextensions
+\startMPinitializations
+ PageFraction:=\lastpage>1:(\realfolio-1)/(\lastpage-1)else:1fi;
+\stopMPinitializations
+
%D And some more. These are not really needed since we
%D don't use the normal figure inclusion macros any longer.
diff --git a/tex/context/base/mlib-run.lua b/tex/context/base/mlib-run.lua
index 4ff16b18e..90a4a9195 100644
--- a/tex/context/base/mlib-run.lua
+++ b/tex/context/base/mlib-run.lua
@@ -116,15 +116,16 @@ local function i_finder(name,mode,ftype) -- fake message for mpost.map and metaf
return finder(specification,name,mode,ftype)
end
-local function o_finder(name, mode, ftype)
+local function o_finder(name,mode,ftype)
+ report_metapost("output file %a, mode %a, ftype %a",name,mode,ftype)
return name
end
local function finder(name, mode, ftype)
if mode == "w" then
- return o_finder(name, mode, ftype)
+ return o_finder(name,mode,ftype)
else
- return i_finder(name, mode, ftype)
+ return i_finder(name,mode,ftype)
end
end
diff --git a/tex/context/base/mult-sys.mkiv b/tex/context/base/mult-sys.mkiv
index c184d91b5..f0db9fa67 100644
--- a/tex/context/base/mult-sys.mkiv
+++ b/tex/context/base/mult-sys.mkiv
@@ -81,6 +81,7 @@
\definesystemconstant {chinese} \definesystemconstant {cn}
\definesystemconstant {japanese} \definesystemconstant {ja}
\definesystemconstant {korean} \definesystemconstant {kr}
+\definesystemconstant {thai} \definesystemconstant {th} % mojca mentioned it at BT2013 but we need more info
%D For proper \UNICODE\ support we need a few font related constants.
diff --git a/tex/context/base/status-files.pdf b/tex/context/base/status-files.pdf
index 7e3205cf4..c01100bd3 100644
--- a/tex/context/base/status-files.pdf
+++ b/tex/context/base/status-files.pdf
Binary files differ
diff --git a/tex/context/base/status-lua.pdf b/tex/context/base/status-lua.pdf
index 9f572c8d8..c6a58153f 100644
--- a/tex/context/base/status-lua.pdf
+++ b/tex/context/base/status-lua.pdf
Binary files differ
diff --git a/tex/context/base/status-mkiv.lua b/tex/context/base/status-mkiv.lua
index 62df5806f..8e8b59f29 100644
--- a/tex/context/base/status-mkiv.lua
+++ b/tex/context/base/status-mkiv.lua
@@ -3255,6 +3255,12 @@ return {
},
{
category = "lua",
+ filename = "font-trt",
+ loading = "font-lib",
+ status = "okay",
+ },
+ {
+ category = "lua",
filename = "font-vf",
loading = "font-lib",
status = "pending",
diff --git a/tex/context/base/typo-dig.lua b/tex/context/base/typo-dig.lua
index e6c65399d..62d17fa3b 100644
--- a/tex/context/base/typo-dig.lua
+++ b/tex/context/base/typo-dig.lua
@@ -151,7 +151,7 @@ function digits.set(n) -- number or 'reset'
texattribute[a_digits] = n
end
-digits.handler = nodes.installattributehandler {
+digits.handler = nodes.installattributehandler { -- we could avoid this wrapper
name = "digits",
namespace = digits,
processor = process,
diff --git a/tex/context/base/typo-dig.mkiv b/tex/context/base/typo-dig.mkiv
index 832ebbec4..71425c594 100644
--- a/tex/context/base/typo-dig.mkiv
+++ b/tex/context/base/typo-dig.mkiv
@@ -52,7 +52,7 @@
\unexpanded\def\dummydigit {\hphantom {\setdigitsmanipulation[\number\plusone]0}}
\appendtoks
- \resetcharacterspacing
+ \resetdigitsmanipulation
\to \everyinitializeverbatim
\protect \endinput