diff options
Diffstat (limited to 'dviware/dvisvgm/src/PSInterpreter.cpp')
-rw-r--r-- | dviware/dvisvgm/src/PSInterpreter.cpp | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/dviware/dvisvgm/src/PSInterpreter.cpp b/dviware/dvisvgm/src/PSInterpreter.cpp index 5e09642ef6..c296a18f04 100644 --- a/dviware/dvisvgm/src/PSInterpreter.cpp +++ b/dviware/dvisvgm/src/PSInterpreter.cpp @@ -2,7 +2,7 @@ ** PSInterpreter.cpp ** ** ** ** This file is part of dvisvgm -- a fast DVI to SVG converter ** -** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> ** +** Copyright (C) 2005-2021 Martin Gieseking <martin.gieseking@uos.de> ** ** ** ** This program is free software; you can redistribute it and/or ** ** modify it under the terms of the GNU General Public License as ** @@ -59,8 +59,10 @@ void PSInterpreter::init () { // in conjunction with -dDELAYBIND and -dWRITESYSTEMDICT. // Thus, -dDELAYSAFER (or -dNOSAFER) must be added. // https://www.ghostscript.com/doc/9.50/Use.htm#Safer - if (gsrev >= 950) + if (gsrev >= 950) { gsargs.emplace_back("-dDELAYSAFER"); + gsargs.emplace_back("-dALLOWPSTRANSPARENCY"); + } } _gs.init(gsargs.size(), gsargs.data(), this); _gs.set_stdio(input, output, error); @@ -130,7 +132,7 @@ bool PSInterpreter::execute (const char *str, size_t len, bool flush) { // feed Ghostscript with code chunks that are not larger than 64KB // => see documentation of gsapi_run_string_foo() const char *p=str; - while (PS_RUNNING && len > 0) { + while (_mode == PS_RUNNING && len > 0) { SignalHandler::instance().check(); size_t chunksize = min(len, (size_t)0xffff); _gs.run_string_continue(p, chunksize, 0, &status); @@ -279,6 +281,7 @@ void PSInterpreter::callActions (InputReader &in) { {"rotate", { 1, &PSActions::rotate}}, {"save", { 1, &PSActions::save}}, {"scale", { 2, &PSActions::scale}}, + {"setalphaisshape", { 1, &PSActions::setalphaisshape}}, {"setblendmode", { 1, &PSActions::setblendmode}}, {"setcolorspace", { 1, &PSActions::setcolorspace}}, {"setcmykcolor", { 4, &PSActions::setcmykcolor}}, @@ -286,7 +289,6 @@ void PSInterpreter::callActions (InputReader &in) { {"setfillconstantalpha", { 1, &PSActions::setfillconstantalpha}}, {"setgray", { 1, &PSActions::setgray}}, {"sethsbcolor", { 3, &PSActions::sethsbcolor}}, - {"setisshapealpha", { 1, &PSActions::setisshapealpha}}, {"setlinecap", { 1, &PSActions::setlinecap}}, {"setlinejoin", { 1, &PSActions::setlinejoin}}, {"setlinewidth", { 1, &PSActions::setlinewidth}}, @@ -309,7 +311,7 @@ void PSInterpreter::callActions (InputReader &in) { _rawData.clear(); in.skipSpace(); while (!in.eof()) { - _rawData.emplace_back(in.getString()); + _rawData.push_back(in.getString()); in.skipSpace(); } } @@ -320,14 +322,14 @@ void PSInterpreter::callActions (InputReader &in) { if (pcount < 0) { // variable number of parameters? in.skipSpace(); while (!in.eof()) { // read all available parameters - params.emplace_back(in.getString()); + params.push_back(in.getString()); in.skipSpace(); } } else { // fix number of parameters for (int i=0; i < pcount; i++) { in.skipSpace(); - params.emplace_back(in.getString()); + params.push_back(in.getString()); } } // convert parameter strings to doubles @@ -415,7 +417,7 @@ bool PSInterpreter::imageDeviceKnown (string deviceStr) { return false; deviceStr = deviceStr.substr(0, deviceStr.find(':')); // strip optional argument auto infos = getImageDeviceInfos(); - auto it = find_if(infos.begin(), infos.end(), [&](PSDeviceInfo &info) { + auto it = find_if(infos.begin(), infos.end(), [&](const PSDeviceInfo &info) { return info.name == deviceStr; }); return it != infos.end(); |