Remove unneeded checks in get_font_vmetrics
This commit is contained in:
parent
bddc947b99
commit
ba4c8dbbb5
|
@ -52,18 +52,13 @@ public:
|
|||
return m_feng.face_height();
|
||||
}
|
||||
|
||||
bool get_font_vmetrics(double& ascender, double& descender) {
|
||||
int face_height = m_feng.face_height();
|
||||
if (face_height > 0) {
|
||||
void get_font_vmetrics(double& ascender, double& descender) {
|
||||
double current_height = m_feng.height();
|
||||
m_feng.height(1.0);
|
||||
ascender = m_feng.ascender();
|
||||
descender = m_feng.descender();
|
||||
m_feng.height(current_height);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
float scale_for_em_to_pixels(float size) {
|
||||
int units_per_em = m_feng.face_units_em();
|
||||
|
|
Loading…
Reference in New Issue