diff options
Diffstat (limited to 'graphics/asymptote/runlabel.in')
-rw-r--r-- | graphics/asymptote/runlabel.in | 74 |
1 files changed, 37 insertions, 37 deletions
diff --git a/graphics/asymptote/runlabel.in b/graphics/asymptote/runlabel.in index 978d7d97f9..61f66bfcb2 100644 --- a/graphics/asymptote/runlabel.in +++ b/graphics/asymptote/runlabel.in @@ -11,10 +11,10 @@ pen => primPen() picture* => primPicture() transform => primTransform() realarray* => realArray() - stringarray* => stringArray() - penarray* => penArray() - patharray* => pathArray() - patharray2* => pathArray2() + stringarray* => stringArray() + penarray* => penArray() + patharray* => pathArray() + patharray2* => pathArray2() #include "picture.h" #include "drawlabel.h" @@ -36,14 +36,14 @@ using types::penArray; using types::pathArray; using types::pathArray2; -void cannotread(const string& s) +void cannotread(const string& s) { ostringstream buf; buf << "Cannot read from " << s; error(buf); } -void cannotwrite(const string& s) +void cannotwrite(const string& s) { ostringstream buf; buf << "Cannot write to " << s; @@ -65,7 +65,7 @@ string currentpoint="print currentpoint ASYy ASYx "; string ASYinit="/ASYX currentpoint pop def /ASYY currentpoint exch pop def "; string ASY1="ASY1 {"+ASYinit+"/ASY1 false def} if "; -void endpath(std::ostream& ps) +void endpath(std::ostream& ps) { ps << ASY1 << pathforall << " (M) " << currentpoint << "currentpoint newpath moveto} bind def" << endl; @@ -77,7 +77,7 @@ void fillpath(std::ostream& ps) endpath(ps); } -void showpath(std::ostream& ps) +void showpath(std::ostream& ps) { ps << ASYx << newl << ASYy << newl @@ -128,19 +128,19 @@ array *readpath(const string& psname, bool keep, bool pdf=false, if(isalpha(*i) && *i != 'e') {buf << " ";} buf << *i; } -#else +#else buf << s; #endif - + if(verbose > 2) cout << endl; - + mem::vector<solvedKnot> nodes; solvedKnot node; bool active=false; - + array *P=new array(0); PP->push(P); - + while(!buf.eof()) { char c; buf >> c; @@ -199,10 +199,10 @@ array *readpath(const string& psname, bool keep, bool pdf=false, } } } - + if(oldPath != NULL) setPath(oldPath); - + if(!keep) unlink(psname.c_str()); return PP; @@ -226,13 +226,13 @@ realarray *texsize(string *s, pen p=CURRENTPEN) { texinit(); processDataStruct &pd=processData(); - + string texengine=getSetting<string>("tex"); setpen(pd.tex,texengine,p); - + double width,height,depth; texbounds(width,height,depth,pd.tex,*s); - + array *t=new array(3); (*t)[0]=width; (*t)[1]=height; @@ -244,7 +244,7 @@ patharray2 *_texpath(stringarray *s, penarray *p) { size_t n=checkArrays(s,p); if(n == 0) return new array(0); - + string prefix=cleanpath(outname()); string psname=auxname(prefix,"ps"); string texname=auxname(prefix,"tex"); @@ -252,10 +252,10 @@ patharray2 *_texpath(stringarray *s, penarray *p) bbox b; string texengine=getSetting<string>("tex"); bool xe=settings::xe(texengine) || settings::lua(texengine) || - settings::context(texengine); + settings::context(texengine); texfile tex(texname,b,true); tex.miniprologue(); - + for(size_t i=0; i < n; ++i) { tex.setfont(read<pen>(p,i)); if(i != 0) { @@ -279,15 +279,15 @@ patharray2 *_texpath(stringarray *s, penarray *p) } tex.verbatimline(read<string>(s,i)+"\\ %"); } - + tex.epilogue(true); tex.close(); - + int status=opentex(texname,prefix,!xe); - + string pdfname,pdfname2,psname2; bool keep=getSetting<bool>("keep"); - + bool legacygs=false; if(!status) { if(xe) { @@ -301,7 +301,7 @@ patharray2 *_texpath(stringarray *s, penarray *p) if(!fs::exists(pdfname)) return new array(n); std::ofstream ps(psname.c_str(),std::ios::binary); if(!ps) cannotwrite(psname); - + showpath(ps); mem::vector<string> pcmd; @@ -362,7 +362,7 @@ patharray2 *_texpath(stringarray *s, penarray *p) } } else error("texpath failed"); - + if(!keep) { // Delete temporary files. unlink(texname.c_str()); if(!getSetting<bool>("keepaux")) @@ -380,7 +380,7 @@ patharray2 *_texpath(stringarray *s, penarray *p) unlink(auxname(prefix,"tui").c_str()); } } - return xe ? readpath(psname,keep,!legacygs,0.1) : + return xe ? readpath(psname,keep,!legacygs,0.1) : readpath(psname,keep,false,0.12,-1.0); } @@ -388,13 +388,13 @@ patharray2 *textpath(stringarray *s, penarray *p) { size_t n=checkArrays(s,p); if(n == 0) return new array(0); - + string prefix=cleanpath(outname()); string outputname=auxname(prefix,getSetting<string>("textoutformat")); string textname=auxname(prefix,getSetting<string>("textextension")); std::ofstream text(textname.c_str()); - + if(!text) cannotwrite(textname); for(size_t i=0; i < n; ++i) { @@ -404,20 +404,20 @@ patharray2 *textpath(stringarray *s, penarray *p) << getSetting<string>("textepilogue") << endl; } text.close(); - + string psname=auxname(prefix,"ps"); std::ofstream ps(psname.c_str()); if(!ps) cannotwrite(psname); showpath(ps); - + mem::vector<string> cmd; cmd.push_back(getSetting<string>("textcommand")); push_split(cmd,getSetting<string>("textcommandOptions")); cmd.push_back(textname); iopipestream typesetter(cmd); typesetter.block(true,false); - + mem::vector<string> cmd2; cmd2.push_back(getSetting<string>("gs")); cmd2.push_back("-q"); @@ -442,16 +442,16 @@ patharray2 *textpath(stringarray *s, penarray *p) typesetter.pipeclose(); gs.eof(); } - } + } string out2; gs >> out2; if(out2.empty() && !gs.running()) break; ps << out2; } ps.close(); - + if(verbose > 2) cout << endl; - + bool keep=getSetting<bool>("keep"); if(!keep) // Delete temporary files. unlink(textname.c_str()); @@ -462,7 +462,7 @@ patharray *_strokepath(path g, pen p=CURRENTPEN) { array *P=new array(0); if(g.size() == 0) return P; - + string prefix=cleanpath(outname()); string psname=auxname(prefix,"ps"); bbox b; |