Cell: fix wrong condition when checking for font styles

This commit is contained in:
Günter Obiltschnig 2022-05-17 09:21:59 +02:00
parent 2cccd9fede
commit 083c3691b9

View File

@ -104,13 +104,13 @@ void Cell::draw(Page& page, float x, float y, float width, float height)
else if (_trueType) page.setTTFont((*_pFontMap)[AttributedString::STYLE_PLAIN], fontSize, _encoding); else if (_trueType) page.setTTFont((*_pFontMap)[AttributedString::STYLE_PLAIN], fontSize, _encoding);
else page.setFont((*_pFontMap)[AttributedString::STYLE_PLAIN], fontSize, _encoding); else page.setFont((*_pFontMap)[AttributedString::STYLE_PLAIN], fontSize, _encoding);
} }
else if (fontStyle | AttributedString::STYLE_BOLD) else if (fontStyle & AttributedString::STYLE_BOLD)
{ {
if (!_pFontMap) page.setFont("Helvetica-Bold", fontSize); if (!_pFontMap) page.setFont("Helvetica-Bold", fontSize);
else if (_trueType) page.setTTFont((*_pFontMap)[AttributedString::STYLE_BOLD], fontSize, _encoding); else if (_trueType) page.setTTFont((*_pFontMap)[AttributedString::STYLE_BOLD], fontSize, _encoding);
else page.setFont((*_pFontMap)[AttributedString::STYLE_BOLD], fontSize, _encoding); else page.setFont((*_pFontMap)[AttributedString::STYLE_BOLD], fontSize, _encoding);
} }
else if (fontStyle | AttributedString::STYLE_ITALIC) else if (fontStyle & AttributedString::STYLE_ITALIC)
{ {
if (!_pFontMap) page.setFont("Helvetica-Oblique", fontSize); if (!_pFontMap) page.setFont("Helvetica-Oblique", fontSize);
else if (_trueType) page.setTTFont((*_pFontMap)[AttributedString::STYLE_ITALIC], fontSize, _encoding); else if (_trueType) page.setTTFont((*_pFontMap)[AttributedString::STYLE_ITALIC], fontSize, _encoding);