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>
15 #define popen REALLYUGLYKLUDGE
16 #define pclose ANOTHERREALLYUGLYKLUDGE
18 #if HAVE_KPATHSEA_KPATHSEA_H
20 #include <kpathsea/kpathsea.h>
21 #include <kpathsea/tex-file.h>
26 #include "lily-version.hh"
30 ly_find_afm (char const * name)
32 #if (KPATHSEA && HAVE_KPSE_FIND_FILE)
33 return kpse_find_file (name, kpse_afm_format, true);
39 ly_find_tfm (char const * name)
41 #if (KPATHSEA && HAVE_KPSE_FIND_FILE)
42 return kpse_find_file (name, kpse_tfm_format, true);
49 ly_init_kpath (char *av0)
51 #if KPATHSEA && HAVE_KPATHSEA_KPATHSEA_H
54 Remove the setting for TFMFONTS if we have kpathsea, because
55 kpathsea can find TFM fonts anyway.
57 If we don't lily will want to make tfms for cmr fonts, even if
58 there is a :: entry in the TFMFONTS path.
60 This will fail if a user has special fonts (outside of feta) that
61 can not be found by kpath.
63 If TFMFONTS is unset, TFMs of feta will be generated on the
64 fly. The risk is that this will cause checksum mismatch errors,
65 but MF is reasonably deterministic (so we hope not).
67 The advantage is that the PK font will also be generated under
68 /var/texmf/fonts, reducing clutter and compilation time.
71 #ifndef __CYGWIN__ /* mktextfm/mktexpk does not work on windows */
73 unsetenv ("TFMFONTS");
80 kpse_set_program_name (av0, NULL);
81 kpse_maketex_option ("tfm", TRUE);
84 String my_tfm = "$VARTEXFONTS/tfm/public/lilypond";
86 String my_tfm = "$VARTEXFONTS/tfm/lilypond/";
87 my_tfm += version_str () + "/";
90 char * mypath = kpse_expand ((my_tfm + ":").ch_C ());
92 String prog = "mktextfm --destdir ";
95 kpse_format_info[kpse_tfm_format].program = strdup (prog.ch_C ());
97 kpse_format_info[kpse_tfm_format].client_path = mypath;