Gfx: Add FontCollection implementation

The D2D implementation is a stub for now.
This commit is contained in:
Birunthan Mohanathas
2013-04-09 20:35:49 +03:00
parent 4d22c5ac61
commit 0b3a4d86c4
19 changed files with 353 additions and 41 deletions

View File

@ -2096,7 +2096,7 @@ bool CMeterWindow::ReadSkin()
if (find != INVALID_HANDLE_VALUE)
{
m_FontCollection = new PrivateFontCollection();
m_FontCollection = m_Canvas->CreateFontCollection();
do
{
@ -2104,8 +2104,7 @@ bool CMeterWindow::ReadSkin()
{
std::wstring file(resourcePath, 0, resourcePath.length() - 1);
file += fd.cFileName;
Status status = m_FontCollection->AddFontFile(file.c_str());
if (status != Ok)
if (!m_FontCollection->AddFile(file.c_str()))
{
std::wstring error = L"Unable to load font: ";
error += file.c_str();
@ -2125,7 +2124,7 @@ bool CMeterWindow::ReadSkin()
{
if (!m_FontCollection)
{
m_FontCollection = new PrivateFontCollection();
m_FontCollection = m_Canvas->CreateFontCollection();
}
int i = 1;
@ -2134,13 +2133,11 @@ bool CMeterWindow::ReadSkin()
// Try program folder first
std::wstring szFontFile = Rainmeter->GetPath() + L"Fonts\\";
szFontFile += localFont;
Status status = m_FontCollection->AddFontFile(szFontFile.c_str());
if (status != Ok)
if (!m_FontCollection->AddFile(szFontFile.c_str()))
{
szFontFile = localFont;
MakePathAbsolute(szFontFile);
status = m_FontCollection->AddFontFile(szFontFile.c_str());
if (status != Ok)
if (!m_FontCollection->AddFile(szFontFile.c_str()))
{
std::wstring error = L"Unable to load font: ";
error += localFont;