Skip to content

Commit

Permalink
[Qt] Use QFontDatabase::families().contains(family) (#630)
Browse files Browse the repository at this point in the history
  • Loading branch information
manisandro committed Feb 2, 2024
1 parent 5825021 commit 7755979
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions qt/src/hocr/HOCRPdfExporter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ HOCRQPainterPdfPrinter::HOCRQPainterPdfPrinter(QPainter* painter, const QFont& d

void HOCRQPainterPdfPrinter::setFontFamily(const QString& family, bool bold, bool italic) {
float curSize = m_curFont.pointSize();
if(m_fontDatabase.hasFamily(family)) {
if(m_fontDatabase.families().contains(family)) {
m_curFont.setFamily(family);
} else {
m_curFont = m_defaultFont;
Expand Down Expand Up @@ -670,7 +670,7 @@ PoDoFo::PdfFont* HOCRPoDoFoPdfPrinter::getFont(QString family, bool bold, bool i
QString key = family + (bold ? "@bold" : "") + (italic ? "@italic" : "");
auto it = m_fontCache.find(key);
if(it == m_fontCache.end()) {
if(family.isEmpty() || !m_fontDatabase.hasFamily(family)) {
if(family.isEmpty() || !m_fontDatabase.families().contains(family)) {
family = m_defaultFontFamily;
}
PoDoFo::PdfFont* font = nullptr;
Expand Down

0 comments on commit 7755979

Please sign in to comment.