本文整理汇总了C++中QPrinter::setFontEmbeddingEnabled方法的典型用法代码示例。如果您正苦于以下问题:C++ QPrinter::setFontEmbeddingEnabled方法的具体用法?C++ QPrinter::setFontEmbeddingEnabled怎么用?C++ QPrinter::setFontEmbeddingEnabled使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QPrinter
的用法示例。
在下文中一共展示了QPrinter::setFontEmbeddingEnabled方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setupPdfPrinter
void SchedulePrintDialog::setupPdfPrinter( QPrinter & printer )
{
printer.setOutputFormat( QPrinter::PdfFormat );
setupPrinter(printer);
printer.setFullPage( true );
printer.setResolution( mDpiSpin->value() );
printer.setFontEmbeddingEnabled(false);
}
示例2: doPrint
void PagePrinter::doPrint(bool ok)
{
if (! ok)
{
std::cout << "Page could not be loaded" ;
QCoreApplication::exit(1);
}
this->settings()->setAttribute(QWebSettings::PrintElementBackgrounds, true);
this->settings()->setAttribute(QWebSettings::JavascriptEnabled, false);
QPrinter *printer = new QPrinter(QPrinterInfo::defaultPrinter(), QPrinter::ScreenResolution);
printer->setFontEmbeddingEnabled(true);
printer->setOutputFormat(QPrinter::PdfFormat);
printer->setFullPage(true);
QTemporaryFile file;
if (! file.open())
exit(1);
QString output = file.fileName().append(".pdf");
printer->setOutputFileName(output);
print(printer);
std::cout << output.toLatin1().data();
QCoreApplication::exit(0);
}
示例3: setFontEmbeddingEnabled
void QPrinterProto::setFontEmbeddingEnabled(bool enable)
{
QPrinter *item = qscriptvalue_cast<QPrinter*>(thisObject());
if (item)
item->setFontEmbeddingEnabled(enable);
}
示例4: doExport
/// Writes all the relevant data into the tdf file.
void ExportEPS::doExport()
{
using namespace std;
// code adapted from Umbrello
bool exportSuccessful;
QRect textrect;
//out->close();
// print the image to a normal postscript file,
// do not clip so that everything ends up in the file
// regardless of "paper size"
// because we want to work with postscript
// user-coordinates, set to the resolution
// of the printer (which should be 72dpi here)
QPrinter *printer;
printer = new QPrinter(QPrinter::ScreenResolution);
printer->setOutputToFile(true);
printer->setOutputFormat(QPrinter::PostScriptFormat);
printer->setOutputFileName(fileName);
printer->setColorMode(QPrinter::Color);
printer->setFontEmbeddingEnabled(true);
// do not call printer.setup(); because we want no user
// interaction here
QPainter *painter = new QPainter(printer);
// make sure the widget sizes will be according to the
// actually used printer font, important for getDiagramRect()
// and the actual painting
//view->forceUpdateWidgetFontMetrics(painter);
if (!scrollview)
{
delete painter;
delete printer;
exportSuccessful = FALSE;
}
Draw* draw = new Draw(scrollview, options);
QRect rect = draw->getBoundingBox(machine, painter);
rect.setWidth(rect.width()+10);
rect.setHeight(rect.height()+10);
painter->translate(-rect.x(),-rect.y());
//view->getDiagram(rect,*painter);
int resolution = printer->resolution();
if (scrollview)
scrollview->getDrawArea()->getSelection()->deselectAll(machine);
draw->drawStates(machine, painter, 0, 0, 1.0);
draw->drawTransitions(machine, painter, 0, 0, 1.0);
if (machine->getDrawITrans())
draw->drawInitialTransition(machine, machine->getInitialTransition(), painter, 0, 0, 1.0, textrect, FALSE);
// delete painter and printer before we try to open and fix the file
delete painter;
delete printer;
delete draw;
// modify bounding box from screen to eps resolution.
rect.setWidth( int(ceil(rect.width() * 72.0/resolution)) );
rect.setHeight( int(ceil(rect.height() * 72.0/resolution)) );
exportSuccessful = fixEPS(fileName,rect);
// next painting will most probably be to a different device (i.e. the screen)
//view->forceUpdateWidgetFontMetrics(0);
if (scrollview)
scrollview->getDrawArea()->reset();
//return exportSuccessful;
}
示例5: setFontEmbeddingEnabled
int Printer::setFontEmbeddingEnabled(lua_State * L) // ( bool enable )
{
QPrinter* lhs = ValueBinding<MyQPrinter>::check( L, 1 );
lhs->setFontEmbeddingEnabled( Util::toBool( L, 2 ) );
return 0;
}