From 198bbca1c1ea320c8c8f5d6f03a029b8cd662031 Mon Sep 17 00:00:00 2001 From: Robert O'Callahan Date: Wed, 19 Nov 2014 22:41:42 +1300 Subject: [PATCH] Bug 1099977. Part 1.5: Make gfxFT2FontBase::GetSpaceGlyph work for zero-sized fonts. r=jfkthame --HG-- extra : rebase_source : 41fe8ce9c751d4ffcfa3adb001640c60d1f4c449 --- gfx/thebes/gfxFT2FontBase.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/gfx/thebes/gfxFT2FontBase.cpp b/gfx/thebes/gfxFT2FontBase.cpp index e8b53b7a976..fc76c1ee552 100644 --- a/gfx/thebes/gfxFT2FontBase.cpp +++ b/gfx/thebes/gfxFT2FontBase.cpp @@ -116,7 +116,7 @@ gfxFT2FontBase::GetHorizontalMetrics() if (MOZ_UNLIKELY(GetStyle()->size <= 0.0)) { new(&mMetrics) gfxFont::Metrics(); // zero initialize - mSpaceGlyph = 0; + mSpaceGlyph = GetGlyph(' '); } else { gfxFT2LockedFace face(this); face.GetMetrics(&mMetrics, &mSpaceGlyph); @@ -144,8 +144,6 @@ gfxFT2FontBase::GetHorizontalMetrics() uint32_t gfxFT2FontBase::GetSpaceGlyph() { - NS_ASSERTION(GetStyle()->size != 0, - "forgot to short-circuit a text run with zero-sized font?"); GetHorizontalMetrics(); return mSpaceGlyph; }