diff --git a/src/kiwano/render/DirectX/RendererImpl.cpp b/src/kiwano/render/DirectX/RendererImpl.cpp index 8683a4c1..48484b71 100644 --- a/src/kiwano/render/DirectX/RendererImpl.cpp +++ b/src/kiwano/render/DirectX/RendererImpl.cpp @@ -110,27 +110,27 @@ void RendererImpl::MakeContextForWindow(WindowPtr window) } } - if (SUCCEEDED(hr)) - { - IDWriteFactory* dwrite = d2d_res_->GetDWriteFactory(); - if (dwrite) - { - ComPtr system_collection; - if (SUCCEEDED(dwrite->GetSystemFontCollection(&system_collection, FALSE))) - { - Vector family_names; - if (SUCCEEDED(d2d_res_->GetFontFamilyNames(family_names, system_collection))) - { - // dummy font - FontPtr font = MakePtr(); - for (const auto& name : family_names) - { - FontCache::GetInstance().AddFontByFamily(name, font); - } - } - } - } - } + //if (SUCCEEDED(hr)) + //{ + // IDWriteFactory* dwrite = d2d_res_->GetDWriteFactory(); + // if (dwrite) + // { + // ComPtr system_collection; + // if (SUCCEEDED(dwrite->GetSystemFontCollection(&system_collection, FALSE))) + // { + // Vector family_names; + // if (SUCCEEDED(d2d_res_->GetFontFamilyNames(family_names, system_collection))) + // { + // // dummy font + // FontPtr font = MakePtr(); + // for (const auto& name : family_names) + // { + // FontCache::GetInstance().AddFontByFamily(name, font); + // } + // } + // } + // } + //} KGE_THROW_IF_FAILED(hr, "Create render resources failed"); } diff --git a/src/kiwano/render/Font.cpp b/src/kiwano/render/Font.cpp index 2bbfe4ce..dacfdfbf 100644 --- a/src/kiwano/render/Font.cpp +++ b/src/kiwano/render/Font.cpp @@ -97,6 +97,7 @@ Font::Font(const String& family_name, float size, uint32_t weight, FontPosture p , weight_(weight) , posture_(posture) , stretch_(stretch) + , family_name_(family_name) { if (family_name.empty()) return; @@ -105,11 +106,6 @@ Font::Font(const String& family_name, float size, uint32_t weight, FontPosture p if (found) { this->ResetNativePointer(found->GetNativePointer()); - this->SetFamilyName(family_name); - } - else - { - this->Fail(strings::Format("Font::Load failed: cannot find family name \"%s\"", family_name.c_str())); } }