+ c++ style
This commit is contained in:
parent
218aca2159
commit
cdee64709b
1 changed files with 6 additions and 6 deletions
|
@ -61,7 +61,7 @@ freetype_engine::~freetype_engine()
|
|||
|
||||
bool freetype_engine::is_font_file(std::string const& file_name)
|
||||
{
|
||||
/** only accept files that will be matched by freetype2's `figurefiletype()` */
|
||||
// only accept files that will be matched by freetype2's `figurefiletype()`
|
||||
std::string fn = file_name;
|
||||
std::transform(fn.begin(), fn.end(), fn.begin(), ::tolower);
|
||||
return boost::algorithm::ends_with(fn,std::string(".ttf")) ||
|
||||
|
@ -70,7 +70,7 @@ bool freetype_engine::is_font_file(std::string const& file_name)
|
|||
boost::algorithm::ends_with(fn,std::string(".pfa")) ||
|
||||
boost::algorithm::ends_with(fn,std::string(".pfb")) ||
|
||||
boost::algorithm::ends_with(fn,std::string(".ttc")) ||
|
||||
/** Plus OSX custom ext */
|
||||
// Plus OSX custom ext
|
||||
boost::algorithm::ends_with(fn,std::string(".dfont"));
|
||||
}
|
||||
|
||||
|
@ -234,8 +234,8 @@ stroker_ptr freetype_engine::create_stroker()
|
|||
char_info font_face_set::character_dimensions(unsigned int c)
|
||||
{
|
||||
//Check if char is already in cache
|
||||
std::map<unsigned, char_info>::const_iterator itr;
|
||||
itr = dimension_cache_.find(c);
|
||||
typedef std::map<unsigned, char_info>::const_iterator iterator_type;
|
||||
iterator_type itr = dimension_cache_.find(c);
|
||||
if (itr != dimension_cache_.end())
|
||||
{
|
||||
return itr->second;
|
||||
|
@ -274,8 +274,8 @@ char_info font_face_set::character_dimensions(unsigned int c)
|
|||
|
||||
unsigned tempx = face->glyph->advance.x >> 6;
|
||||
|
||||
char_info dim(c, tempx, glyph_bbox.yMax, glyph_bbox.yMin, face->size->metrics.height/64.0 /* >> 6 */);
|
||||
dimension_cache_.insert(std::pair<unsigned, char_info>(c, dim));
|
||||
char_info dim(c, tempx, glyph_bbox.yMax, glyph_bbox.yMin, face->size->metrics.height/64.0);
|
||||
dimension_cache_.insert(std::make_pair(c, dim));
|
||||
return dim;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue