summaryrefslogtreecommitdiffstats
path: root/tkblt
diff options
context:
space:
mode:
authorWilliam Joye <wjoye@cfa.harvard.edu>2019-09-26 20:31:50 (GMT)
committerWilliam Joye <wjoye@cfa.harvard.edu>2019-09-26 20:31:50 (GMT)
commitb7ff15e79d8f2983b6689bde64cce3861f6af0ae (patch)
tree3e861eac8ba048dbeead047f5abd5fcf9096adae /tkblt
parent7826c726e5e75d9b96d435c6026d1f54634384b1 (diff)
downloadblt-b7ff15e79d8f2983b6689bde64cce3861f6af0ae.zip
blt-b7ff15e79d8f2983b6689bde64cce3861f6af0ae.tar.gz
blt-b7ff15e79d8f2983b6689bde64cce3861f6af0ae.tar.bz2
fix ps rotated text issue
Diffstat (limited to 'tkblt')
-rw-r--r--tkblt/generic/tkbltGrPSOutput.C11
1 files changed, 8 insertions, 3 deletions
diff --git a/tkblt/generic/tkbltGrPSOutput.C b/tkblt/generic/tkbltGrPSOutput.C
index 01a3101..155a723 100644
--- a/tkblt/generic/tkbltGrPSOutput.C
+++ b/tkblt/generic/tkbltGrPSOutput.C
@@ -732,6 +732,9 @@ void PSOutput::prolog()
" /yoffset exch def\n"
" /xoffset exch def\n"
" /strings exch def\n"
+" /yy exch def\n"
+" /xx exch def\n"
+" /rr exch def\n"
" % Compute the baseline offset and the actual font height.\n"
" 0 0 moveto baselineSampler false charpath\n"
" pathbbox dup /baseline exch def\n"
@@ -749,12 +752,14 @@ void PSOutput::prolog()
" strings length height mul /hh exch def\n"
" newpath\n"
" % Translate to x,y\n"
-" translate\n"
+" xx yy translate\n"
" % Translate to offset\n"
-" ww xoffset mul hh yoffset mul translate\n"
+" xoffset rr cos mul yoffset rr sin mul add /xxo exch def\n"
+" xoffset rr sin mul neg yoffset rr cos mul add /yyo exch def\n"
+" ww xxo mul hh yyo mul translate\n"
" % rotate\n"
" ww 2 div hh 2 div translate\n"
-" neg rotate\n"
+" rr neg rotate\n"
" ww -2 div hh -2 div translate\n"
" % Translate to justify and baseline\n"
" justify ww mul baseline translate\n"