diff options
| -rw-r--r-- | lisp/ps-mule.el | 63 |
1 files changed, 49 insertions, 14 deletions
diff --git a/lisp/ps-mule.el b/lisp/ps-mule.el index ffc579a46bb..2287aa058c5 100644 --- a/lisp/ps-mule.el +++ b/lisp/ps-mule.el | |||
| @@ -574,16 +574,38 @@ STRING should contain only ASCII characters." | |||
| 574 | %% Working dictionary for general use. | 574 | %% Working dictionary for general use. |
| 575 | /MuleDict 10 dict def | 575 | /MuleDict 10 dict def |
| 576 | 576 | ||
| 577 | %% Adjust /RelativeCompose properly by checking /BaselineOffset. | ||
| 578 | /AdjustRelativeCompose { % fontdict |- fontdict | ||
| 579 | dup length 2 add dict begin | ||
| 580 | { 1 index /FID ne { def } { pop pop } ifelse } forall | ||
| 581 | currentdict /BaselineOffset known { | ||
| 582 | BaselineOffset false eq { /BaselinfOffset 0 def } if | ||
| 583 | } { | ||
| 584 | /BaselineOffset 0 def | ||
| 585 | } ifelse | ||
| 586 | currentdict /RelativeCompose known not { | ||
| 587 | /RelativeCompose [ 0 0 ] def | ||
| 588 | } { | ||
| 589 | RelativeCompose false ne { | ||
| 590 | [ BaselineOffset RelativeCompose BaselineOffset add | ||
| 591 | [ FontMatrix { FontSize div } forall ] transform ] | ||
| 592 | /RelativeCompose exch def | ||
| 593 | } if | ||
| 594 | } ifelse | ||
| 595 | currentdict | ||
| 596 | end | ||
| 597 | } def | ||
| 598 | |||
| 577 | %% Define already scaled font for non-ASCII character sets. | 599 | %% Define already scaled font for non-ASCII character sets. |
| 578 | /DefFontMule { % fontname size basefont |- -- | 600 | /DefFontMule { % fontname size basefont |- -- |
| 579 | findfont exch scalefont definefont pop | 601 | findfont exch scalefont AdjustRelativeCompose definefont pop |
| 580 | } bind def | 602 | } bind def |
| 581 | 603 | ||
| 582 | %% Define already scaled font for ASCII character sets. | 604 | %% Define already scaled font for ASCII character sets. |
| 583 | /DefAsciiFontMule { % fontname size basefont |- | 605 | /DefAsciiFontMule { % fontname size basefont |- |
| 584 | MuleDict begin | 606 | MuleDict begin |
| 585 | findfont dup /Encoding get /ISOLatin1Encoding exch def | 607 | findfont dup /Encoding get /ISOLatin1Encoding exch def |
| 586 | exch scalefont reencodeFontISO | 608 | exch scalefont AdjustRelativeCompose reencodeFontISO |
| 587 | end | 609 | end |
| 588 | } def | 610 | } def |
| 589 | 611 | ||
| @@ -727,10 +749,10 @@ the sequence." | |||
| 727 | currentfont /FontType get 3 eq { %ifelse | 749 | currentfont /FontType get 3 eq { %ifelse |
| 728 | stringwidth pop pop | 750 | stringwidth pop pop |
| 729 | } { | 751 | } { |
| 730 | currentpoint /y exch def pop | 752 | currentpoint /y exch def /x exch def |
| 731 | false charpath flattenpath pathbbox | 753 | false charpath flattenpath pathbbox |
| 732 | y sub /URY exch def pop | 754 | y sub /URY exch def x sub /URX exch def |
| 733 | y sub /LLY exch def pop | 755 | y sub /LLY exch def x sub /LLX exch def |
| 734 | } ifelse | 756 | } ifelse |
| 735 | grestore | 757 | grestore |
| 736 | } bind def | 758 | } bind def |
| @@ -752,7 +774,10 @@ the sequence." | |||
| 752 | grestore | 774 | grestore |
| 753 | /Effect Effectsave 8 32 add and def % enable only shadow and outline | 775 | /Effect Effectsave 8 32 add and def % enable only shadow and outline |
| 754 | false BG | 776 | false BG |
| 755 | gsave SpaceWidth mul 0 rmoveto dup GetPathBox S grestore | 777 | gsave |
| 778 | SpaceWidth mul 0 rmoveto dup GetPathBox S | ||
| 779 | /RIGHT currentpoint pop def | ||
| 780 | grestore | ||
| 756 | /y currentpoint exch pop def | 781 | /y currentpoint exch pop def |
| 757 | /HIGH URY y add def /LOW LLY y add def | 782 | /HIGH URY y add def /LOW LLY y add def |
| 758 | } bind def | 783 | } bind def |
| @@ -762,7 +787,11 @@ the sequence." | |||
| 762 | /bg bgsave def /bgcolor bgcolorsave def | 787 | /bg bgsave def /bgcolor bgcolorsave def |
| 763 | /Effect Effectsave def | 788 | /Effect Effectsave def |
| 764 | /Cmpchar false def | 789 | /Cmpchar false def |
| 765 | CmpcharWidth SpaceWidth mul 0 rmoveto | 790 | CmpcharRelativeCompose false eq { |
| 791 | CmpcharWidth SpaceWidth mul 0 rmoveto | ||
| 792 | } { | ||
| 793 | RIGHT currentpoint exch pop moveto | ||
| 794 | } ifelse | ||
| 766 | } bind def | 795 | } bind def |
| 767 | 796 | ||
| 768 | %% Rule base composition | 797 | %% Rule base composition |
| @@ -781,20 +810,26 @@ the sequence." | |||
| 781 | currentpoint pop btm LLY sub moveto | 810 | currentpoint pop btm LLY sub moveto |
| 782 | S | 811 | S |
| 783 | grestore | 812 | grestore |
| 813 | /CmpcharRelativeCompose false def | ||
| 784 | } bind def | 814 | } bind def |
| 785 | 815 | ||
| 786 | %% Relative composition | 816 | %% Relative composition |
| 787 | /RLC { % str |- -- | 817 | /RLC { % str |- -- |
| 788 | gsave | 818 | gsave |
| 789 | dup GetPathBox | 819 | dup GetPathBox |
| 790 | CmpcharRelativeCompose type /integertype eq { | 820 | LLX 0 lt { RIGHT currentpoint exch pop moveto } if |
| 791 | LLY CmpcharRelativeCompose gt { % compose on top | 821 | CmpcharRelativeCompose type /arraytype eq { |
| 822 | LLY CmpcharRelativeCompose 1 get gt { % compose on top | ||
| 792 | currentpoint pop HIGH LLY sub CmpcharRelativeSkip add moveto | 823 | currentpoint pop HIGH LLY sub CmpcharRelativeSkip add moveto |
| 793 | /HIGH HIGH URY LLY sub add CmpcharRelativeSkip add def | 824 | /HIGH HIGH URY LLY sub add CmpcharRelativeSkip add def |
| 794 | } { URY 0 le { % compose under bottom | 825 | } { URY CmpcharRelativeCompose 0 get le { % compose under bottom |
| 795 | currentpoint pop LOW LLY add CmpcharRelativeSkip sub moveto | 826 | currentpoint pop LOW URY sub CmpcharRelativeSkip sub moveto |
| 796 | /LOW LOW URY LLY sub sub CmpcharRelativeSkip sub def | 827 | /LOW LOW URY LLY sub sub CmpcharRelativeSkip sub def |
| 797 | } if } ifelse } if | 828 | } { |
| 829 | /y currentpoint exch pop def | ||
| 830 | y URY add dup HIGH gt { /HIGH exch def } { pop } ifelse | ||
| 831 | y LLY add dup LOW lt { /LOW exch def } { pop } ifelse | ||
| 832 | } ifelse } ifelse } if | ||
| 798 | S | 833 | S |
| 799 | grestore | 834 | grestore |
| 800 | } bind def | 835 | } bind def |
| @@ -958,9 +993,9 @@ NewBitmapDict | |||
| 958 | Cmpchar { %ifelse | 993 | Cmpchar { %ifelse |
| 959 | /FontMatrix get [ exch { size div } forall ] /mtrx exch def | 994 | /FontMatrix get [ exch { size div } forall ] /mtrx exch def |
| 960 | bmp 3 get bmp 4 get mtrx transform | 995 | bmp 3 get bmp 4 get mtrx transform |
| 961 | /LLY exch def pop | 996 | /LLY exch def /LLX exch def |
| 962 | bmp 1 get bmp 3 get add bmp 2 get bmp 4 get add mtrx transform | 997 | bmp 1 get bmp 3 get add bmp 2 get bmp 4 get add mtrx transform |
| 963 | /URY exch def pop | 998 | /URY exch def /URX exch def |
| 964 | } { | 999 | } { |
| 965 | pop | 1000 | pop |
| 966 | } ifelse | 1001 | } ifelse |