diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:34:42 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:34:42 +0000 |
commit | da4c7e7ed675c3bf405668739c3012d140856109 (patch) | |
tree | cdd868dba063fecba609a1d819de271f0d51b23e /gfx/thebes/gfxFont.cpp | |
parent | Adding upstream version 125.0.3. (diff) | |
download | firefox-da4c7e7ed675c3bf405668739c3012d140856109.tar.xz firefox-da4c7e7ed675c3bf405668739c3012d140856109.zip |
Adding upstream version 126.0.upstream/126.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'gfx/thebes/gfxFont.cpp')
-rw-r--r-- | gfx/thebes/gfxFont.cpp | 15 |
1 files changed, 5 insertions, 10 deletions
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<UnscaledFont>& 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() { |