#include "scm-hash.hh"
#include "kpath.hh"
-
-
-
-
-const char * default_font_sz_ = "cmr10";
+static const char * default_font_sz_ = "cmr10";
All_font_metrics::All_font_metrics (String path)
{
if (verbose_global_b)
progress_indication ("[" + path);
val = read_afm_file (path);
-
+ unsmob_metrics (val)->path_ = path;
+
unsmob_metrics (val)->description_ = gh_cons (name_str, gh_double2scm (1.0));
if (verbose_global_b)
if (tfm->info_.checksum != afm->checksum_)
{
- String s = _f ("checksum mismatch for font file: `%s'", path.ch_C ());
- s+= "\n";
+ String s = _f ("checksum mismatch for font file:\n`%s'", path.ch_C ());
+ s += " " + _f ("does not match: `%s'", tfm->path_.ch_C()); // FIXME
+ s += "\n";
s += " TFM: " + to_str ((int) tfm->info_.checksum);
s += " AFM: " + to_str ((int) afm->checksum_);
s += "\n";
if (path.empty_b())
return 0;
+
if (verbose_global_b)
progress_indication ("[" + path);
val = Tex_font_metric::make_tfm (path);
+
if (verbose_global_b)
progress_indication ("]");
+ unsmob_metrics (val)->path_ = path;
unsmob_metrics (val)->description_ = gh_cons (name_str, gh_double2scm (1.0));
tfm_p_dict_->set (sname, val);
scm_unprotect_object (val);
}
-
+
return
dynamic_cast<Tex_font_metric*> (unsmob_metrics (val));
}
warning (_ ("Loading default font"));
String def_name = default_font_sz_;
- SCM l = scm_assoc (ly_str02scm ("default"),
- scm_eval2 (ly_symbol2scm ("cmr-alist"), SCM_EOL));
-
- if (l != SCM_BOOL_F)
- def_name = ly_scm2string (gh_cdr (l));
+ /*
+ we're in emergency recovery mode here anyway, so don't try to do
+ anything smart that runs the risk of failing. */
f= find_afm (def_name);
if (f)
return f;