diff --git a/gfx/thebes/src/gfxWindowsFonts.cpp b/gfx/thebes/src/gfxWindowsFonts.cpp index 5dbb6dbd434..bc405e37428 100644 --- a/gfx/thebes/src/gfxWindowsFonts.cpp +++ b/gfx/thebes/src/gfxWindowsFonts.cpp @@ -280,6 +280,14 @@ FontFamily::FindStyleVariations() faspd.ff = this; EnumFontFamiliesExW(hdc, &logFont, (FONTENUMPROCW)FontFamily::FamilyAddStylesProc, (LPARAM)&faspd, 0); +#ifdef DEBUG + if (mVariations.Length() == 0) { + char msgBuf[256]; + (void)sprintf(msgBuf, "no styles available in family \"%s\"", + NS_ConvertUTF16toUTF8(mName).get()); + NS_ASSERTION(mVariations.Length() != 0, msgBuf); + } +#endif ReleaseDC(nsnull, hdc); diff --git a/gfx/thebes/src/gfxWindowsPlatform.cpp b/gfx/thebes/src/gfxWindowsPlatform.cpp index 1546ce0168d..6a120b4adcf 100644 --- a/gfx/thebes/src/gfxWindowsPlatform.cpp +++ b/gfx/thebes/src/gfxWindowsPlatform.cpp @@ -191,6 +191,9 @@ gfxWindowsPlatform::HashEnumFunc(nsStringHashKey::KeyType aKey, gfxFontStyle style; style.langGroup = data->mLangGroup; nsRefPtr aFontEntry = aFontFamily->FindFontEntry(style); + NS_ASSERTION(aFontEntry, "couldn't find any font entry in family"); + if (!aFontEntry) + return PL_DHASH_NEXT; #ifndef MOZ_FT2_FONTS @@ -549,6 +552,10 @@ gfxWindowsPlatform::FindFontForCharProc(nsStringHashKey::KeyType aKey, const PRUint32 ch = data->ch; nsRefPtr fe = aFontFamily->FindFontEntry(*data->fontToMatch->GetStyle()); + NS_ASSERTION(fe, "couldn't find any font entry in family"); + if (!fe) + return PL_DHASH_NEXT; + PRInt32 rank = 0; #ifndef MOZ_FT2_FONTS