Bug 619521 - Part 3: Send a notification for missing math fonts. r=jkitch

This commit is contained in:
Frédéric Wang 2014-11-11 02:37:00 -05:00
parent b77ae133f8
commit b60cd30c4b
2 changed files with 13 additions and 0 deletions

View File

@ -13,6 +13,7 @@
#include "nsTextFrameUtils.h"
#include "nsFontMetrics.h"
#include "nsDeviceContext.h"
#include "nsUnicodeScriptCodes.h"
using namespace mozilla;
@ -678,6 +679,9 @@ MathMLTextRunFactory::RebuildTextRun(nsTransformedTextRun* aTextRun,
} else {
// We fallback to the original character.
ch2 = ch;
if (aMFR) {
aMFR->RecordScript(MOZ_SCRIPT_MATHEMATICAL_NOTATION);
}
}
}
}

View File

@ -37,6 +37,7 @@
#include <algorithm>
#include "gfxMathTable.h"
#include "nsUnicodeScriptCodes.h"
using namespace mozilla;
using namespace mozilla::gfx;
@ -1694,6 +1695,14 @@ nsMathMLChar::StretchInternal(nsPresContext* aPresContext,
return NS_OK;
}
// We did not find a size variant or a glyph assembly to stretch this
// operator. Verify whether a font with an OpenType MATH table is available
// and record missing math script otherwise.
gfxMissingFontRecorder* MFR = aPresContext->MissingFontRecorder();
if (MFR && !fm->GetThebesFontGroup()->GetFirstMathFont()) {
MFR->RecordScript(MOZ_SCRIPT_MATHEMATICAL_NOTATION);
}
// stretchy character
if (stretchy) {
if (isVertical) {