本文整理汇总了C++中poppler::Document::newFontIterator方法的典型用法代码示例。如果您正苦于以下问题:C++ Document::newFontIterator方法的具体用法?C++ Document::newFontIterator怎么用?C++ Document::newFontIterator使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类poppler::Document
的用法示例。
在下文中一共展示了Document::newFontIterator方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: checkFontIterator
void TestFontsData::checkFontIterator()
{
// loading a 1-page document
Poppler::Document *doc;
doc = Poppler::Document::load("../../../test/tests/type3.pdf");
QVERIFY( doc );
// loading a 6-pages document
Poppler::Document *doc6 = Poppler::Document::load("../../../test/tests/cropbox.pdf");
QVERIFY( doc6 );
std::auto_ptr< Poppler::FontIterator > it;
// some tests with the 1-page document:
// - check a default iterator
it.reset( doc->newFontIterator() );
QVERIFY( it->hasNext() );
// - check an iterator for negative pages to behave as 0
it.reset( doc->newFontIterator( -1 ) );
QVERIFY( it->hasNext() );
// - check an iterator for pages out of the page limit
it.reset( doc->newFontIterator( 1 ) );
QVERIFY( !it->hasNext() );
// - check that it reaches the end after 1 iteration
it.reset( doc->newFontIterator() );
QVERIFY( it->hasNext() );
it->next();
QVERIFY( !it->hasNext() );
// some tests with the 6-page document:
// - check a default iterator
it.reset( doc6->newFontIterator() );
QVERIFY( it->hasNext() );
// - check an iterator for pages out of the page limit
it.reset( doc6->newFontIterator( 6 ) );
QVERIFY( !it->hasNext() );
// - check that it reaches the end after 6 iterations
it.reset( doc6->newFontIterator() );
QVERIFY( it->hasNext() );
it->next();
QVERIFY( it->hasNext() );
it->next();
QVERIFY( it->hasNext() );
it->next();
QVERIFY( it->hasNext() );
it->next();
QVERIFY( it->hasNext() );
it->next();
QVERIFY( it->hasNext() );
it->next();
QVERIFY( !it->hasNext() );
delete doc;
delete doc6;
}