delegate_dwritefactory(IDWriteFactory *inst) : refnum(0), orig_this(inst), mycoll(nullptr) { OutputDebugString("delegate_dwritefactory::delegate_dwritefactory"); InitializeCriticalSection(&collcs); fontfile_collection_loader &loader = fontfile_collection_loader::get_instance(); if (SUCCEEDED(orig_this->RegisterFontCollectionLoader(&loader))) { EnterCriticalSection(&fontpathscs); orig_this->CreateCustomFontCollection(&loader, nullptr, 0, &mycoll); LeaveCriticalSection(&fontpathscs); } factories.insert(this); }
virtual HRESULT STDMETHODCALLTYPE RegisterFontCollectionLoader( IDWriteFontCollectionLoader* fontCollectionLoader ) { return orig_this->RegisterFontCollectionLoader(fontCollectionLoader); }