[gfx] Ensure font entry's unitsPerEm and font extents are initialized when gfxFont is created.

This commit is contained in:
Moonchild 2024-05-21 14:10:27 +02:00 • committed by roytam1
commit 7672f932f7

View file

@ -860,6 +860,10 @@ gfxFont::gfxFont(gfxFontEntry *aFontEntry, const gfxFontStyle *aFontStyle,
++gFontCount; ++gFontCount;
#endif #endif
mKerningSet = HasFeatureSet(HB_TAG('k','e','r','n'), mKerningEnabled); mKerningSet = HasFeatureSet(HB_TAG('k','e','r','n'), mKerningEnabled);
// Ensure the gfxFontEntry's unitsPerEm and extents fields are initialized,
// so that GetFontExtents can use them without risk of races.
Unused << mFontEntry->UnitsPerEm();
} }
gfxFont::~gfxFont() gfxFont::~gfxFont()