зеркало из https://github.com/mozilla/gecko-dev.git
Bug 412859. Use the first group font instead of the previous font when doing system-wide font fallback. r+sr=roc
This commit is contained in:
Родитель
c44704e328
Коммит
dea5368f3f
|
@ -805,7 +805,7 @@ gfxAtsuiFontGroup::FindFontForChar(PRUint32 aCh, PRUint32 aPrevCh, PRUint32 aNex
|
||||||
if (!selectedFont) {
|
if (!selectedFont) {
|
||||||
FontEntry *fe;
|
FontEntry *fe;
|
||||||
|
|
||||||
fe = gfxQuartzFontCache::SharedFontCache()->FindFontForChar(aCh, aPrevMatchedFont);
|
fe = gfxQuartzFontCache::SharedFontCache()->FindFontForChar(aCh, GetFontAt(0));
|
||||||
if (fe) {
|
if (fe) {
|
||||||
selectedFont = FindFontFor(fe->GetFontID());
|
selectedFont = FindFontFor(fe->GetFontID());
|
||||||
return selectedFont.forget();
|
return selectedFont.forget();
|
||||||
|
@ -1434,7 +1434,7 @@ static void MirrorSubstring(ATSUTextLayout layout, nsAutoArrayPtr<PRUnichar>& mi
|
||||||
class CmapFontMatcher {
|
class CmapFontMatcher {
|
||||||
public:
|
public:
|
||||||
CmapFontMatcher(const PRUnichar *aString, PRUint32 aBeginOffset, PRUint32 aEndOffset, gfxAtsuiFontGroup* aFontGroup) :
|
CmapFontMatcher(const PRUnichar *aString, PRUint32 aBeginOffset, PRUint32 aEndOffset, gfxAtsuiFontGroup* aFontGroup) :
|
||||||
mString(aString), mOffset(aBeginOffset), mPrevOffset(aBeginOffset), mEndOffset(aEndOffset), mPrevCh(0), mFirstPass(PR_TRUE), mFontGroup(aFontGroup), mMatchedFont(0), mNextMatchedFont(0)
|
mString(aString), mOffset(aBeginOffset), mPrevOffset(aBeginOffset), mEndOffset(aEndOffset), mPrevCh(0), mFirstRange(PR_TRUE), mFontGroup(aFontGroup), mMatchedFont(0), mNextMatchedFont(0)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
// match the next substring that uses the same font, returns the length matched
|
// match the next substring that uses the same font, returns the length matched
|
||||||
|
@ -1445,7 +1445,7 @@ public:
|
||||||
|
|
||||||
matchStartOffset = mPrevOffset;
|
matchStartOffset = mPrevOffset;
|
||||||
|
|
||||||
if ( !mFirstPass ) {
|
if ( !mFirstRange ) {
|
||||||
mMatchedFont = mNextMatchedFont;
|
mMatchedFont = mNextMatchedFont;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1473,9 +1473,9 @@ public:
|
||||||
mPrevCh = ch;
|
mPrevCh = ch;
|
||||||
|
|
||||||
// no previous match, set one up
|
// no previous match, set one up
|
||||||
if ( mFirstPass ) {
|
if ( mFirstRange ) {
|
||||||
mMatchedFont = font;
|
mMatchedFont = font;
|
||||||
mFirstPass = PR_FALSE;
|
mFirstRange = PR_FALSE;
|
||||||
} else if ( font != mMatchedFont ) {
|
} else if ( font != mMatchedFont ) {
|
||||||
mPrevOffset = chStartOffset;
|
mPrevOffset = chStartOffset;
|
||||||
mNextMatchedFont = font;
|
mNextMatchedFont = font;
|
||||||
|
@ -1498,7 +1498,7 @@ private:
|
||||||
PRUint32 mPrevOffset;
|
PRUint32 mPrevOffset;
|
||||||
PRUint32 mEndOffset;
|
PRUint32 mEndOffset;
|
||||||
PRUint32 mPrevCh;
|
PRUint32 mPrevCh;
|
||||||
PRBool mFirstPass;
|
PRBool mFirstRange;
|
||||||
gfxAtsuiFontGroup *mFontGroup;
|
gfxAtsuiFontGroup *mFontGroup;
|
||||||
nsRefPtr<gfxAtsuiFont> mMatchedFont;
|
nsRefPtr<gfxAtsuiFont> mMatchedFont;
|
||||||
nsRefPtr<gfxAtsuiFont> mNextMatchedFont;
|
nsRefPtr<gfxAtsuiFont> mNextMatchedFont;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче