~ubuntu-branches/ubuntu/oneiric/ghostscript/oneiric

« back to all changes in this revision

Viewing changes to Resource/Init/pdf_ops.ps

  • Committer: Bazaar Package Importer
  • Author(s): Till Kamppeter
  • Date: 2011-07-15 16:49:55 UTC
  • mfrom: (1.1.23 upstream)
  • Revision ID: james.westby@ubuntu.com-20110715164955-uga6qibao6kez05c
Tags: 9.04~dfsg~20110715-0ubuntu1
* New upstream release
   - GIT snapshot from Jult, 12 2011.
* debian/patches/020110406~a54df2d.patch,
  debian/patches/020110408~0791cc8.patch,
  debian/patches/020110408~507cbee.patch,
  debian/patches/020110411~4509a49.patch,
  debian/patches/020110412~78bb9a6.patch,
  debian/patches/020110418~a05ab8a.patch,
  debian/patches/020110420~20b6c78.patch,
  debian/patches/020110420~4ddefa2.patch: Removed upstream patches.
* debian/rules: Generate ABI version number (variable "abi") correctly,
  cutting off repackaging and pre-release parts.
* debian/rules: Added ./lcms2/ directory to DEB_UPSTREAM_REPACKAGE_EXCLUDES.
* debian/copyright: Added lcms2/* to the list of excluded files.
* debian/symbols.common: Updated for new upstream source. Applied patch
  which dpkg-gensymbols generated for debian/libgs9.symbols to this file.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
%    Copyright (C) 1994, 2000 Aladdin Enterprises.  All rights reserved.
2
 
 
2
%
3
3
% This software is provided AS-IS with no warranty, either express or
4
4
% implied.
5
 
 
5
%
6
6
% This software is distributed under license and may not be copied,
7
7
% modified or distributed except as expressly authorized under the terms
8
8
% of the license contained in the file LICENSE in this distribution.
9
 
 
9
%
10
10
% For more information about licensing, please refer to
11
11
% http://www.ghostscript.com/licensing/. For information on
12
12
% commercial licensing, go to http://www.artifex.com/licensing/ or
13
13
% contact Artifex Software, Inc., 101 Lucas Valley Road #110,
14
14
% San Rafael, CA  94903, U.S.A., +1(415)492-9861.
15
15
 
16
 
% $Id: pdf_ops.ps 12302 2011-03-19 00:32:37Z ray $
 
16
% $Id$
17
17
% Definitions for most of the PDF operators.
18
18
 
19
19
.currentglobal //true .setglobal
216
216
      pop //cspattern //nullpattern matrix makepattern
217
217
    } {
218
218
      //nullpattern matrix makepattern 1 index 1 get csset
219
 
                % Stack: patternspace nullpattern basecolor basespace
 
219
                % Stack: patternspace nullpattern basecolor basespace
220
220
      pop [ 3 1 roll dup type /arraytype eq { aload pop } if
221
221
      counttomark -1 roll ] cvx
222
222
    } ifelse
296
296
      } {
297
297
        1 .setshapealpha  exch .setopacityalpha 0
298
298
      } ifelse
299
 
        % Set the soft mask by rendering the XObject.  Doing this every time
300
 
        % is obviously very inefficient; we'll improve it later.
301
 
      .settransparencymask    
 
299
        % Set the soft mask by rendering the XObject.  Doing this every time
 
300
        % is obviously very inefficient; we'll improve it later.
 
301
      .settransparencymask
302
302
    } {
303
303
      pop pop
304
304
    } ifelse
371
371
       } ifelse
372
372
     } if
373
373
 
374
 
     % Associate pattern instance with the default qstate for the context. 
 
374
     % Associate pattern instance with the default qstate for the context.
375
375
     % A single pattren object can be reused in several contexts.
376
376
     dup DefaultQstate .knownget {
377
377
       exch pop
459
459
 
460
460
/B {
461
461
  OFFlevels length 0 eq {
462
 
         PDFusingtransparency {
463
 
                % knockout trans group around the filled and stroked object
464
 
                mark
465
 
                /Isolated //true /Knockout //true
466
 
                .dicttomark
467
 
                % strokepath will return empty path (no currentpoint) if nothing is stroked
468
 
                gsave { strokepath pathbbox } stopped grestore not {
469
 
            1 .setopacityalpha 
470
 
                        .begintransparencygroup
471
 
                        gsave setfillstate fill grestore
472
 
                        setstrokestate .swapcolors /stroke fsexec .swapcolors
473
 
                        .endtransparencygroup
474
 
                } { newpath pop } ifelse
475
 
         } {
476
 
                gsave setfillstate fill grestore
477
 
                setstrokestate .swapcolors /stroke fsexec .swapcolors   
478
 
        } ifelse
 
462
         PDFusingtransparency {
 
463
                % knockout trans group around the filled and stroked object
 
464
                mark
 
465
                /Isolated //true /Knockout //true
 
466
                .dicttomark
 
467
                % strokepath will return empty path (no currentpoint) if nothing is stroked
 
468
                gsave { strokepath pathbbox } stopped grestore not {
 
469
            1 .setopacityalpha
 
470
                        .begintransparencygroup
 
471
                        gsave setfillstate fill grestore
 
472
                        setstrokestate .swapcolors /stroke fsexec .swapcolors
 
473
                        .endtransparencygroup
 
474
                } { newpath pop } ifelse
 
475
         } {
 
476
                gsave setfillstate fill grestore
 
477
                setstrokestate .swapcolors /stroke fsexec .swapcolors
 
478
        } ifelse
479
479
  } {
480
480
    newpath
481
481
  } ifelse
485
485
 
486
486
/B* {
487
487
  OFFlevels length 0 eq {
488
 
         PDFusingtransparency {
489
 
                % knockout trans group around the filled and stroked object
490
 
                mark
491
 
                /Isolated //true /Knockout //true
492
 
                .dicttomark
493
 
                % strokepath will return empty path (no currentpoint) if nothing is stroked
494
 
                gsave { strokepath pathbbox } stopped grestore not {
 
488
         PDFusingtransparency {
 
489
                % knockout trans group around the filled and stroked object
 
490
                mark
 
491
                /Isolated //true /Knockout //true
 
492
                .dicttomark
 
493
                % strokepath will return empty path (no currentpoint) if nothing is stroked
 
494
                gsave { strokepath pathbbox } stopped grestore not {
495
495
            1 .setopacityalpha
496
 
                        .begintransparencygroup
497
 
                        gsave setfillstate eofill grestore
498
 
                        setstrokestate .swapcolors /stroke fsexec .swapcolors
499
 
                        .endtransparencygroup
500
 
                } { newpath pop } ifelse
501
 
         } {
502
 
                gsave setfillstate eofill grestore
503
 
                setstrokestate .swapcolors /stroke fsexec .swapcolors   
504
 
        } ifelse
 
496
                        .begintransparencygroup
 
497
                        gsave setfillstate eofill grestore
 
498
                        setstrokestate .swapcolors /stroke fsexec .swapcolors
 
499
                        .endtransparencygroup
 
500
                } { newpath pop } ifelse
 
501
         } {
 
502
                gsave setfillstate eofill grestore
 
503
                setstrokestate .swapcolors /stroke fsexec .swapcolors
 
504
        } ifelse
505
505
  } {
506
506
    newpath
507
507
  } ifelse
551
551
  TextFont dup //null eq { pop } { setfont } ifelse
552
552
} bdef
553
553
/settextstate {
554
 
        % The text state can be set even outside BT/ET.
 
554
        % The text state can be set even outside BT/ET.
555
555
  currentdict /TextSaveMatrix known {
556
556
    TextSaveMatrix setmatrix settextmatrix
557
557
  } if
558
558
} bdef
559
559
/settextposition {
560
 
                % Update the TextMatrix translation.
 
560
                % Update the TextMatrix translation.
561
561
  gsave TextSaveMatrix setmatrix
562
562
  currentpoint TextRise sub TextMatrix 4 2 getinterval astore pop
563
 
                % We would like to do "grestore currentpoint translate"
564
 
                % here, but some PDF files set a singular text matrix
565
 
                % (0 0 0 0 <x> <y> Tm), so we can't do this.
 
563
                % We would like to do "grestore currentpoint translate"
 
564
                % here, but some PDF files set a singular text matrix
 
565
                % (0 0 0 0 <x> <y> Tm), so we can't do this.
566
566
  TextTempMatrix identmatrix setmatrix currentpoint
567
567
  grestore
568
568
  TextTempMatrix currentmatrix 4 2 getinterval astore pop
606
606
    % Worker procedure for testing a single font matrix
607
607
/?FontMatrixNonHV {                 % ?horz <<fontdict>> -- ?horz ?nonhv
608
608
    /FontMatrix .knownget {
609
 
        1 index { 1 } { 2 } ifelse get 0 ne
 
609
        1 index { 1 } { 2 } ifelse get 0 ne
610
610
    } {
611
 
        //false
 
611
        //false
612
612
    } ifelse
613
613
} bdef
614
614
    % Worker procedure for recursive checking of font matrices
615
615
/?FontMatrixNonHV {                 % {self} ?horz <<font>> -- {self} ?horz ?nonhv
616
616
    2 copy //?FontMatrixNonHV exec {        % check the font's own FontMatrix
617
 
        pop pop //true
 
617
        pop pop //true
618
618
    } {
619
 
        % look for descendents/ components
620
 
        pop                                 % {self} ?horz <<font>>
621
 
        dup /FontType get
622
 
        dup 0 eq {                          % Type 0: look into FDepVector
623
 
            pop /FDepVector get 2 index     % {self} ?horz [fonts..] {testproc}
624
 
        } {
625
 
            9 eq {                          % Type 9 (CIDFontType 0): check FDArray
626
 
                /FDArray get //?FontMatrixNonHV
627
 
            } {                             % all others: nothing more to check
628
 
                pop {} {}
629
 
            } ifelse
630
 
        } ifelse
631
 
        %stack: {self} ?horz [fonts..] {testproc}
632
 
        //false 5 2 roll {                  % {testproc} false {self} ?horz <<subfont>>
633
 
            4 index exec {
634
 
                4 -1 roll pop //true 4 1 roll
635
 
                exit
636
 
            } if
637
 
        } forall
638
 
        %stack: {testproc} ?nonhv {self} ?horz
639
 
        4 2 roll exch pop
 
619
        % look for descendents/ components
 
620
        pop                                 % {self} ?horz <<font>>
 
621
        dup /FontType get
 
622
        dup 0 eq {                          % Type 0: look into FDepVector
 
623
            pop /FDepVector get 2 index     % {self} ?horz [fonts..] {testproc}
 
624
        } {
 
625
            9 eq {                          % Type 9 (CIDFontType 0): check FDArray
 
626
                /FDArray get //?FontMatrixNonHV
 
627
            } {                             % all others: nothing more to check
 
628
                pop {} {}
 
629
            } ifelse
 
630
        } ifelse
 
631
        %stack: {self} ?horz [fonts..] {testproc}
 
632
        //false 5 2 roll {                  % {testproc} false {self} ?horz <<subfont>>
 
633
            4 index exec {
 
634
                4 -1 roll pop //true 4 1 roll
 
635
                exit
 
636
            } if
 
637
        } forall
 
638
        %stack: {testproc} ?nonhv {self} ?horz
 
639
        4 2 roll exch pop
640
640
    } ifelse
641
641
} bdef
642
642
    % Main procedure
678
678
 { 1 index /FID known
679
679
   1 index { 2 index /UniqueID known or 2 index /XUID known or } if
680
680
    {           % We add 1 to the length just in case the original
681
 
                % didn't have a FID.
 
681
                % didn't have a FID.
682
682
      exch dup length 1 add dict exch
683
683
       {                % Stack: changed newfont key value
684
 
         1 index /FID eq 4 index
685
 
          { 2 index /UniqueID eq or 2 index /XUID eq or }
686
 
         if not { 3 copy put } if pop pop
 
684
         1 index /FID eq 4 index
 
685
          { 2 index /UniqueID eq or 2 index /XUID eq or }
 
686
         if not { 3 copy put } if pop pop
687
687
       }
688
688
      forall exch
689
689
    }
694
694
% Return a possibly updated font, and a flag to indicate whether
695
695
% the font was actually copied.
696
696
/.updatefontmetrics {   % <font> <Metrics|null> .updatefontmetrics
697
 
                        %   <font'> <copied>
 
697
                        %   <font'> <copied>
698
698
  dup //null ne {
699
699
    exch //true .copyfontdict dup /Metrics 4 -1 roll put //true
700
700
  } {
703
703
} bdef
704
704
 
705
705
/.updatefontencoding {  % <font> <Encoding|null> .updatefontencoding
706
 
                        %   <font'> <copied>
 
706
                        %   <font'> <copied>
707
707
  dup //null ne { dup 2 index /Encoding get ne } { //false } ifelse {
708
708
    exch //false .copyfontdict dup /Encoding 4 -1 roll put //true
709
709
  } {
772
772
} bind def
773
773
 
774
774
/textrenderingprocs [           % (0 is handled specially)
775
 
        % Painting-only modes
 
775
        % Painting-only modes
776
776
   { tf } { tS } { tB } { tn }
777
 
        % Clipping modes
 
777
        % Clipping modes
778
778
   { gsave tf grestore tW }
779
779
   { gsave tS grestore tW }
780
780
   { gsave tB grestore tW }
782
782
] readonly def
783
783
 
784
784
/pdfwrite_textrenderingprocs [
785
 
        % Tr 0 - Fill
786
 
        { setfillstate show } bind
787
 
        % Tr 1 - Stroke
788
 
        { currentlinewidth exch setstrokestate
 
785
        % Tr 0 - Fill
 
786
        { setfillstate show } bind
 
787
        % Tr 1 - Stroke
 
788
        { currentlinewidth exch setstrokestate
789
789
        % Need to set the stroke width to a value which gives the correct
790
790
        % width under pdfwrite. Pdfwrite uses (in text mode) an identity
791
791
        % CTM, so we need to calculate the stroke width which would result
792
 
        % if the CTM had been unity. 
793
 
          currentlinewidth dup
794
 
          matrix defaultmatrix idtransform TextSaveMatrix dtransform
795
 
          2 copy eq {
 
792
        % if the CTM had been unity.
 
793
          currentlinewidth dup
 
794
          matrix defaultmatrix idtransform TextSaveMatrix dtransform
 
795
          2 copy eq {
796
796
          pop
797
797
        }{
798
 
          % non-square scaling reduces to Text matrix in pdfwrite , so 
 
798
          % non-square scaling reduces to Text matrix in pdfwrite , so
799
799
          % we can ignore it. (wrong answer, but consistent)
800
800
          pop pop currentlinewidth
801
801
        }ifelse setlinewidth
802
802
        .swapcolors show .swapcolors setlinewidth} bind
803
 
        % Tr 2 - Fill then Stroke
804
 
        { gsave 0 .settextrenderingmode 
805
 
          setfillstate dup show currentpoint 3 -1 roll 
806
 
          grestore gsave setstrokestate
807
 
        //false charpath 
808
 
        % We need to make sure the matrix used for the stroke
809
 
        % and therefore stroke width does not include the 
810
 
        % Text Matrix Tm.
811
 
        TextSaveMatrix setmatrix
812
 
        .swapcolors
813
 
        stroke 
814
 
        .swapcolors
815
 
          grestore moveto
816
 
        } bind
817
 
        % Tr 3 - Neither fill nor stroke
818
 
        { setfillstate show } bind
819
 
        % Tr 4 - Fill, add to clip
820
 
        { gsave 0 .settextrenderingmode 
821
 
          setfillstate dup show grestore //true charpath } bind
822
 
        % Tr 5 - Stroke, add to clip
823
 
        { gsave 1 .settextrenderingmode 
824
 
          setstrokestate dup .swapcolors show .swapcolors grestore
825
 
          //true charpath } bind
826
 
        % Tr 6 - Fill, stroke, add to clip
827
 
        { gsave 0 .settextrenderingmode 
828
 
          setfillstate dup show grestore gsave dup 
829
 
          setstrokestate //false charpath 
830
 
        % We need to make sure the matrix used for the stroke
831
 
        % and therefore stroke width does not include the 
832
 
        % Text Matrix Tm.
833
 
        TextSaveMatrix setmatrix
834
 
        .swapcolors
835
 
        stroke .swapcolors grestore 
836
 
          //true charpath } bind
837
 
        % Tr 7 - Add to clip
838
 
        { //true charpath } bind
 
803
        % Tr 2 - Fill then Stroke
 
804
        { gsave 0 .settextrenderingmode
 
805
          setfillstate dup show currentpoint 3 -1 roll
 
806
          grestore gsave setstrokestate
 
807
        //false charpath
 
808
        % We need to make sure the matrix used for the stroke
 
809
        % and therefore stroke width does not include the
 
810
        % Text Matrix Tm.
 
811
        TextSaveMatrix setmatrix
 
812
        .swapcolors
 
813
        stroke
 
814
        .swapcolors
 
815
          grestore moveto
 
816
        } bind
 
817
        % Tr 3 - Neither fill nor stroke
 
818
        { setfillstate show } bind
 
819
        % Tr 4 - Fill, add to clip
 
820
        { gsave 0 .settextrenderingmode
 
821
          setfillstate dup show grestore //true charpath } bind
 
822
        % Tr 5 - Stroke, add to clip
 
823
        { gsave 1 .settextrenderingmode
 
824
          setstrokestate dup .swapcolors show .swapcolors grestore
 
825
          //true charpath } bind
 
826
        % Tr 6 - Fill, stroke, add to clip
 
827
        { gsave 0 .settextrenderingmode
 
828
          setfillstate dup show grestore gsave dup
 
829
          setstrokestate //false charpath
 
830
        % We need to make sure the matrix used for the stroke
 
831
        % and therefore stroke width does not include the
 
832
        % Text Matrix Tm.
 
833
        TextSaveMatrix setmatrix
 
834
        .swapcolors
 
835
        stroke .swapcolors grestore
 
836
          //true charpath } bind
 
837
        % Tr 7 - Add to clip
 
838
        { //true charpath } bind
839
839
] readonly def
840
840
 
841
841
/setshowstate
842
842
 { WordSpacing 0 eq TextSpacing 0 eq and FontMatrixNonHV not and
843
 
    { 
 
843
    {
844
844
      % Check to see if the current device supports Tr
845
845
      currentdevice 1 dict dup /PreserveTrMode dup put .getdeviceparams
846
846
      dup type /booleantype eq not {cleartomark //false}{3 1 roll cleartomark}ifelse
847
 
        {
848
 
                pdfwrite_textrenderingprocs TextRenderingMode get
849
 
        }
850
 
        {
851
 
                TextRenderingMode 0 eq {
852
 
                { setfillstate show }
853
 
              } {
854
 
                TextRenderingMode 3 eq {
855
 
                        % Some PDF files execute 'tm' with a singular matrix,
856
 
                        % and then use the text rendering mode 3.
857
 
                        % The graphics library currently cannot handle text
858
 
                        % operations when the CTM is singular.
859
 
                        % Work around this here.
860
 
                  {     
861
 
                    matrix currentmatrix dup dup
862
 
                    dup 0 get 0 eq 1 index 1 get 0 eq and {
863
 
                      dup dup 2 get 0 eq { 0 }{ 1 } ifelse 1 put
864
 
                    } if
865
 
                    dup 2 get 0 eq 1 index 3 get 0 eq and {
866
 
                      dup dup 1 get 0 eq { 3 }{ 2 } ifelse 1 put
867
 
                    } if
868
 
                    setmatrix
869
 
                    2 index setfillstate show % Tr was set to graphic state.
870
 
                    setmatrix 
871
 
                    % now set the currentpoint using the original matrix
872
 
                    gsave
873
 
                    setmatrix
874
 
                    //false charpath currentpoint newpath 
875
 
                    grestore
876
 
                    moveto
877
 
                  }
878
 
                } {
879
 
                  { //false charpath textrenderingprocs TextRenderingMode get exec }
880
 
                } ifelse
881
 
              } ifelse
882
 
        } ifelse
 
847
        {
 
848
                pdfwrite_textrenderingprocs TextRenderingMode get
 
849
        }
 
850
        {
 
851
                TextRenderingMode 0 eq {
 
852
                { setfillstate show }
 
853
              } {
 
854
                TextRenderingMode 3 eq {
 
855
                        % Some PDF files execute 'tm' with a singular matrix,
 
856
                        % and then use the text rendering mode 3.
 
857
                        % The graphics library currently cannot handle text
 
858
                        % operations when the CTM is singular.
 
859
                        % Work around this here.
 
860
                  {
 
861
                    matrix currentmatrix dup dup
 
862
                    dup 0 get 0 eq 1 index 1 get 0 eq and {
 
863
                      dup dup 2 get 0 eq { 0 }{ 1 } ifelse 1 put
 
864
                    } if
 
865
                    dup 2 get 0 eq 1 index 3 get 0 eq and {
 
866
                      dup dup 1 get 0 eq { 3 }{ 2 } ifelse 1 put
 
867
                    } if
 
868
                    setmatrix
 
869
                    2 index setfillstate show % Tr was set to graphic state.
 
870
                    setmatrix
 
871
                    % now set the currentpoint using the original matrix
 
872
                    gsave
 
873
                    setmatrix
 
874
                    //false charpath currentpoint newpath
 
875
                    grestore
 
876
                    moveto
 
877
                  }
 
878
                } {
 
879
                  { //false charpath textrenderingprocs TextRenderingMode get exec }
 
880
                } ifelse
 
881
              } ifelse
 
882
        } ifelse
883
883
    }
884
884
    { TextRenderingMode 0 eq TextRenderingMode 3 eq or
885
885
       % Tr was set to graphic state.
888
888
             setfillstate
889
889
             [ TextSpacing WordSpacing 3 index
890
890
               {                                            % str [... weach wword c undef|ythis xthis|undef
891
 
                 exch % will be removed, unless FontMatrix.xx/yy == 0 (FontMatrixNonHV already true)
 
891
                 exch % will be removed, unless FontMatrix.xx/yy == 0 (FontMatrixNonHV already true)
892
892
                 Vexch pop                                  % str [... weach wword c wthis
893
893
                 3 index add exch 32 eq {1 index add} if    % str [... weach wword w
894
894
                 3 1 roll                                   % str [... w weach wword
895
895
               }
896
896
               % for the "exch" removed or not below, see comment in pdf_font.ps::getfontmetrics
897
 
               currentfont /FontMatrix get 0 3 Vexch pop get 0 ne {
898
 
                 1 1 index length 1 sub getinterval cvx
899
 
               } if
900
 
               cshow pop pop ]
 
897
               currentfont /FontMatrix get 0 3 Vexch pop get 0 ne {
 
898
                 1 1 index length 1 sub getinterval cvx
 
899
               } if
 
900
               cshow pop pop ]
901
901
             { xshow } { yshow } Vexch pop exec
902
902
           }
903
903
         } {
904
904
           WordSpacing 0 eq
905
905
            { { setfillstate TextSpacing 0 Vexch 3 -1 roll ashow } }
906
 
            { TextSpacing 0 eq
 
906
            { TextSpacing 0 eq
907
907
              { { setfillstate WordSpacing 0 Vexch 32 4 -1 roll widthshow } }
908
908
              { { setfillstate WordSpacing 0 Vexch 32
909
909
                   TextSpacing 0 Vexch 6 -1 roll awidthshow } }
910
 
              ifelse
911
 
            }
912
 
           ifelse
 
910
              ifelse
 
911
            }
 
912
           ifelse
913
913
         } ifelse
914
914
       }
915
915
       { { WordSpacing TextSpacing
916
 
                        % Implement the combination of t3 and false charpath.
917
 
                        % Note that we must use cshow for this, because we
918
 
                        % can't parse multi-byte strings any other way.
919
 
                        % Stack: string wword wchar
920
 
            {
921
 
             exch % will be removed, unless FontMatrixNonHV && FontMatrix.xx/yy == 0
922
 
                        % Stack: str wword wchar ccode xthis ythis
923
 
             Vexch pop currentpoint 6 3 roll
924
 
                        % Stack: str wthis xorig yorig wword wchar ccode
925
 
             (x) dup 0 3 index put //false charpath
 
916
                        % Implement the combination of t3 and false charpath.
 
917
                        % Note that we must use cshow for this, because we
 
918
                        % can't parse multi-byte strings any other way.
 
919
                        % Stack: string wword wchar
 
920
            {
 
921
             exch % will be removed, unless FontMatrixNonHV && FontMatrix.xx/yy == 0
 
922
                        % Stack: str wword wchar ccode xthis ythis
 
923
             Vexch pop currentpoint 6 3 roll
 
924
                        % Stack: str wthis xorig yorig wword wchar ccode
 
925
             (x) dup 0 3 index put //false charpath
926
926
             3 copy 32 eq { add } { exch pop } ifelse
927
 
                        % Stack: str wthis xorig yorig wword wchar ccode wextra
 
927
                        % Stack: str wthis xorig yorig wword wchar ccode wextra
928
928
             7 -3 roll moveto add
929
929
             0 Vexch rmoveto pop
930
 
            }
 
930
            }
931
931
            % for the "exch" removed or not below, see comment in pdf_font.ps::getfontmetrics
932
 
            FontMatrixNonHV dup not exch {
933
 
              currentfont /FontMatrix get 0 3 Vexch pop get 0 ne
934
 
            } if {
935
 
              1 1 index length 1 sub getinterval cvx
936
 
            } if
937
 
           4 -1 roll cshow pop pop
938
 
           textrenderingprocs TextRenderingMode get exec
939
 
         }
 
932
            FontMatrixNonHV dup not exch {
 
933
              currentfont /FontMatrix get 0 3 Vexch pop get 0 ne
 
934
            } if {
 
935
              1 1 index length 1 sub getinterval cvx
 
936
            } if
 
937
           4 -1 roll cshow pop pop
 
938
           textrenderingprocs TextRenderingMode get exec
 
939
         }
940
940
       }
941
941
      ifelse
942
942
    }
989
989
% Handle transparency the same as /B operator
990
990
/tB {
991
991
       PDFusingtransparency {
992
 
          % knockout trans group around the filled and stroked object
993
 
          mark
994
 
          /Isolated //true /Knockout //true
995
 
          .dicttomark
996
 
          1 .setopacityalpha 
997
 
          % While text will always have a currentpoint, strokepath seems to mess with it.
998
 
          % we get the currentpoint, then use moveto to restore it for pathbbox
999
 
          gsave currentpoint strokepath moveto pathbbox grestore
1000
 
          .begintransparencygroup
1001
 
          gsave tf grestore tS
1002
 
          .endtransparencygroup
1003
 
        } {
1004
 
          gsave tf grestore tS
1005
 
        } ifelse
 
992
          % knockout trans group around the filled and stroked object
 
993
          mark
 
994
          /Isolated //true /Knockout //true
 
995
          .dicttomark
 
996
          1 .setopacityalpha
 
997
          % While text will always have a currentpoint, strokepath seems to mess with it.
 
998
          % we get the currentpoint, then use moveto to restore it for pathbbox
 
999
          gsave currentpoint strokepath moveto pathbbox grestore
 
1000
          .begintransparencygroup
 
1001
          gsave tf grestore tS
 
1002
          .endtransparencygroup
 
1003
        } {
 
1004
          gsave tf grestore tS
 
1005
        } ifelse
1006
1006
} bdef
1007
1007
 
1008
1008
% This does the wrong thing if there have been multiple text operations
1022
1022
  } {
1023
1023
    4 index 16#1000000 and 0 ne { % comb
1024
1024
      8 { pop } repeat (Combed form fields are not yet implemented.) =
1025
 
    } { % plain text                                       
 
1025
    } { % plain text
1026
1026
      3 1 roll sub add 2 div             % MaxLen (V) Ff Q dx (dy-yy+desc)/2
1027
1027
      0 exch moveto                      % MaxLen (V) Ff Q dx
1028
1028
      1 index 0 ne {