Remove unneeded checks in get_font_vmetrics

This commit is contained in:
Francesco Abbate 2020-06-08 09:34:17 +02:00
parent bddc947b99
commit ba4c8dbbb5
1 changed files with 7 additions and 12 deletions

View File

@ -52,18 +52,13 @@ public:
return m_feng.face_height(); return m_feng.face_height();
} }
bool get_font_vmetrics(double& ascender, double& descender) { void get_font_vmetrics(double& ascender, double& descender) {
int face_height = m_feng.face_height(); double current_height = m_feng.height();
if (face_height > 0) { m_feng.height(1.0);
double current_height = m_feng.height(); ascender = m_feng.ascender();
m_feng.height(1.0); descender = m_feng.descender();
ascender = m_feng.ascender(); m_feng.height(current_height);
descender = m_feng.descender(); }
m_feng.height(current_height);
return true;
}
return false;
}
float scale_for_em_to_pixels(float size) { float scale_for_em_to_pixels(float size) {
int units_per_em = m_feng.face_units_em(); int units_per_em = m_feng.face_units_em();