summaryrefslogtreecommitdiffstats
path: root/src/bltGrPSOutput.C
diff options
context:
space:
mode:
authorjoye <joye>2014-06-13 21:18:59 (GMT)
committerjoye <joye>2014-06-13 21:18:59 (GMT)
commitd1babaaa20a8c24a55deeb3e551d0dbcbce836d5 (patch)
treec301486f5008d667bf0279c419a6d8bb4191cd66 /src/bltGrPSOutput.C
parent69f046a58e124ca00486f54f6c725f0738efabb1 (diff)
downloadblt-d1babaaa20a8c24a55deeb3e551d0dbcbce836d5.zip
blt-d1babaaa20a8c24a55deeb3e551d0dbcbce836d5.tar.gz
blt-d1babaaa20a8c24a55deeb3e551d0dbcbce836d5.tar.bz2
*** empty log message ***
Diffstat (limited to 'src/bltGrPSOutput.C')
-rw-r--r--src/bltGrPSOutput.C48
1 files changed, 42 insertions, 6 deletions
diff --git a/src/bltGrPSOutput.C b/src/bltGrPSOutput.C
index 84df667..acf1ea6 100644
--- a/src/bltGrPSOutput.C
+++ b/src/bltGrPSOutput.C
@@ -829,11 +829,8 @@ void PostScript::prolog()
"/cstringshow {\n"
" {\n"
" dup type /stringtype eq\n"
-" gsave\n"
-" 1 -1 scale\n"
" { show } { glyphshow }\n"
" ifelse\n"
-" grestore\n"
" } forall\n"
"} bind def\n"
"\n"
@@ -874,25 +871,64 @@ void PostScript::prolog()
" % angle for rotating, and x and y for positioning are still on the\n"
" % stack.\n"
" translate\n"
-" neg rotate\n"
+"%% rotate\n"
" lineLength xoffset mul\n"
" strings length 1 sub spacing mul height add yoffset mul translate\n"
+" % center, rotate, -center\n"
+" lineLength 2 div baseline 2 div translate\n"
+" neg rotate\n"
+" lineLength -2 div baseline -2 div translate\n"
" % Now use the baseline and justification information to translate\n"
" % so that the origin is at the baseline and positioning point for\n"
" % the first line of text.\n"
-" justify lineLength mul baseline neg translate\n"
+" justify lineLength mul baseline translate\n"
+"%% justify lineLength mul baseline neg translate\n"
" % Iterate over each of the lines to output it. For each line,\n"
" % compute its width again so it can be properly justified, then\n"
" % display it.\n"
" strings {\n"
" dup cstringwidth pop\n"
-" justify neg mul height 2 div moveto\n"
+" justify neg mul 0 moveto\n"
+" gsave\n"
+" 1 -1 scale\n"
" cstringshow\n"
+" grestore\n"
" 0 spacing translate\n"
+"%% 0 spacing neg translate\n"
" } forall\n"
" grestore\n"
"} bind def \n"
"\n"
+"/EndText {\n"
+" %Stack :\n"
+" grestore\n"
+"} def\n"
+"\n"
+"/BeginText {\n"
+" %Stack : w h theta centerX centerY\n"
+" gsave\n"
+" % Translate the origin to the center of bounding box and rotate\n"
+" translate neg rotate\n"
+" % Translate back to the origin of the text region\n"
+" -0.5 mul exch -0.5 mul exch translate\n"
+"} def\n"
+"\n"
+"/DrawAdjText {\n"
+" %Stack : str strWidth x y\n"
+" moveto % Go to the text position\n"
+" exch dup dup 4 2 roll\n"
+" % Adjust character widths to get desired overall string width\n"
+" % adjust X = (desired width - real width)/#chars\n"
+" stringwidth pop sub exch\n"
+" length div\n"
+" 0 3 -1 roll\n"
+" % Flip back the scale so that the string is not drawn in reverse\n"
+" gsave\n"
+" 1 -1 scale\n"
+" ashow\n"
+" grestore\n"
+"} def\n"
+"\n"
"/DrawBitmap {\n"
" % Stack: ?bgColorProc? boolean centerX centerY width height theta imageStr\n"
" gsave\n"