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"
32 ly_find_afm (char const * name)
34 #if (KPATHSEA && HAVE_KPSE_FIND_FILE)
35 char * name_ptr = kpse_find_file (name, kpse_afm_format, true);
40 don't mutter about afms, since we try to find them first, and lots of
43 // warning (_f("kpathsea couldn't find AFM file `%s'", name));
53 ly_find_tfm (char const * name)
55 String p = global_path.find (String (name) + ".tfm");
60 #if (KPATHSEA && HAVE_KPSE_FIND_FILE)
61 char * name_ptr = kpse_find_file (name, kpse_tfm_format, true);
64 warning (_f("Kpathsea couldn't find TFM file `%s'", name));
75 ly_init_kpath (char *av0)
77 #if KPATHSEA && HAVE_KPATHSEA_KPATHSEA_H
79 We take two pronged approach to tfms:
81 * the lilypond tfms (feta*.tfm) are found through our own routines.
83 * the TeX tfms are found through vanilla kpathsea.
85 (* other TFMs are not found, i.e. don't use them. )
89 - TFM and AFM checksums always match in Lily.
91 - less hassle, no kpathsea spaghetti
95 - feta PK files are often recreated, locally
96 Solution: cache PK files locally?
98 - need env. vars to make sure that TeX finds the TFMs
100 - Outdated PK (TFM?) font files are not automatically removed,
101 since VERSION is not part of the standard location.
106 we have tried to come up with schemes that leave this kind of work
107 to kpathsea with objective of fixing the CONs, but miserably
108 failed. TeX installations and kpathsea itself form a buggy,
109 inconsistent, and unorderly mess.
116 kpse_set_program_name (av0, NULL);
117 kpse_maketex_option ("tfm", TRUE);