When initializeScroptFontMap is called, it tests for existence of fonts, which loads font data for the fonts. This will load a large number of unneeded fonts. See example stack below.
At least on Windows, existence of fonts can be tested without loading font data, but we should also consider whether we need to do this pre-initialization in the first place.
As an alternative, we can reduce the number of fonts in the script map in cases where font fallback is sufficient (need to be careful, especially on win7, since fallback might rely on this map).
content.dll!content::DWriteFontCollectionProxy::CreateEnumeratorFromKey(IDWriteFactory * factory, const void * collection_key, unsigned int collection_key_size, IDWriteFontFileEnumerator * * font_file_enumerator) Line 212 C++
DWrite.dll!FontCollectionConstructionTask::AddElementData() Unknown
DWrite.dll!CacheWriter::AddElement() Unknown
DWrite.dll!IBaseCacheContext::AddElementInternal() Unknown
DWrite.dll!ClientSideCacheContext::AddElementInternal() Unknown
DWrite.dll!DWriteFactory::AddElement(class IElementConstructionTask *,struct CachedElementData *) Unknown
DWrite.dll!ElementTaskList::ExecuteTask(class IBaseCacheContext *,class IElementConstructionTask *,bool) Unknown
DWrite.dll!ElementTaskList::GetElementData() Unknown
DWrite.dll!FontCollection::FontCollection(class IBaseCacheContext *,class FontCollectionElementKey const *) Unknown
DWrite.dll!ComObject<class DWriteFontCollection,struct DeleteOnZeroReference>::ComObject<class DWriteFontCollection,struct DeleteOnZeroReference><class DWriteFactory * const,class FontCollectionElementKey *>(class DWriteFactory * const &&,class FontCollectionElementKey * &&) Unknown
DWrite.dll!DWriteFactory::CreateCustomFontCollection() Unknown
content.dll!content::DWriteFontCollectionProxy::LoadFamily(unsigned int family_index, IDWriteFontCollection * * containing_collection) Line 288 C++
content.dll!content::DWriteFontFamilyProxy::LoadFamily() Line 488 C++
content.dll!content::DWriteFontFamilyProxy::GetFirstMatchingFont(DWRITE_FONT_WEIGHT weight, DWRITE_FONT_STRETCH stretch, DWRITE_FONT_STYLE style, IDWriteFont * * matching_font) Line 421 C++
skia.dll!SkFontStyleSet_DirectWrite::matchStyle(const SkFontStyle & pattern) Line 1033 C++
skia.dll!SkFontMgr_DirectWrite::onMatchFamilyStyle(const char * familyName, const SkFontStyle & fontstyle) Line 513 C++
skia.dll!SkFontMgr::matchFamilyStyle(const char * familyName, const SkFontStyle & fs) Line 108 C++
blink_platform.dll!blink::`anonymous namespace'::isFontPresent(const wchar_t * fontName, SkFontMgr * fontManager) Line 52 C++
> blink_platform.dll!blink::`anonymous namespace'::initializeScriptFontMap(const wchar_t *[167] & scriptFontMap, SkFontMgr * fontManager) Line 301 C++
blink_platform.dll!blink::getFontFamilyForScript(UScriptCode script, blink::FontDescription::GenericFamilyType generic, SkFontMgr * fontManager) Line 463 C++
blink_platform.dll!blink::getFallbackFamily(int character, blink::FontDescription::GenericFamilyType generic, UScriptCode contentScript, const WTF::AtomicString & contentLocale, UScriptCode * scriptChecked, blink::FontFallbackPriority fallbackPriority, SkFontMgr * fontManager) Line 518 C++
blink_platform.dll!blink::FontCache::fallbackFontForCharacter(const blink::FontDescription & fontDescription, int character, const blink::SimpleFontData * originalFontData, blink::FontFallbackPriority fallbackPriority) Line 127 C++
blink_platform.dll!blink::FontFallbackIterator::uniqueSystemFontForHint(int hint) Line 193 C++
blink_platform.dll!blink::FontFallbackIterator::next(const WTF::Vector<int,0,WTF::PartitionAllocator> & hintList) Line 94 C++
blink_platform.dll!blink::FontFallbackIterator::next(const WTF::Vector<int,0,WTF::PartitionAllocator> & hintList) Line 124 C++
blink_platform.dll!blink::HarfBuzzShaper::shapeResult() Line 611 C++
blink_platform.dll!blink::CachingWordShapeIterator::shapeWordWithoutSpacing(const blink::TextRun & wordRun, const blink::Font * font) Line 84 C++
blink_platform.dll!blink::CachingWordShapeIterator::shapeWord(const blink::TextRun & wordRun, const blink::Font * font) Line 98 C++
blink_platform.dll!blink::CachingWordShapeIterator::shapeToEndIndex(WTF::RefPtr<blink::ShapeResult const > * result, unsigned int endIndex) Line 173 C++
Comment 1 by bugdroid1@chromium.org
, Aug 9 2016