diff options
author | joye <joye> | 2014-06-09 21:05:59 (GMT) |
---|---|---|
committer | joye <joye> | 2014-06-09 21:05:59 (GMT) |
commit | a48e2b03754fd071be70ac3a5eafdab2719c44d6 (patch) | |
tree | bdea3b4cc824e6495398b97583b157591bae91d0 | |
parent | 2f0d8eb37f29a5f0d02d247950a8e9a331cec762 (diff) | |
download | blt-a48e2b03754fd071be70ac3a5eafdab2719c44d6.zip blt-a48e2b03754fd071be70ac3a5eafdab2719c44d6.tar.gz blt-a48e2b03754fd071be70ac3a5eafdab2719c44d6.tar.bz2 |
*** empty log message ***
-rw-r--r-- | src/bltGrPSOutput.C | 6 | ||||
-rw-r--r-- | src/bltGrText.C | 31 |
2 files changed, 19 insertions, 18 deletions
diff --git a/src/bltGrPSOutput.C b/src/bltGrPSOutput.C index d747d13..11d31ef 100644 --- a/src/bltGrPSOutput.C +++ b/src/bltGrPSOutput.C @@ -815,10 +815,8 @@ void PostScript::prolog() "} def\n" "\n" "/DrawText {\n" -" 0 0 moveto\n" -" %[(hi) (world)] { \n" -" (hi) show\n" -" %} forall \n" +" moveto\n" +" {{gsave 1 -1 scale show grestore} forall} forall\n" "} bind def \n" "\n" "/EndText {\n" diff --git a/src/bltGrText.C b/src/bltGrText.C index 6a154de..33b350f 100644 --- a/src/bltGrText.C +++ b/src/bltGrText.C @@ -140,7 +140,22 @@ void TextStyle::printText(PostScript* psPtr, const char *text, int x, int y) int w1, h1; Tk_TextLayout layout = Tk_ComputeTextLayout(ops->font, text, -1, -1, ops->justify, 0, &w1, &h1); - // Point2d rr = rotateText(x, y, w1, h1); + + // cerr << '(' << x << ',' << y << ')' << ' ' << text << endl; + psPtr->append("gsave\n"); + psPtr->format("[\n"); + // psPtr->format("%g %g %g [\n", ops->angle, x, y); + Tcl_ResetResult(graphPtr_->interp_); + Tk_TextLayoutToPostscript(graphPtr_->interp_, layout); + const char* ss = Tcl_GetStringResult(graphPtr_->interp_); + psPtr->append(ss); + Tcl_ResetResult(graphPtr_->interp_); + psPtr->format("] %d %d \n", x, y); + psPtr->format(" DrawText\n"); + // psPtr->format("] %d %g %g %s %s DrawText\n", fm.linespace, xx/-2.0, yy/2.0, justify, "false"); + psPtr->append("grestore\n"); + +#if 0 double w2, h2; graphPtr_->getBoundingBox(w1, h1, ops->angle, &w2, &h2, NULL); @@ -158,19 +173,7 @@ void TextStyle::printText(PostScript* psPtr, const char *text, int x, int y) psPtr->format("%d %d %g %g %g BeginText\n", w1, h1, ops->angle, rr.x, rr.y); psPtr->format("(%s) %d %g %g DrawAdjText\n",text, width, 0. , h1*.5); psPtr->append("EndText\n"); - - // psPtr->append("gsave\n"); - // psPtr->format("%g %g %g [\n", ops->angle, x, y); - // cerr << ops->angle << ' ' << x << ' ' << y << " [" << endl; - // Tcl_ResetResult(graphPtr_->interp_); - // Tk_TextLayoutToPostscript(graphPtr_->interp_, layout); - // const char* ss = Tcl_GetStringResult(graphPtr_->interp_); - // psPtr->append(ss); - // cerr << ss << endl; - // Tcl_ResetResult(graphPtr_->interp_); - // psPtr->format("] %d %g %g %s %s DrawText\n", fm.linespace, xx/-2.0, yy/2.0, justify, "false"); - // cerr << "] " << fm.linespace << ' ' << xx/-2.0 << ' ' << yy/2.0 << ' ' << justify << " false DrawText" << endl; - // psPtr->append("grestore\n"); +#endif // psPtr->printText(text, x, y); } |