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--2002 Han-Wen Nienhuys <hanwen@cs.uu.nl>
14 #define popen REALLYUGLYKLUDGE
15 #define pclose ANOTHERREALLYUGLYKLUDGE
16 #define getopt YAKLUDGE
18 #if HAVE_KPATHSEA_KPATHSEA_H
20 #include <kpathsea/kpathsea.h>
21 #include <kpathsea/tex-file.h>
25 #include "file-path.hh"
29 #include "lily-version.hh"
33 ly_find_afm (char const * name)
35 #if (KPATHSEA && HAVE_KPSE_FIND_FILE)
36 char * name_ptr = kpse_find_file (name, kpse_afm_format, true);
41 don't mutter about afms, since we try to find them first, and lots of
44 // warning (_f("kpathsea couldn't find AFM file `%s'", name));
54 ly_find_tfm (char const * name)
56 String p = global_path.find (String (name) + ".tfm");
61 #if (KPATHSEA && HAVE_KPSE_FIND_FILE)
62 char * name_ptr = kpse_find_file (name, kpse_tfm_format, true);
65 warning (_f("Kpathsea couldn't find TFM file `%s'", name));
76 ly_init_kpath (char *av0)
78 #if KPATHSEA && HAVE_KPATHSEA_KPATHSEA_H
80 We take two pronged approach to tfms:
82 * the lilypond tfms (feta*.tfm) are found through our own routines.
84 * the TeX tfms are found through vanilla kpathsea.
86 (* other TFMs are not found, i.e. don't use them. )
90 - TFM and AFM checksums always match in Lily.
92 - less hassle, no kpathsea spaghetti
96 - feta PK files are often recreated, locally
97 Solution: cache PK files locally?
99 - need env. vars to make sure that TeX finds the TFMs
101 - Outdated PK (TFM?) font files are not automatically removed,
102 since VERSION is not part of the standard location.
107 we have tried to come up with schemes that leave this kind of work
108 to kpathsea with objective of fixing the CONs, but miserably
109 failed. TeX installations and kpathsea itself form a buggy,
110 inconsistent, and unorderly mess.
117 kpse_set_program_name (av0, NULL);
118 kpse_maketex_option ("tfm", TRUE);