if a directory is not passed to register_fonts, then assume it is a font file and try registering it

This commit is contained in:
Dane Springmeyer 2011-01-11 00:15:57 +00:00
parent 2fa027855a
commit e0a765429f

View file

@ -88,7 +88,13 @@ bool freetype_engine::register_font(std::string const& file_name)
bool freetype_engine::register_fonts(std::string const& dir, bool recurse)
{
boost::filesystem::path path(dir);
if (!boost::filesystem::exists(path) || !boost::filesystem::is_directory(path)) return false;
if (!boost::filesystem::exists(path))
return false;
if (!boost::filesystem::is_directory(path))
return mapnik::freetype_engine::register_font(dir);
boost::filesystem::directory_iterator end_itr;
for (boost::filesystem::directory_iterator itr(dir); itr != end_itr; ++itr)
{