+ restore family-name + style key

This commit is contained in:
artemp 2013-07-25 13:23:03 +01:00
parent 2b7340ca2c
commit 4d6cc61ec1

View file

@ -104,7 +104,8 @@ bool freetype_engine::register_font(std::string const& file_name)
// some font files have multiple fonts in a file
// the count is in the 'root' face library[0]
// see the FT_FaceRec in freetype.h
for ( int i = 0; face == 0 || i < num_faces; i++ ) {
for ( int i = 0; face == 0 || i < num_faces; i++ )
{
// if face is null then this is the first face
error = FT_New_Face (library,file_name.c_str(),i,&face);
if (error)
@ -118,7 +119,7 @@ bool freetype_engine::register_font(std::string const& file_name)
// http://www.freetype.org/freetype2/docs/reference/ft2-base_interface.html#FT_FaceRec
if (face->family_name && face->style_name)
{
std::string name = std::string(face->family_name) + "-" + std::string(face->style_name);
std::string name = std::string(face->family_name) + " " + std::string(face->style_name);
// skip fonts with leading . in the name
if (!boost::algorithm::starts_with(name,"."))
{