one small fix in the cairo_font to use the default font if the mapping failed.

This commit is contained in:
Yuri Kobets 2015-01-02 20:02:58 +03:00
parent f074332c4c
commit 944e023921
2 changed files with 7 additions and 6 deletions

View File

@ -192,16 +192,17 @@ void cairo_font::split_text( const litehtml::tchar_t* src, text_chunk::vector& c
linked_font* lkf = new linked_font;
lkf->code_pages = dwActualCodePages;
lkf->hFont = NULL;
HRESULT hr = m_font_link->MapFont(hdc, dwActualCodePages, 0, &lkf->hFont);
m_font_link->MapFont(hdc, dwActualCodePages, 0, &lkf->hFont);
if (lkf->hFont)
{
lkf->font_face = create_font_face(lkf->hFont);
m_linked_fonts.push_back(lkf);
}
else
{
lkf->font_face = create_font_face(m_hFont);
delete lkf;
lkf = NULL;
}
m_linked_fonts.push_back(lkf);
chk->font = lkf;
}
}

View File

@ -164,9 +164,6 @@
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="el_cdata.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="attributes.h">
<Filter>Header Files</Filter>
</ClInclude>
@ -341,5 +338,8 @@
<ClInclude Include="utf8_strings.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="el_cdata.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
</Project>