Variable: ps-mule-composition-prologue
ps-mule-composition-prologue is a variable defined in ps-mule.el.gz.
Value
"%%%% Procedures for character composition.\n/RelativeCompositionSkip 0.4 def\n\n%% Get a bounding box (relative to currentpoint) of STR.\n/GetPathBox { % [ str cname ] | -\n dup 1 get dup false ne {\n BitmapDict exch get /bmp exch def\n %% bmp ::= [ DWIDTH WIDTH HEIGHT XOFF YOFF BITMAP RELATIVE-COMPOSE]\n /LLY bmp 4 get def\n /URY LLY bmp 2 get add def\n /RelativeCompose bmp 6 get dup false ne {\n dup LLY le { pop 1 } { URY ge { -1 } { 0 } ifelse } ifelse\n } {\n pop 0\n } ifelse def\n dup 0 get stringwidth pop dup /WIDTH exch def bmp 0 get div\n dup LLY mul /LLY exch def\n URY mul /URY exch def\n } {\n pop\n dup 0 get stringwidth pop /WIDTH exch def\n gsave 0 0 moveto\n dup 0 get false charpath flattenpath pathbbox\n /URY exch def pop /LLY exch def pop\n grestore\n /RelativeCompose 0 def\n } ifelse\n} bind def\n\n%% Apply effects except for shadow and outline to the rectangle\n%% specified by TOP BOTTOM LEFT RIGHT.\n/SpecialEffect { % -- | --\n currentpoint dup TOP add /yy exch def BOTTOM add /YY exch def\n dup LEFT add /xx exch def RIGHT add /XX exch def\n %% Adjust positions for future shadowing.\n Effect 8 and 0 ne {\n /yy yy Yshadow add def\n /XX XX Xshadow add def\n } if\n Effect 1 and 0 ne { UnderlinePosition Hline } if % underline\n Effect 2 and 0 ne { StrikeoutPosition Hline } if % strikeout\n Effect 4 and 0 ne { OverlinePosition Hline } if % overline\n bg { % background\n true\n Effect 16 and 0 ne {SpaceBackground doBox} { xx yy XX YY doRect} ifelse\n } if\n Effect 16 and 0 ne { false 0 doBox } if % box\n} def\n\n%% Draw COMPONENTS which has the form [ [str0 xoff0 yoff0] ... ] with\n%% effects shadow and outline.\n/ShowComponents { % components | -\n gsave\n { gsave aload pop rmoveto\n Effect 8 and 0 ne { dup doShadow } if\n Effect 32 and 0 ne { true doOutline } { show } ifelse\n grestore\n } forall\n grestore\n RIGHT 0 rmoveto\n} def\n\n%% Show relative composition.\n/RLC { % [[str0 cname0] [str1 cname1] ... [strN cnameN]] | -\n /components exch def\n [ % push [str xoff yoff] one by one\n [ components 0 get GetPathBox aload pop pop 0 0 ]\n %% Bounding box of overall glyphs.\n /LEFT 0 def\n /RIGHT WIDTH def\n /TOP URY def\n /BOTTOM LLY def\n\n 1 1 components length 1 sub {\n components exch get\n [ exch\n GetPathBox\n aload pop pop % str\n 0 % xoff\n RelativeCompose 1 eq { % compose on TOP\n TOP LLY sub RelativeCompositionSkip add % yoff\n /TOP TOP URY LLY sub add RelativeCompositionSkip add def\n } { RelativeCompose -1 eq { % compose under BOTTOM\n BOTTOM URY sub RelativeCompositionSkip sub % yoff\n /BOTTOM BOTTOM URY LLY sub sub\n RelativeCompositionSkip sub def\n } {\n 0 % yoff\n URY TOP gt { /TOP URY def } if\n LLY BOTTOM lt { /BOTTOM LLY def } if\n } ifelse } ifelse\n ]\n } for\n ]\n SpecialEffect % Reflect special effects.\n ShowComponents % Draw components.\n} def\n\n%% Show rule-base composition.\n/RBC { % [[str0 cname0] rule1 [str1 cname0] rule2 ... [strN cnameN]] | -\n /components exch def\n [ % push [str xoff yoff] one by one\n [ components 0 get GetPathBox aload pop pop 0 0 ]\n %% Bounding box of overall glyphs.\n /LEFT 0 def\n /RIGHT WIDTH def\n /TOP URY def\n /BOTTOM LLY def\n 1 1 components length 1 sub {\n components exch get /elt exch def\n elt type /integertype eq { % rule\n %% Do the same RULE decoding as the macro\n %% COMPOSITION_DECODE_RULE in emacs/src/composite.h.\n elt 12 idiv dup 3 mod /grefx exch def 3 idiv /grefy exch def\n elt 12 mod dup 3 mod /nrefx exch def 3 idiv /nrefy exch def\n } { % other strings\n [\n elt GetPathBox\n aload pop pop\n /height URY LLY sub def\n /left LEFT [ 0 RIGHT LEFT sub dup 2 div exch ] grefx get add\n [ 0 WIDTH 2 div WIDTH ] nrefx get sub def\n /bottom [ TOP 0 BOTTOM TOP BOTTOM add 2 div ] grefy get\n [ height LLY neg 0 height 2 div ] nrefy get sub def\n %% Update bounding box\n left LEFT lt { /LEFT left def } if\n left WIDTH add RIGHT gt { /RIGHT left WIDTH add def } if\n bottom BOTTOM lt { /BOTTOM bottom def } if\n bottom height add TOP gt { /TOP bottom height add def } if\n left bottom LLY sub ]\n } ifelse\n } for\n ]\n\n LEFT 0 lt { % Adjust xoff to the right.\n dup { dup 1 get LEFT sub 1 exch put } forall\n /RIGHT RIGHT LEFT sub def\n } if\n\n SpecialEffect % Reflect special effects.\n ShowComponents % Draw components.\n} def\n\n%%%% End of procedures for character composition\n"
Documentation
PostScript code for printing character composition.
Source Code
;; Defined in /usr/src/emacs/lisp/ps-mule.el.gz
(defconst ps-mule-composition-prologue
"%%%% Procedures for character composition.
/RelativeCompositionSkip 0.4 def
%% Get a bounding box (relative to currentpoint) of STR.
/GetPathBox { % [ str cname ] | -
dup 1 get dup false ne {
BitmapDict exch get /bmp exch def
%% bmp ::= [ DWIDTH WIDTH HEIGHT XOFF YOFF BITMAP RELATIVE-COMPOSE]
/LLY bmp 4 get def
/URY LLY bmp 2 get add def
/RelativeCompose bmp 6 get dup false ne {
dup LLY le { pop 1 } { URY ge { -1 } { 0 } ifelse } ifelse
} {
pop 0
} ifelse def
dup 0 get stringwidth pop dup /WIDTH exch def bmp 0 get div
dup LLY mul /LLY exch def
URY mul /URY exch def
} {
pop
dup 0 get stringwidth pop /WIDTH exch def
gsave 0 0 moveto
dup 0 get false charpath flattenpath pathbbox
/URY exch def pop /LLY exch def pop
grestore
/RelativeCompose 0 def
} ifelse
} bind def
%% Apply effects except for shadow and outline to the rectangle
%% specified by TOP BOTTOM LEFT RIGHT.
/SpecialEffect { % -- | --
currentpoint dup TOP add /yy exch def BOTTOM add /YY exch def
dup LEFT add /xx exch def RIGHT add /XX exch def
%% Adjust positions for future shadowing.
Effect 8 and 0 ne {
/yy yy Yshadow add def
/XX XX Xshadow add def
} if
Effect 1 and 0 ne { UnderlinePosition Hline } if % underline
Effect 2 and 0 ne { StrikeoutPosition Hline } if % strikeout
Effect 4 and 0 ne { OverlinePosition Hline } if % overline
bg { % background
true
Effect 16 and 0 ne {SpaceBackground doBox} { xx yy XX YY doRect} ifelse
} if
Effect 16 and 0 ne { false 0 doBox } if % box
} def
%% Draw COMPONENTS which has the form [ [str0 xoff0 yoff0] ... ] with
%% effects shadow and outline.
/ShowComponents { % components | -
gsave
{ gsave aload pop rmoveto
Effect 8 and 0 ne { dup doShadow } if
Effect 32 and 0 ne { true doOutline } { show } ifelse
grestore
} forall
grestore
RIGHT 0 rmoveto
} def
%% Show relative composition.
/RLC { % [[str0 cname0] [str1 cname1] ... [strN cnameN]] | -
/components exch def
[ % push [str xoff yoff] one by one
[ components 0 get GetPathBox aload pop pop 0 0 ]
%% Bounding box of overall glyphs.
/LEFT 0 def
/RIGHT WIDTH def
/TOP URY def
/BOTTOM LLY def
1 1 components length 1 sub {
components exch get
[ exch
GetPathBox
aload pop pop % str
0 % xoff
RelativeCompose 1 eq { % compose on TOP
TOP LLY sub RelativeCompositionSkip add % yoff
/TOP TOP URY LLY sub add RelativeCompositionSkip add def
} { RelativeCompose -1 eq { % compose under BOTTOM
BOTTOM URY sub RelativeCompositionSkip sub % yoff
/BOTTOM BOTTOM URY LLY sub sub
RelativeCompositionSkip sub def
} {
0 % yoff
URY TOP gt { /TOP URY def } if
LLY BOTTOM lt { /BOTTOM LLY def } if
} ifelse } ifelse
]
} for
]
SpecialEffect % Reflect special effects.
ShowComponents % Draw components.
} def
%% Show rule-base composition.
/RBC { % [[str0 cname0] rule1 [str1 cname0] rule2 ... [strN cnameN]] | -
/components exch def
[ % push [str xoff yoff] one by one
[ components 0 get GetPathBox aload pop pop 0 0 ]
%% Bounding box of overall glyphs.
/LEFT 0 def
/RIGHT WIDTH def
/TOP URY def
/BOTTOM LLY def
1 1 components length 1 sub {
components exch get /elt exch def
elt type /integertype eq { % rule
%% Do the same RULE decoding as the macro
%% COMPOSITION_DECODE_RULE in emacs/src/composite.h.
elt 12 idiv dup 3 mod /grefx exch def 3 idiv /grefy exch def
elt 12 mod dup 3 mod /nrefx exch def 3 idiv /nrefy exch def
} { % other strings
[
elt GetPathBox
aload pop pop
/height URY LLY sub def
/left LEFT [ 0 RIGHT LEFT sub dup 2 div exch ] grefx get add
[ 0 WIDTH 2 div WIDTH ] nrefx get sub def
/bottom [ TOP 0 BOTTOM TOP BOTTOM add 2 div ] grefy get
[ height LLY neg 0 height 2 div ] nrefy get sub def
%% Update bounding box
left LEFT lt { /LEFT left def } if
left WIDTH add RIGHT gt { /RIGHT left WIDTH add def } if
bottom BOTTOM lt { /BOTTOM bottom def } if
bottom height add TOP gt { /TOP bottom height add def } if
left bottom LLY sub ]
} ifelse
} for
]
LEFT 0 lt { % Adjust xoff to the right.
dup { dup 1 get LEFT sub 1 exch put } forall
/RIGHT RIGHT LEFT sub def
} if
SpecialEffect % Reflect special effects.
ShowComponents % Draw components.
} def
%%%% End of procedures for character composition
"
"PostScript code for printing character composition.")