From da4c7e7ed675c3bf405668739c3012d140856109 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 15 May 2024 05:34:42 +0200 Subject: Adding upstream version 126.0. Signed-off-by: Daniel Baumann --- gfx/thebes/gfxFont.cpp | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'gfx/thebes/gfxFont.cpp') diff --git a/gfx/thebes/gfxFont.cpp b/gfx/thebes/gfxFont.cpp index 618eb49455..c17e786d4f 100644 --- a/gfx/thebes/gfxFont.cpp +++ b/gfx/thebes/gfxFont.cpp @@ -729,15 +729,6 @@ void gfxShapedText::SetupClusterBoundaries(uint32_t aOffset, // preceding letter by any letter-spacing or justification. const char16_t kBengaliVirama = 0x09CD; const char16_t kBengaliYa = 0x09AF; - // Characters treated as hyphens for the purpose of "emergency" breaking - // when the content would otherwise overflow. - auto isHyphen = [](char16_t c) { - return c == char16_t('-') || // HYPHEN-MINUS - c == 0x2010 || // HYPHEN - c == 0x2012 || // FIGURE DASH - c == 0x2013 || // EN DASH - c == 0x058A; // ARMENIAN HYPHEN - }; bool prevWasHyphen = false; while (pos < aLength) { const char16_t ch = aString[pos]; @@ -750,7 +741,7 @@ void gfxShapedText::SetupClusterBoundaries(uint32_t aOffset, } if (ch == char16_t(' ') || ch == kIdeographicSpace) { glyphs[pos].SetIsSpace(); - } else if (isHyphen(ch) && pos && + } else if (nsContentUtils::IsHyphen(ch) && pos && nsContentUtils::IsAlphanumeric(aString[pos - 1])) { prevWasHyphen = true; } else if (ch == kBengaliYa) { @@ -1006,6 +997,10 @@ gfxFont::gfxFont(const RefPtr& aUnscaledFont, } 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() { -- cgit v1.2.3