mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-18 14:56:07 +00:00
[OS/2] Bug 490390: fix crash with broken Wingdings font, r=wuno@lsvw
This commit is contained in:
parent
859edfecf4
commit
5e65fbeecb
@ -118,6 +118,11 @@ const gfxFont::Metrics& gfxOS2Font::GetMetrics()
|
||||
return *mMetrics;
|
||||
}
|
||||
|
||||
// whatever happens below, we can always create the metrics
|
||||
mMetrics = new gfxFont::Metrics;
|
||||
mMetrics->emHeight = GetStyle()->size;
|
||||
mSpaceGlyph = 0;
|
||||
|
||||
FT_Face face = cairo_ft_scaled_font_lock_face(CairoScaledFont());
|
||||
if (!face) {
|
||||
// Abort here already, otherwise we crash in the following
|
||||
@ -133,9 +138,6 @@ const gfxFont::Metrics& gfxOS2Font::GetMetrics()
|
||||
return *mMetrics;
|
||||
}
|
||||
|
||||
mMetrics = new gfxFont::Metrics;
|
||||
mMetrics->emHeight = GetStyle()->size;
|
||||
|
||||
double emUnit = 1.0 * face->units_per_EM;
|
||||
double xScale = face->size->metrics.x_ppem / emUnit;
|
||||
double yScale = face->size->metrics.y_ppem / emUnit;
|
||||
|
Loading…
x
Reference in New Issue
Block a user