mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
MakeSpaceTextRun() should short-circuit zero-sized fonts. b=407352 r+sr=roc a=dsicore
This commit is contained in:
parent
a90c543b46
commit
60f971e921
@ -86,6 +86,8 @@ public:
|
||||
|
||||
// Get the glyphID of a space
|
||||
virtual PRUint32 GetSpaceGlyph() {
|
||||
NS_ASSERTION(GetStyle()->size != 0,
|
||||
"forgot to short-circuit a text run with zero-sized font?");
|
||||
GetMetrics();
|
||||
return mSpaceGlyph;
|
||||
}
|
||||
|
@ -860,7 +860,15 @@ gfxFontGroup::MakeSpaceTextRun(const Parameters *aParams, PRUint32 aFlags)
|
||||
return nsnull;
|
||||
|
||||
gfxFont *font = GetFontAt(0);
|
||||
textRun->SetSpaceGlyph(font, aParams->mContext, 0);
|
||||
if (NS_UNLIKELY(GetStyle()->size == 0)) {
|
||||
// Short-circuit for size-0 fonts, as Windows and ATSUI can't handle
|
||||
// them, and always create at least size 1 fonts, i.e. they still
|
||||
// render something for size 0 fonts.
|
||||
textRun->AddGlyphRun(font, 0);
|
||||
}
|
||||
else {
|
||||
textRun->SetSpaceGlyph(font, aParams->mContext, 0);
|
||||
}
|
||||
// Note that the gfxGlyphExtents glyph bounds storage for the font will
|
||||
// always contain an entry for the font's space glyph, so we don't have
|
||||
// to call FetchGlyphExtents here.
|
||||
|
Loading…
Reference in New Issue
Block a user