summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/scripts
diff options
context:
space:
mode:
authorTaco Hoekwater <taco@elvenkind.com>2006-12-01 10:42:41 +0000
committerTaco Hoekwater <taco@elvenkind.com>2006-12-01 10:42:41 +0000
commit93211732ba767f3d2be8e4b948553a42791302c8 (patch)
treeca5509bc7a7e9aa8e310dc5278a3c7c9bdbad7dc /Master/texmf-dist/scripts
parentc407afe4a4284ab98479d51d2553287055f0ce1c (diff)
context release 2006.11.29
git-svn-id: svn://tug.org/texlive/trunk@2572 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/scripts')
-rw-r--r--Master/texmf-dist/scripts/context/perl/texfont.pl22
-rw-r--r--Master/texmf-dist/scripts/context/ruby/base/tex.rb52
-rw-r--r--Master/texmf-dist/scripts/context/ruby/texexec.rb6
-rw-r--r--Master/texmf-dist/scripts/context/ruby/texmfstart.rb5
-rw-r--r--Master/texmf-dist/scripts/context/ruby/textools.rb82
5 files changed, 126 insertions, 41 deletions
diff --git a/Master/texmf-dist/scripts/context/perl/texfont.pl b/Master/texmf-dist/scripts/context/perl/texfont.pl
index ec875e5b472..e6ebf7029da 100644
--- a/Master/texmf-dist/scripts/context/perl/texfont.pl
+++ b/Master/texmf-dist/scripts/context/perl/texfont.pl
@@ -137,6 +137,7 @@ my $slant = "" ;
my $spaced = "" ;
my $caps = "" ;
my $noligs = 0 ;
+my $nofligs = 0 ;
my $test = 0 ;
my $virtual = 0 ;
my $novirtual = 0 ;
@@ -175,6 +176,7 @@ my @cleanup = () ; # atl: build list of generated files to delete
( "help" => \$help,
"makepath" => \$makepath,
"noligs" => \$noligs,
+ "nofligs" => \$nofligs,
"show" => \$show,
"install" => \$install,
"encoding=s" => \$encoding,
@@ -357,7 +359,7 @@ if ($help)
report "--slant=s : slant glyphs in font by factor (0.0 - 1.5)" ;
report "--extend=s : extend glyphs in font by factor (0.0 - 1.5)" ;
report "--caps=s : capitalize lowercase chars by factor (0.5 - 1.0)" ;
- report "--noligs : remove ligatures" ;
+ report "--noligs --nofligs : remove ligatures" ;
print "\n" ;
report "--install : copy files from source to font tree" ;
report "--listing : list files on auto sourcepath" ;
@@ -436,7 +438,7 @@ my $outlinepath = $sourcepath ; my $path = "" ;
my $shape = "" ;
-if ($noligs)
+if ($noligs||$nofligs)
{ report ("ligatures : removed") ;
$fontsuffix .= "-unligatured" ;
$namesuffix .= "-NoLigs" }
@@ -1170,9 +1172,9 @@ foreach my $file (@files)
if ($afmpl)
{ report " generating pl : $cleanname$fontsuffix (from $cleanname)" ;
$encstr = " -p $encfil" ;
-if ($uselmencodings) {
- $encstr =~ s/(ec)\.enc$/lm\-$1\.enc/ ;
-}
+ if ($uselmencodings) {
+ $encstr =~ s/(ec)\.enc$/lm\-$1\.enc/ ;
+ }
my $command = "afm2pl -f afm2tfm $shape $passon $encstr $file $cleanname$fontsuffix.vpl" ;
print "$command\n" if $trace ;
my $ok = `$command` ;
@@ -1191,19 +1193,21 @@ if ($uselmencodings) {
if ($font =~ /.*?([\d\.]+)\s*SlantFont/io) { $slant = $1 }
if ($extend ne "") { $option .= " $extend ExtendFont " }
if ($slant ne "") { $option .= " $slant SlantFont " }
- if ($noligs) { removeligatures("$raw$cleanname$fontsuffix") }
if ($afmpl)
- { report "generating new tfm : $use$cleanname$fontsuffix" ;
+ { if ($noligs||$nofligs) { removeligatures("$cleanname$fontsuffix") }
+ report "generating new tfm : $use$cleanname$fontsuffix" ;
my $command = "pltotf $cleanname$fontsuffix.vpl $use$cleanname$fontsuffix.tfm" ;
print "$command\n" if $trace ;
my $ok = `$command` }
elsif ($virtual)
- { report "generating new vf : $use$cleanname$fontsuffix (from $use$cleanname)" ;
+ { if ($noligs||$nofligs) { removeligatures("$use$cleanname$fontsuffix") }
+ report "generating new vf : $use$cleanname$fontsuffix (from $use$cleanname)" ;
my $command = "vptovf $use$cleanname$fontsuffix.vpl $use$cleanname$fontsuffix.vf $use$cleanname$fontsuffix.tfm" ;
print "$command\n" if $trace ;
my $ok = `$command` }
else
- { report "generating new tfm : $use$cleanname$fontsuffix (from $raw$cleanname)" ;
+ { if ($noligs||$nofligs) { removeligatures("$raw$cleanname$fontsuffix") }
+ report "generating new tfm : $use$cleanname$fontsuffix (from $raw$cleanname)" ;
my $command = "pltotf $raw$cleanname$fontsuffix.vpl $use$cleanname$fontsuffix.tfm" ;
print "$command\n" if $trace ;
my $ok = `$command` } } }
diff --git a/Master/texmf-dist/scripts/context/ruby/base/tex.rb b/Master/texmf-dist/scripts/context/ruby/base/tex.rb
index f6f3dc4ed83..25e7ba5d7f8 100644
--- a/Master/texmf-dist/scripts/context/ruby/base/tex.rb
+++ b/Master/texmf-dist/scripts/context/ruby/base/tex.rb
@@ -145,6 +145,8 @@ class TEX
['plain','mpost'] .each do |f| @@mpsformats[f] = 'plain' end
['metafun','context','standard'] .each do |f| @@mpsformats[f] = 'metafun' end
+ # no 'standard' progname ! / beware, when using texexec we always use the context/metafun values
+
['pdftex','pdfetex','aleph','omega',
'xetex','luatex'] .each do |p| @@prognames[p] = 'context' end
['mpost'] .each do |p| @@prognames[p] = 'metafun' end
@@ -169,6 +171,7 @@ class TEX
@@runoptions['pdftex'] = ['--8bit '] # pdftex is now pdfetex
@@runoptions['luatex'] = ['']
@@runoptions['aleph'] = ['--8bit ']
+ @@runoptions['mpost'] = ['--8bit ']
@@booleanvars = [
'batchmode', 'nonstopmode', 'fast', 'fastdisabled', 'silentmode', 'final',
@@ -280,7 +283,7 @@ class TEX
setvariable('distribution', Kpse.distribution)
setvariable('texformats', defaulttexformats)
setvariable('mpsformats', defaultmpsformats)
- setvariable('progname', 'context')
+ setvariable('progname', 'standard') # or ''
setvariable('interface', 'standard')
setvariable('engine', 'standard') # replaced by tex/mpsengine
setvariable('backend', 'pdftex')
@@ -455,13 +458,13 @@ class TEX
end
end
- def validprogname(str,engine='standard')
- if str && @@prognames.key?(str) then
- @@prognames[str]
- elsif (engine != 'standard') && @@prognames.key?(engine) then
- @@prognames[engine]
+ def validprogname(str)
+ if str then
+ [str].flatten.each do |s|
+ return @@prognames[s] if @@prognames.key?(s)
+ end
else
- str
+ return nil
end
end
@@ -506,12 +509,8 @@ class TEX
when /miktex/io then prefix = "-alias"
else return ""
end
- if progname then
- if progname = validprogname(progname) then
- "#{prefix}=#{progname}"
- else
- ""
- end
+ if progname and not progname.empty? then
+ "#{prefix}=#{progname}"
else
prefix
end
@@ -611,7 +610,7 @@ class TEX
unless texformats || mpsformats then
report('provide valid format (name.tex, name.mp, ...) or format id (metafun, en, nl, ...)')
end
- if texformats && texengine && (progname = validprogname(getvariable('progname'),texengine)) then
+ if texformats && texengine then
report("using tex engine #{texengine}")
texformatpath = if getvariable('local') then '.' else Kpse.formatpath(texengine,true) end
# can be empty, to do
@@ -626,12 +625,13 @@ class TEX
cleanupluafiles
texformats.each do |texformat|
report("generating tex format #{texformat}")
-run_luatools("--ini --compile #{texformat}")
+ run_luatools("--ini --compile #{texformat}")
end
compileluafiles
else
texformats.each do |texformat|
report("generating tex format #{texformat}")
+ progname = validprogname([getvariable('progname'),texformat,texengine])
runcommand([quoted(texengine),prognameflag(progname),iniflag,tcxflag,prefixed(texformat,texengine),texmakeextras(texformat)])
end
end
@@ -643,7 +643,7 @@ run_luatools("--ini --compile #{texformat}")
texformatpath = ''
end
# generate mps formats
- if mpsformats && mpsengine && (progname = validprogname(getvariable('progname'),mpsengine)) then
+ if mpsformats && mpsengine then
report("using mp engine #{mpsengine}")
mpsformatpath = if getvariable('local') then '.' else Kpse.formatpath(mpsengine,false) end
report("using mps format path #{mpsformatpath}")
@@ -651,8 +651,8 @@ run_luatools("--ini --compile #{texformat}")
if FileTest.writable?(mpsformatpath) then
mpsformats.each do |mpsformat|
report("generating mps format #{mpsformat}")
- # runcommand([quoted(mpsengine),prognameflag(progname),iniflag,tcxflag,mpsformat,mpsmakeextras(mpsformat)])
- runcommand([quoted(mpsengine),iniflag,tcxflag,mpsformat,mpsmakeextras(mpsformat)])
+ progname = validprogname([getvariable('progname'),mpsformat,mpsengine])
+ runcommand([quoted(mpsengine),prognameflag(progname),iniflag,tcxflag,runoptions(mpsengine),mpsformat,mpsmakeextras(mpsformat)])
end
else
report("unable to make format due to lack of permissions")
@@ -1284,7 +1284,8 @@ class TEX
opt << "\\enableregime[utf]"
end
opt << "\\setupsystem[\\c!n=#{kindofrun},\\c!m=#{currentrun}]\n"
- opt << "\\def\\MPOSTformatswitch\{#{prognameflag('metafun')} #{formatflag('mpost')}=\}\n"
+ progname = validprogname(['metafun']) # [getvariable('progname'),mpsformat,mpsengine]
+ opt << "\\def\\MPOSTformatswitch\{#{prognameflag(progname)} #{formatflag('mpost')}=\}\n"
if getvariable('batchmode') then
opt << "\\batchmode\n"
end
@@ -1494,15 +1495,14 @@ class TEX
checktestversion
texengine = validtexengine(getvariable('texengine'))
texformat = validtexformat(getarrayvariable('texformats').first)
- progname = validprogname(getvariable('progname'))
report("tex engine: #{texengine}")
report("tex format: #{texformat}")
- report("progname: #{progname}")
- if texengine && texformat && progname then
+ if texengine && texformat then
fixbackendvars(@@mappaths[texengine])
if texengine == "luatex" then
run_luatools("--fmt=#{texformat} #{filename}")
else
+ progname = validprogname([getvariable('progname'),texformat,texengine])
runcommand([quoted(texengine),prognameflag(progname),formatflag(texengine,texformat),tcxflag,runoptions(texengine),filename,texprocextras(texformat)])
end
# true
@@ -1515,11 +1515,11 @@ end
checktestversion
mpsengine = validmpsengine(getvariable('mpsengine'))
mpsformat = validmpsformat(getarrayvariable('mpsformats').first)
- progname = validprogname(getvariable('progname'))
- if mpsengine && mpsformat && progname then
+ if mpsengine && mpsformat then
ENV["MPXCOMMAND"] = "0" unless mpx
- # runcommand([quoted(mpsengine),prognameflag(progname),formatflag(mpsengine,mpsformat),tcxflag,runoptions(mpsengine),filename,mpsprocextras(mpsformat)])
- runcommand([quoted(mpsengine),formatflag(mpsengine,mpsformat),tcxflag,runoptions(mpsengine),mpname,mpsprocextras(mpsformat)])
+ progname = validprogname([getvariable('progname'),mpsformat,mpsengine])
+ runcommand([quoted(mpsengine),prognameflag(progname),formatflag(mpsengine,mpsformat),tcxflag,runoptions(mpsengine),mpname,mpsprocextras(mpsformat)])
+ # runcommand([quoted(mpsengine),formatflag(mpsengine,mpsformat),tcxflag,runoptions(mpsengine),mpname,mpsprocextras(mpsformat)])
true
else
false
diff --git a/Master/texmf-dist/scripts/context/ruby/texexec.rb b/Master/texmf-dist/scripts/context/ruby/texexec.rb
index 55636780dc2..ea4c48d930d 100644
--- a/Master/texmf-dist/scripts/context/ruby/texexec.rb
+++ b/Master/texmf-dist/scripts/context/ruby/texexec.rb
@@ -428,7 +428,11 @@ job.setvariable('result',result)
if files.length > 0 then
if f = File.open(job.tempfilename('tex'),'w') then
scale = @commandline.checkedoption('scale')
- scale = (scale * 1000).to_i if scale.to_i < 10
+ begin
+ scale = (scale.to_i * 1000).to_i if scale.to_i < 10
+ rescue
+ scale = 1000
+ end
paperoffset = @commandline.checkedoption('paperoffset', '0cm')
f << "\\starttext\n"
files.each do |filename|
diff --git a/Master/texmf-dist/scripts/context/ruby/texmfstart.rb b/Master/texmf-dist/scripts/context/ruby/texmfstart.rb
index b9ced8813e3..a886b2aa142 100644
--- a/Master/texmf-dist/scripts/context/ruby/texmfstart.rb
+++ b/Master/texmf-dist/scripts/context/ruby/texmfstart.rb
@@ -1506,11 +1506,6 @@ $makelist = [
# no, 'texmfstart'
]
-# if ENV['TEXMFSTART_MODE'] = 'experimental' then
- # $predefined['texexec'] = 'newtexexec.rb'
- # $predefined['pstopdf'] = 'newpstopdf.rb'
-# end
-
$scriptlist = 'rb|pl|py|lua|jar'
$documentlist = 'pdf|ps|eps|htm|html'
diff --git a/Master/texmf-dist/scripts/context/ruby/textools.rb b/Master/texmf-dist/scripts/context/ruby/textools.rb
index 345a2757204..b6300215e78 100644
--- a/Master/texmf-dist/scripts/context/ruby/textools.rb
+++ b/Master/texmf-dist/scripts/context/ruby/textools.rb
@@ -658,6 +658,87 @@ class Commands
end
+ @@knownchars = Hash.new
+
+ @@knownchars['ae'] = 'aeligature' ; @@knownchars['oe'] = 'oeligature'
+ @@knownchars['AE'] = 'AEligature' ; @@knownchars['OE'] = 'OEligature'
+
+ @@knownchars['acute' ] = 'textacute'
+ @@knownchars['breve' ] = 'textbreve'
+ @@knownchars['caron' ] = 'textcaron'
+ @@knownchars['cedilla' ] = 'textcedilla'
+ @@knownchars['circumflex' ] = 'textcircumflex'
+ @@knownchars['diaeresis' ] = 'textdiaeresis'
+ @@knownchars['dotaccent' ] = 'textdotaccent'
+ @@knownchars['grave' ] = 'textgrave'
+ @@knownchars['hungarumlaut'] = 'texthungarumlaut'
+ @@knownchars['macron' ] = 'textmacron'
+ @@knownchars['ogonek' ] = 'textogonek'
+ @@knownchars['ring' ] = 'textring'
+ @@knownchars['tilde' ] = 'texttilde'
+
+ @@knownchars['cent' ] = 'textcent'
+ @@knownchars['currency'] = 'textcurrency'
+ @@knownchars['euro' ] = 'texteuro'
+ @@knownchars['florin' ] = 'textflorin'
+ @@knownchars['sterling'] = 'textsterling'
+ @@knownchars['yen' ] = 'textyen'
+
+ @@knownchars['brokenbar'] = 'textbrokenbar'
+ @@knownchars['bullet' ] = 'textbullet'
+ @@knownchars['dag' ] = 'textdag'
+ @@knownchars['ddag' ] = 'textddag'
+ @@knownchars['degree' ] = 'textdegree'
+ @@knownchars['div' ] = 'textdiv'
+ @@knownchars['ellipsis' ] = 'textellipsis'
+ @@knownchars['fraction' ] = 'textfraction'
+ @@knownchars['lognot' ] = 'textlognot'
+ @@knownchars['minus' ] = 'textminus'
+ @@knownchars['mu' ] = 'textmu'
+ @@knownchars['multiply' ] = 'textmultiply'
+ @@knownchars['pm' ] = 'textpm'
+
+ def encmake
+ afmfile = @commandline.argument('first')
+ encoding = @commandline.argument('second') || 'dummy'
+ if afmfile && FileTest.file?(afmfile) then
+ chars = Array.new
+ IO.readlines(afmfile).each do |line|
+ if line =~ /C\s+(\d+).*?N\s+([a-zA-Z\-\.]+?)\s*;/ then
+ chars[$1.to_i] = $2
+ end
+ end
+ if f = File.open(encoding+'.enc','w') then
+ f << "% Encoding file, generated by textools.rb from #{afmfile}\n"
+ f << "\n"
+ f << "/#{encoding.gsub(/[^a-zA-Z]/,'')}encoding [\n"
+ 256.times do |i|
+ f << " /#{chars[i] || '.notdef'}\n"
+ end
+ f << "] def\n"
+ f.close
+ end
+ if f = File.open('enco-'+encoding+'.tex','w') then
+ f << "% ConTeXt file, generated by textools.rb from #{afmfile}\n"
+ f << "\n"
+ f << "\\startencoding[#{encoding}]\n\n"
+ 256.times do |i|
+ if str = chars[i] then
+ tmp = str.gsub(/dieresis/,'diaeresis')
+ if chr = @@knownchars[tmp] then
+ f << " \\definecharacter #{chr} #{i}\n"
+ elsif tmp.length > 5 then
+ f << " \\definecharacter #{tmp} #{i}\n"
+ end
+ end
+ end
+ f << "\n\\stopencoding\n"
+ f << "\n\\endinput\n"
+ f.close
+ end
+ end
+ end
+
private
def flushencoding (file, from, to, names)
@@ -930,6 +1011,7 @@ commandline.registeraction('updatetree' , 'fromroot toroot [--force --noch
commandline.registeraction('downcasefilenames', '[--recurse] [--force]') # not yet documented
commandline.registeraction('stripformfeeds' , '[--recurse] [--force]') # not yet documented
commandline.registeraction('showfont' , 'filename')
+commandline.registeraction('encmake' , 'afmfile encodingname')
commandline.registeraction('tpmmake' , 'tpm file (run in texmf root)')