diff options
author | Alex Cherepanov <alex.cherepanov@artifex.com> | 2012-04-25 17:33:59 -0400 |
---|---|---|
committer | Alex Cherepanov <alex.cherepanov@artifex.com> | 2012-04-25 17:33:59 -0400 |
commit | 012aef926d1e33cc64c32bf8e94ef92a299d73f9 (patch) | |
tree | e8b886935c6077d4c7d267eb0a8e584cf6d09dd2 | |
parent | 70d513095fba13b20e6bba5bb77805b5233028d1 (diff) |
Bug 692243: Replace dictionary look-up with .execn
Replace a fragment that stores line width in a dictionary with an equivalent
code that uses execution stack and .execn . These tricks are needed to keep
the stack depth constant.
-rw-r--r-- | gs/Resource/Init/pdf_ops.ps | 68 |
1 files changed, 31 insertions, 37 deletions
diff --git a/gs/Resource/Init/pdf_ops.ps b/gs/Resource/Init/pdf_ops.ps index 6c8f5925b..d834e5735 100644 --- a/gs/Resource/Init/pdf_ops.ps +++ b/gs/Resource/Init/pdf_ops.ps @@ -975,43 +975,37 @@ end readonly def setlinewidth } } { - WordSpacing 0 eq - { { - % preserve current line width around possible stroke setup - % This *should* work the same as the others by using - % currentlinewidth...setlinewidth, but it doesn't. In particular - % Bug688796b.pdf throws an error. I am unabel to understand why. - /MyDict 5 dict def - MyDict begin - /SaveLW currentlinewidth def end - - setstrokeforTrpreservation - setfillstate TextSpacing 0 Vexch 3 -1 roll ashow - - MyDict begin - SaveLW setlinewidth - end - } } - { - TextSpacing 0 eq - { { - % preserve current line width around possible stroke setup - currentlinewidth exch - setstrokeforTrpreservation - setfillstate WordSpacing 0 Vexch 32 4 -1 roll widthshow - setlinewidth - } } - { { - % preserve current line width around possible stroke setup - currentlinewidth exch - setstrokeforTrpreservation - setfillstate WordSpacing 0 Vexch 32 - TextSpacing 0 Vexch 6 -1 roll awidthshow - setlinewidth - } } - ifelse - } - ifelse + WordSpacing 0 eq { + { + { setstrokeforTrpreservation + setfillstate TextSpacing 0 Vexch 3 -1 roll ashow + } + currentlinewidth + { setlinewidth } + 3 .execn + } + } { + TextSpacing 0 eq { + { % preserve current line width around possible stroke setup + { setstrokeforTrpreservation + setfillstate WordSpacing 0 Vexch 32 4 -1 roll widthshow + } + currentlinewidth + { setlinewidth } + 3 .execn + } + } { + { % preserve current line width around possible stroke setup + { setstrokeforTrpreservation + setfillstate WordSpacing 0 Vexch 32 + TextSpacing 0 Vexch 6 -1 roll awidthshow + } + currentlinewidth + { setlinewidth } + 3 .execn + } + } ifelse + } ifelse } ifelse } { |