From 3fcf7bf620cd3a7560ef3ff6ac199a7b04579ec0 Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Fri, 26 Jan 2007 12:45:02 +0100 Subject: [PATCH] remove abs_path(), document shortcomings wrt relative dirs. --- README.texi | 3 +++ mftrace.py | 23 ++--------------------- 2 files changed, 5 insertions(+), 21 deletions(-) diff --git a/README.texi b/README.texi index 997ec7c..7610a8e 100644 --- a/README.texi +++ b/README.texi @@ -269,6 +269,9 @@ FontForge does not recognize TeX encodings. @section Bugs and todo @itemize +@item Environment variables containing relative directories, + such as MFINPUTS or TFMINPUTS, are not handled correctly. + @item Discuss fonts & copyright. @item Submit @file{tfm.py} to www.python.org. @file{tfm.py} is a python module to parse Tex Font Metric file. diff --git a/mftrace.py b/mftrace.py index 2ba9340..b2df35f 100644 --- a/mftrace.py +++ b/mftrace.py @@ -898,33 +898,14 @@ def gen_pixel_font (filename, metric, magnification): try: open ('%s.%dgf' % (filename, prod)) except IOError: - os.environ['KPSE_DOT'] = '%s:' % origdir + ## MFINPUTS/TFMFONTS take kpathsea specific values; + ## we should analyse them any further. os.environ['MFINPUTS'] = '%s:%s' % (origdir, getenv ('MFINPUTS', '')) os.environ['TFMFONTS'] = '%s:%s' % (origdir, getenv ('TFMINPUTS', '')) - # FIXME: we should not change to another (tmp) dir? - # or else make all relavitive dirs in paths absolute. - def abs_dir (x, dir): - if x and os.path.abspath (x) != x: - return os.path.join (dir, x) - return x - - def abs_path (path, dir): - # Python's ABSPATH means ABSDIR - dir = os.path.abspath (dir) - return string.join (map (lambda x: abs_dir (x, dir), - string.split (path, - os.pathsep)), - os.pathsep) - - os.environ['MFINPUTS'] = abs_path (os.environ['MFINPUTS'], - origdir) - os.environ['TFMFONTS'] = abs_path (os.environ['TFMFONTS'], - origdir) - progress (_ ("Running Metafont...")) cmdstr = r"mf '\mode:=lexmarks; mag:=%f; nonstopmode; input %s'" % (mag, filename) -- 2.11.4.GIT