#include "lily-guile.hh"
#include "tfm-reader.hh"
+extern "C" {
+#include <kpathsea/kpathsea.h>
+}
+
const char * default_font_sz_ = "cmr10";
All_font_metrics::All_font_metrics (String path)
SCM sname = ly_symbol2scm (name.ch_C ());
if (!afm_p_dict_.elem_b (sname))
{
- String path = name + ".afm";
- path = search_path_.find (path);
+ String path;
if (path.empty_b ())
+ {
+ char * p = kpse_find_file(name.ch_C(), kpse_afm_format, true);
+ if (p)
+ path = p;
+ }
+
+ if (path.empty_b())
+ path = search_path_.find (name + ".afm");
+ if (path.empty_b())
return 0;
-
+
if (verbose_global_b)
progress_indication ("[" + path);
Adobe_font_metric * afm_p = read_afm_file (path);
SCM sname = ly_symbol2scm (name.ch_C ());
if (!tfm_p_dict_.elem_b (sname))
{
- String path = name + ".tfm";
- path = search_path_.find (path);
- if (path.empty_b ())
+ String path;
+
+ if (path.empty_b())
+ {
+ char * p = kpse_find_tfm(name.ch_C());
+ path = p;
+ }
+ if (path.empty_b())
+ path = search_path_.find (name + ".tfm");
+ if (path.empty_b())
return 0;
+
if (verbose_global_b)
progress_indication ("[" + path);
Tex_font_metric * tfm_p = Tex_font_metric_reader::read_file (path);