X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fkpath.cc;h=c1d2bffaa0aae38e2bb888e1f2c9e630a8b6d9d7;hb=ae5a370dcfeb1da2bb99a1c1143514d51bb9b707;hp=d97cacba31ddb6b70921a21bf24768dbd891c300;hpb=9f47f5726909af0b99bf38880f330e79c4682710;p=lilypond.git diff --git a/lily/kpath.cc b/lily/kpath.cc index d97cacba31..c1d2bffaa0 100644 --- a/lily/kpath.cc +++ b/lily/kpath.cc @@ -3,7 +3,7 @@ source file of the GNU LilyPond music typesetter - (c) 2000--2001 Han-Wen Nienhuys + (c) 2000--2002 Han-Wen Nienhuys */ #include @@ -13,6 +13,7 @@ #define popen REALLYUGLYKLUDGE #define pclose ANOTHERREALLYUGLYKLUDGE +#define getopt YAKLUDGE #if HAVE_KPATHSEA_KPATHSEA_H extern "C" { @@ -25,15 +26,28 @@ extern "C" { #include "string.hh" #include "main.hh" #include "kpath.hh" +#include "lily-version.hh" +#include "warn.hh" - -char * +String ly_find_afm (char const * name) { #if (KPATHSEA && HAVE_KPSE_FIND_FILE) - return kpse_find_file (name, kpse_afm_format, true); + char * name_ptr = kpse_find_file (name, kpse_afm_format, true); + + if(!name_ptr) + { + /* + don't mutter about afms, since we try to find them first, and lots of + TFMs don't have AFMs. + */ + // warning (_f("kpathsea couldn't find AFM file `%s'", name)); + } + else + return name_ptr; + #endif - return 0; + return ""; } String @@ -45,7 +59,14 @@ ly_find_tfm (char const * name) return p; #if (KPATHSEA && HAVE_KPSE_FIND_FILE) - return kpse_find_file (name, kpse_tfm_format, true); + char * name_ptr = kpse_find_file (name, kpse_tfm_format, true); + if(!name_ptr) + { + warning (_f("Kpathsea couldn't find TFM file `%s'", name)); + } + else + return name_ptr; + #endif return ""; }