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();
|
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();
|
|
||||||
if (face_height > 0) {
|
|
||||||
double current_height = m_feng.height();
|
double current_height = m_feng.height();
|
||||||
m_feng.height(1.0);
|
m_feng.height(1.0);
|
||||||
ascender = m_feng.ascender();
|
ascender = m_feng.ascender();
|
||||||
descender = m_feng.descender();
|
descender = m_feng.descender();
|
||||||
m_feng.height(current_height);
|
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();
|
||||||
|
|
Loading…
Reference in New Issue