зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1171357 - log font matching for textruns. r=m_kato
--HG-- extra : rebase_source : 4912e1d1597a9f1045a50eb41a6cf6e1f7a7bf68
This commit is contained in:
Родитель
f03fd8179e
Коммит
e42e576e11
|
@ -2986,16 +2986,43 @@ void gfxFontGroup::ComputeRanges(nsTArray<gfxTextRange>& aRanges,
|
||||||
|
|
||||||
aRanges[lastRangeIndex].end = aLength;
|
aRanges[lastRangeIndex].end = aLength;
|
||||||
|
|
||||||
#if 0
|
#ifndef RELEASE_BUILD
|
||||||
// dump out font matching info
|
PRLogModuleInfo *log = (mStyle.systemFont ?
|
||||||
if (mStyle.systemFont) return;
|
gfxPlatform::GetLog(eGfxLog_textrunui) :
|
||||||
for (size_t i = 0, i_end = aRanges.Length(); i < i_end; i++) {
|
gfxPlatform::GetLog(eGfxLog_textrun));
|
||||||
const gfxTextRange& r = aRanges[i];
|
|
||||||
printf("fontmatch %zd:%zd font: %s (%d)\n",
|
if (MOZ_UNLIKELY(MOZ_LOG_TEST(log, LogLevel::Debug))) {
|
||||||
r.start, r.end,
|
nsAutoCString lang;
|
||||||
(r.font.get() ?
|
mStyle.language->ToUTF8String(lang);
|
||||||
NS_ConvertUTF16toUTF8(r.font->GetName()).get() : "<null>"),
|
nsAutoString families;
|
||||||
r.matchType);
|
mFamilyList.ToString(families);
|
||||||
|
|
||||||
|
// collect the font matched for each range
|
||||||
|
nsAutoCString fontMatches;
|
||||||
|
for (size_t i = 0, i_end = aRanges.Length(); i < i_end; i++) {
|
||||||
|
char match[256];
|
||||||
|
const gfxTextRange& r = aRanges[i];
|
||||||
|
sprintf(match, " [%u:%u] %.200s (%s)",
|
||||||
|
r.start, r.end,
|
||||||
|
(r.font.get() ?
|
||||||
|
NS_ConvertUTF16toUTF8(r.font->GetName()).get() : "<null>"),
|
||||||
|
(r.matchType == gfxTextRange::kFontGroup ?
|
||||||
|
"list" :
|
||||||
|
(r.matchType == gfxTextRange::kPrefsFallback) ?
|
||||||
|
"prefs" : "sys"));
|
||||||
|
fontMatches.Append(match);
|
||||||
|
}
|
||||||
|
MOZ_LOG(log, LogLevel::Debug,\
|
||||||
|
("(%s-fontmatching) fontgroup: [%s] default: %s lang: %s script: %d"
|
||||||
|
"%s\n",
|
||||||
|
(mStyle.systemFont ? "textrunui" : "textrun"),
|
||||||
|
NS_ConvertUTF16toUTF8(families).get(),
|
||||||
|
(mFamilyList.GetDefaultFontType() == eFamily_serif ?
|
||||||
|
"serif" :
|
||||||
|
(mFamilyList.GetDefaultFontType() == eFamily_sans_serif ?
|
||||||
|
"sans-serif" : "none")),
|
||||||
|
lang.get(), aRunScript,
|
||||||
|
fontMatches.get()));
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче