Subversion-Projekte lars-tiefland.php_share

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
1 lars 1
% $Header: /cvsroot/html2ps/postscript/flow.block.ps,v 1.1 2005/12/18 07:21:38 Konstantin Exp $
2
 
3
% Shorthand for
4
%   $this->_current_x = $context->float_left_x($this->_current_x, $this->_current_y);
5
% in PHP
6
%
7
/offset-x-floats {                % => Box
8
  dup get-current-x
9
  1 index get-current-y           % => Box X Y
10
  float-left-x                    % => Box X
11
  1 index
12
  put-current-x
13
  pop
14
} def
15
 
16
% Close line subroutine; checks if text justification
17
% is needed and applies it to the line-box content
18
/close-line-justify {              % => Box
19
  dup get-line dup length 1 gt {   % => Box Line
20
    pop
21
    dup get-text-align             % => Box AlignFunction
22
    1 index exch                   % => Box Box AlignFunction
23
    exec                           % => Box
24
  } {
25
    dup length 0 gt {
26
 
27
      get-local-align              % => Box LA
28
      1 index exch                 % => Box Box LA
29
      exec                         % => Box
30
    } {
31
      pop
32
      dup get-text-align          % => Box AlignFunction
33
      1 index exch                % => Box Box AlignFunction
34
      exec                        % => Box
35
    } ifelse
36
  } ifelse
37
} def
38
 
39
/close-line {                      % => Box
40
% make line justification
41
 
42
% Note that text-align should not be applied to the block boxes!
43
% As block boxes will be alone in the line-box, we can check
44
% if the very first box in the line is inline; if not - no justification should be made
45
  dup get-line length 0 gt {
46
    dup get-line 0 get is-inline {
47
      close-line-justify
48
    } {
49
% Nevertheless, CENTER tag and P/DIV with ALIGN attribute set should affect the
50
% position of non-inline children.
51
      dup get-box-dict
52
      /PseudoAlign get
53
      1 index exch                 % => Box Box PA
54
      exec                         % => Box
55
    } ifelse
56
  } if
57
 
58
 
59
  dup get-line                % => Box Line
60
 
61
  {                           % => Box LH LineElement
62
    get-full-height
63
    max
64
  } forall                    % => Box LH
65
 
66
  % Clear line
67
  [] 2 index put-line         % => Box LH
68
  % Reset X coordinate
69
  1 index get-left-internal   % => Box LH LeftI
70
  2 index put-current-x       % => Box LH
71
  % Extend Y coordinate
72
  1 index get-current-y       % => Box LH CY
73
  exch sub                    % => Box CY-LH
74
  1 index put-current-y       % => Box
75
 
76
  % Reset information about the line baseline
77
 
78
 
79
% Line box completed, render the deferred floats
80
  dup get-box-dict
81
  /Flow get /DeferredFloats get
82
  {
83
    flow-float
84
  } forall
85
 
86
  dup get-box-dict
87
  /Flow get /DeferredFloats [] put
88
 
89
% modify the current-x value, so that next inline box will not intersect any floating boxes
90
  dup offset-x-floats
91
 
92
% Clear the stack
93
  pop
94
  /no-justify {false} def
95
} def
96