mirror of
https://invent.kde.org/graphics/okular
synced 2024-08-25 02:45:38 +00:00
Fonts are scanned again by poppler5
Fonts are filtered as well to only appear once. REVIEW: 128441
This commit is contained in:
parent
ec0b68a756
commit
dd8fa351ce
|
@ -1521,10 +1521,12 @@ void DocumentPrivate::fontReadingProgress( int page )
|
||||||
|
|
||||||
void DocumentPrivate::fontReadingGotFont( const Okular::FontInfo& font )
|
void DocumentPrivate::fontReadingGotFont( const Okular::FontInfo& font )
|
||||||
{
|
{
|
||||||
// TODO try to avoid duplicate fonts
|
// Try to avoid duplicate fonts
|
||||||
m_fontsCache.append( font );
|
if (m_fontsCache.indexOf(font) == -1) {
|
||||||
|
m_fontsCache.append( font );
|
||||||
|
|
||||||
emit m_parent->gotFont( font );
|
emit m_parent->gotFont( font );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void DocumentPrivate::slotGeneratorConfigChanged( const QString& )
|
void DocumentPrivate::slotGeneratorConfigChanged( const QString& )
|
||||||
|
|
|
@ -30,8 +30,7 @@ class Okular::FontInfoPrivate
|
||||||
type == rhs.type &&
|
type == rhs.type &&
|
||||||
embedType == rhs.embedType &&
|
embedType == rhs.embedType &&
|
||||||
file == rhs.file &&
|
file == rhs.file &&
|
||||||
canBeExtracted == rhs.canBeExtracted &&
|
canBeExtracted == rhs.canBeExtracted;
|
||||||
nativeId == rhs.nativeId;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QString name;
|
QString name;
|
||||||
|
|
|
@ -800,8 +800,11 @@ Okular::FontInfo::List PDFGenerator::fontsForPage( int page )
|
||||||
|
|
||||||
QList<Poppler::FontInfo> fonts;
|
QList<Poppler::FontInfo> fonts;
|
||||||
userMutex()->lock();
|
userMutex()->lock();
|
||||||
#pragma message("scanForFonts doesn't exist in Poppler5. BahhhH!")
|
|
||||||
//pdfdoc->scanForFonts( 1, &fonts );
|
Poppler::FontIterator* it = pdfdoc->newFontIterator(page);
|
||||||
|
if (it->hasNext()) {
|
||||||
|
fonts = it->next();
|
||||||
|
}
|
||||||
userMutex()->unlock();
|
userMutex()->unlock();
|
||||||
|
|
||||||
foreach (const Poppler::FontInfo &font, fonts)
|
foreach (const Poppler::FontInfo &font, fonts)
|
||||||
|
|
Loading…
Reference in a new issue