compute Font advance from that of "x" glyph

This commit is contained in:
Josh Holtrop 2014-06-23 14:26:48 -04:00
parent 91e6988fce
commit da73f62845

View File

@ -31,6 +31,14 @@ namespace jes
m_line_height = round_up_26_6(m_face->size->metrics.height); m_line_height = round_up_26_6(m_face->size->metrics.height);
GlyphRef x_glyph = load_glyph('x');
if (x_glyph.is_null())
{
std::cerr << "Could not load 'x' glyph from font" << fname << std::endl;
return false;
}
m_advance = x_glyph->get_advance();
m_loaded = true; m_loaded = true;
return true; return true;
} }