mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-07-20 03:08:28 +08:00
Fix bug #39966
Fix the problem with embedding non-bolded fonts. Improve check whether the font is bold
This commit is contained in:
@ -1850,6 +1850,10 @@ bool CFontFile::IsBold()
|
||||
if (!m_pFace)
|
||||
return false;
|
||||
|
||||
TT_OS2* pOS2 = (TT_OS2*)FT_Get_Sfnt_Table(m_pFace, ft_sfnt_os2);
|
||||
if (pOS2 && pOS2->version != 0xFFFF && pOS2->usWeightClass >= 800)
|
||||
return true;
|
||||
|
||||
return ((m_pFace->style_flags & FT_STYLE_FLAG_BOLD) != 0) ? true : false;
|
||||
}
|
||||
|
||||
|
||||
@ -383,14 +383,16 @@ void CPdfRenderer::CCommandManager::Flush()
|
||||
oTextLine.Flush(pPage);
|
||||
lTextColor = pText->GetColor();
|
||||
TColor oColor = lTextColor;
|
||||
pPage->SetFillColor(oColor.r, oColor.g, oColor.b);
|
||||
pPage->SetFillColor(oColor.r, oColor.g, oColor.b);
|
||||
pPage->SetStrokeColor(oColor.r, oColor.g, oColor.b);
|
||||
}
|
||||
|
||||
if (nTextAlpha != pText->GetAlpha())
|
||||
{
|
||||
oTextLine.Flush(pPage);
|
||||
nTextAlpha = pText->GetAlpha();
|
||||
pPage->SetFillAlpha(nTextAlpha);
|
||||
pPage->SetFillAlpha(nTextAlpha);
|
||||
pPage->SetStrokeAlpha(nTextAlpha);
|
||||
}
|
||||
|
||||
if (fabs(dTextSpace - pText->GetSpace()) > 0.001)
|
||||
|
||||
Reference in New Issue
Block a user