3 #include "all-fonts.hh"
9 const char * default_font_sz_ = "cmr10";
13 All_font_metrics::All_font_metrics (String path)
15 search_path_.parse_path (path);
20 All_font_metrics::find_afm (String name)
22 if (!afm_p_dict_.elem_b (name))
24 String path = name + ".afm";
25 path = search_path_.find (path);
31 * afm_p = new Adobe_font_metric (read_afm_file (path));
32 *mlog << "]" << flush ;
34 afm_p_dict_[name] = afm_p;
36 return afm_p_dict_[name];
40 All_font_metrics::find_tfm (String name)
42 if (!tfm_p_dict_.elem_b (name))
44 String path = name + ".tfm";
45 path = search_path_.find (path);
50 Tex_font_metric * tfm_p = new Tex_font_metric;
51 tfm_p->read_file (path);
52 *mlog << "]" << flush ;
54 tfm_p_dict_[name] = tfm_p;
56 return tfm_p_dict_[name];
61 All_font_metrics::find_font (String name)
63 Font_metric * f= find_afm (name);
71 f = find_tfm (default_font_sz_);
74 String s = _f("Can't find default font `%s\', giving up.", default_font_sz_);
75 s += String ("\n") + _f ("search path = %s", search_path_.str ());