2 kpath.cc -- glue kpathsea to lily. Need some ugly kludges for gcc 2.96
4 source file of the GNU LilyPond music typesetter
6 (c) 2000--2001 Han-Wen Nienhuys <hanwen@cs.uu.nl>
14 #define popen REALLYUGLYKLUDGE
15 #define pclose ANOTHERREALLYUGLYKLUDGE
17 #if HAVE_KPATHSEA_KPATHSEA_H
19 #include <kpathsea/kpathsea.h>
20 #include <kpathsea/tex-file.h>
24 #include "file-path.hh"
28 #include "lily-version.hh"
32 ly_find_afm (char const * name)
34 #if (KPATHSEA && HAVE_KPSE_FIND_FILE)
35 return kpse_find_file (name, kpse_afm_format, true);
41 ly_find_tfm (char const * name)
43 String p = global_path.find (String (name) + ".tfm");
48 #if (KPATHSEA && HAVE_KPSE_FIND_FILE)
49 return kpse_find_file (name, kpse_tfm_format, true);
56 ly_init_kpath (char *av0)
58 #if KPATHSEA && HAVE_KPATHSEA_KPATHSEA_H
60 We take two pronged approach to tfms:
62 * the lilypond tfms (feta*.tfm) are found through our own routines.
64 * the TeX tfms are found through vanilla kpathsea.
66 (* other TFMs are not found, i.e. don't use them. )
70 - TFM and AFM checksums always match in Lily.
72 - less hassle, no kpathsea spaghetti
76 - feta PK files are often recreated, locally
77 Solution: cache PK files locally?
79 - need env. vars to make sure that TeX finds the TFMs
81 - Outdated PK (TFM?) font files are not automatically removed,
82 since VERSION is not part of the standard location.
87 we have tried to come up with schemes that leave this kind of work
88 to kpathsea with objective of fixing the CONs, but miserably
89 failed. TeX installations and kpathsea itself form a buggy,
90 inconsistent, and unorderly mess.
97 kpse_set_program_name (av0, NULL);
98 kpse_maketex_option ("tfm", TRUE);