3 #include "all-fonts.hh"
8 const char * default_font_sz_
= "cmr10";
12 All_font_metrics::All_font_metrics (String path
)
14 search_path_
.parse_path (path
);
16 String f
= default_font_sz_
+ String (".afm");
17 f
= search_path_
.find (f
);
19 error (_f("Can't find default font (PATH = %s)", path
));
22 afm_p_dict_
[default_font_sz_
] = new Adobe_font_metric (read_afm_file (f
));
26 All_font_metrics::find_font (String name
)
28 if (!afm_p_dict_
.elem_b (name
))
30 String path
= name
+ ".afm";
31 path
= search_path_
.find (path
);
34 warning (_f ("Can't find `%s'", name
));
35 return afm_p_dict_
[default_font_sz_
];
40 * afm_p
= new Adobe_font_metric (read_afm_file (path
));
41 *mlog
<< "]" << flush
;
43 afm_p_dict_
[name
] = afm_p
;
46 return afm_p_dict_
[name
];