fixed some problems with fonts in cairo_container

This commit is contained in:
Yuri Kobets 2015-01-02 00:04:35 +03:00
parent fe3daf19ba
commit f074332c4c
2 changed files with 17 additions and 2 deletions

View File

@ -39,6 +39,14 @@ litehtml::uint_ptr cairo_container::create_font( const litehtml::tchar_t* faceNa
delete f;
#else
fnt_name = fonts[0];
if (fnt_name.front() == '"')
{
fnt_name.erase(0, 1);
}
if (fnt_name.back() == '"')
{
fnt_name.erase(fnt_name.length() - 1, 1);
}
#endif
}

View File

@ -192,8 +192,15 @@ 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;
m_font_link->MapFont(hdc, dwActualCodePages, 0, &lkf->hFont);
lkf->font_face = create_font_face(lkf->hFont);
HRESULT hr = m_font_link->MapFont(hdc, dwActualCodePages, 0, &lkf->hFont);
if (lkf->hFont)
{
lkf->font_face = create_font_face(lkf->hFont);
}
else
{
lkf->font_face = create_font_face(m_hFont);
}
m_linked_fonts.push_back(lkf);
chk->font = lkf;
}