mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
b=480507, don't crash if no fonts found in Windows font family; r+sr=vlad
This commit is contained in:
parent
f4c8ebe128
commit
3898e3ebbd
@ -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);
|
||||
|
||||
|
@ -191,6 +191,9 @@ gfxWindowsPlatform::HashEnumFunc(nsStringHashKey::KeyType aKey,
|
||||
gfxFontStyle style;
|
||||
style.langGroup = data->mLangGroup;
|
||||
nsRefPtr<FontEntry> 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<FontEntry> 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
|
||||
|
Loading…
Reference in New Issue
Block a user