MCPcopy Create free account
hub / github.com/KDE/okular / startFontReading

Method startFontReading

core/document.cpp:2914–2937  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2912}
2913
2914void Document::startFontReading()
2915{
2916 if (!d->m_generator || !d->m_generator->hasFeature(Generator::FontInfo) || d->m_fontThread) {
2917 return;
2918 }
2919
2920 if (d->m_fontsCached) {
2921 // in case we have cached fonts, simulate a reading
2922 // this way the API is the same, and users no need to care about the
2923 // internal caching
2924 for (int i = 0; i < d->m_fontsCache.count(); ++i) {
2925 Q_EMIT gotFont(d->m_fontsCache.at(i));
2926 Q_EMIT fontReadingProgress(i / pages());
2927 }
2928 Q_EMIT fontReadingEnded();
2929 return;
2930 }
2931
2932 d->m_fontThread = new FontExtractionThread(d->m_generator, pages());
2933 connect(d->m_fontThread, &FontExtractionThread::gotFont, this, [this](const Okular::FontInfo &f) { d->fontReadingGotFont(f); });
2934 connect(d->m_fontThread.data(), &FontExtractionThread::progress, this, [this](int p) { d->slotFontReadingProgress(p); });
2935
2936 d->m_fontThread->startExtraction(/*d->m_generator->hasFeature( Generator::Threaded )*/ true);
2937}
2938
2939void Document::stopFontReading()
2940{

Callers 1

Calls 6

hasFeatureMethod · 0.80
fontReadingGotFontMethod · 0.80
startExtractionMethod · 0.80
countMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected