mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
bug 553963 - part 2 - make gfxFont handle text-shaping failure more robustly. r=roc
This commit is contained in:
parent
c8f4d990c1
commit
ab84e170d2
@ -2235,17 +2235,19 @@ gfxFontGroup::InitTextRun(gfxContext *aContext,
|
||||
PRUint32 matchedLength = range.Length();
|
||||
gfxFont *matchedFont = (range.font ? range.font.get() : nsnull);
|
||||
|
||||
if (matchedFont) {
|
||||
// create the glyph run for this range
|
||||
aTextRun->AddGlyphRun(matchedFont, runStart, (matchedLength > 0));
|
||||
|
||||
aTextRun->AddGlyphRun(matchedFont ? matchedFont : mainFont,
|
||||
runStart, (matchedLength > 0));
|
||||
if (matchedFont) {
|
||||
// do glyph layout and record the resulting positioned glyphs
|
||||
matchedFont->InitTextRun(aContext, aTextRun, aString,
|
||||
runStart, matchedLength, aRunScript);
|
||||
} else {
|
||||
// create the glyph run before calling SetMissing Glyph
|
||||
aTextRun->AddGlyphRun(mainFont, runStart, matchedLength);
|
||||
|
||||
if (!matchedFont->InitTextRun(aContext, aTextRun, aString,
|
||||
runStart, matchedLength,
|
||||
aRunScript)) {
|
||||
// glyph layout failed! treat as missing glyphs
|
||||
matchedFont = nsnull;
|
||||
}
|
||||
}
|
||||
if (!matchedFont) {
|
||||
for (PRUint32 index = runStart; index < runStart + matchedLength; index++) {
|
||||
// Record the char code so we can draw a box with the Unicode value
|
||||
if (NS_IS_HIGH_SURROGATE(aString[index]) &&
|
||||
|
Loading…
Reference in New Issue
Block a user