aboutsummaryrefslogtreecommitdiffstats
path: root/fop/test/layoutengine/standard-testcases/block_uax14_linebreaking.xml
blob: 715a9364ae4007f3b3621ffe22de7beaf15e51ef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
<?xml version="1.0" encoding="UTF-8"?>
<!--
  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You under the Apache License, Version 2.0
  (the "License"); you may not use this file except in compliance with
  the License.  You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->
<!-- $Id$ -->
<testcase>
  <info>
    <p>
      This test checks some of the UAX#14 breaking rules.
    </p>
  </info>
  <fo>
    <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:svg="http://www.w3.org/2000/svg">
      <fo:layout-master-set>
        <fo:simple-page-master master-name="normal" page-width="2.5in" page-height="10in" margin="5pt">
          <fo:region-body/>
        </fo:simple-page-master>
      </fo:layout-master-set>
      <fo:page-sequence master-reference="normal" white-space-collapse="true">
        <fo:flow flow-name="xsl-region-body" font-size="10pt">
          <fo:block background-color="silver" font-size="8pt" margin="3pt 0pt 0pt 0pt">
            BA -- Break Opportunity After (A)
          </fo:block>
          <fo:block background-color="yellow" margin="0pt 0pt 3pt 0pt">
            VeryLongWordWithAThinSpace&#x2009;PutInTheMiddleOfIt
          </fo:block>
          <fo:block background-color="silver" font-size="8pt" margin="3pt 0pt 0pt 0pt">
            BB -- Break Opportunity Before (B)
          </fo:block>
          <fo:block background-color="yellow" margin="0pt 0pt 3pt 0pt">
            VeryLongWordWithAnAcuteAccent&#x00B4;PutInTheMiddleOfIt
          </fo:block>
          <fo:block background-color="silver" font-size="8pt" margin="3pt 0pt 0pt 0pt">
            B2 -- Break Opportunity Before and After (B/A)
          </fo:block>
          <fo:block background-color="yellow" margin="0pt 0pt 3pt 0pt">
            &#x2014;Very&#x2014;Long&#x2014;Word&#x2014;With&#x2014;LotsOf&#x2014;Em&#x2014;Dashes&#x2014;Put&#x2014;InBetween&#x2014;And&#x2014;Around&#x2014;
          </fo:block>
          <fo:block background-color="silver" font-size="8pt" margin="3pt 0pt 0pt 0pt">
            B2 -- Break Opportunity Before and After (B/A) - as before but don't break between consecutive Em Dashes
          </fo:block>
          <fo:block background-color="yellow" margin="0pt 0pt 3pt 0pt">
            AVeryLongWordWithSomeDouble&#x2014; &#x2014;Dashes&#x2014; &#x2014;Put&#x2014; &#x2014;In
          </fo:block>
          <fo:block background-color="yellow" margin="0pt 0pt 3pt 0pt">
            AVeryLongWordWithSomeDouble&#x2014;&#x2014;Dashes&#x2014;&#x2014;Put&#x2014;&#x2014;In
          </fo:block>
          <fo:block background-color="silver" font-size="8pt" margin="3pt 0pt 0pt 0pt">
            CL -- Closing Punctuation (XB)
          </fo:block>
          <fo:block background-color="yellow" margin="0pt 0pt 3pt 0pt">
            Closing ) brackets ) even ) if ) preceeded ) by ) a ) space ) are ) not ) a ) break ) point
          </fo:block>
          <fo:block background-color="silver" font-size="8pt" margin="3pt 0pt 0pt 0pt">
            EX -- Exclamation / interrogation (XB)
          </fo:block>
          <fo:block background-color="yellow" margin="0pt 0pt 3pt 0pt">
            Question ?marks ?and exclamation !marks !even ?if !preceeded ?by !a ?space !are ?not !a ?break !point
          </fo:block>
          <fo:block background-color="silver" font-size="8pt" margin="3pt 0pt 0pt 0pt">
            HY -- Hyphen Minus (XA)
          </fo:block>
          <fo:block background-color="yellow" margin="0pt 0pt 3pt 0pt">
            Very-Long-Word-With-Lots-Of-Hyphens-Put-In-Between
          </fo:block>
          <fo:block background-color="yellow" margin="0pt 0pt 3pt 0pt">
            Hyphens-in-numbers-do-not-123-567-890-break
          </fo:block>
          <fo:block background-color="silver" font-size="8pt" margin="3pt 0pt 0pt 0pt">
            ID -- Ideographic (B/A)
          </fo:block>
          <fo:block background-color="yellow" margin="0pt 0pt 0pt 0pt">
            Need&#x3000;A&#x3000;Proper&#x3000;Test&#x3000;Case&#x3000;For&#x3000;This&#x3000;As&#x3000;Here&#x3000;Only&#x3000;The&#x3000;Ideographic&#x3000;Space&#x3000;Is&#x3000;Used
          </fo:block>
          <fo:block background-color="silver" font-size="8pt" margin="3pt 0pt 0pt 0pt">
            IN -- Inseperable characters (XP)
          </fo:block>
          <fo:block background-color="yellow" margin="0pt 0pt 3pt 0pt">
            There is never a break&#x2026;&#x2026;&#x2026;&#x2026;&#x2026;&#x2026;&#x2026;&#x2026;&#x2026;&#x2026;between characters of this class
          </fo:block>
          <fo:block background-color="silver" font-size="8pt" margin="3pt 0pt 0pt 0pt">
            IS -- Numeric Separator (Infix) (XB)
          </fo:block>
          <fo:block background-color="yellow" margin="0pt 0pt 3pt 0pt">
            Numbers containing separators 123,345,678.00 08:00:23.15 are not broken
          </fo:block>
          <fo:block background-color="silver" font-size="8pt" margin="3pt 0pt 0pt 0pt">
            OP -- Opening Punctuation (XA)
          </fo:block>
          <fo:block background-color="yellow" margin="0pt 0pt 3pt 0pt">
            Opening ( brackets ( even ( if ( followed ( by ( a ( space ( are ( not ( a ( break ( point
          </fo:block>
          <fo:block background-color="silver" font-size="8pt" margin="3pt 0pt 0pt 0pt">
            SY -- Symbols Allowing Break After (A)
          </fo:block>
          <fo:block background-color="yellow" margin="0pt 0pt 3pt 0pt">
            http://a/very/long/url/can/be/broken/after/the/solidus
          </fo:block>
          <fo:block background-color="yellow" margin="0pt 0pt 3pt 0pt">
            No-break-point-in-normal-dates-12/12/2006-or-fractions-12345678/67890112
          </fo:block>
          <fo:block background-color="silver" font-size="8pt" margin="3pt 0pt 0pt 0pt">
            WJ -- Word Joiner (XB/XA)
          </fo:block>
          <fo:block background-color="yellow" margin="0pt 0pt 3pt 0pt">
            Here we/&#x2060;prevent/&#x2060;any/&#x2060;breaks/&#x2060;after the/&#x2060;solidus
          </fo:block>
        </fo:flow>
      </fo:page-sequence>
    </fo:root>
  </fo>
  <checks>
      <eval expected="2" xpath="count(//flow/block[2]/lineArea)"/>
      <eval expected="141160" xpath="//flow/block[2]/lineArea[1]/text/@ipd"/>
      <eval expected="88150" xpath="//flow/block[2]/lineArea[2]/text/@ipd"/>

      <eval expected="2" xpath="count(//flow/block[4]/lineArea)"/>
      <eval expected="155060" xpath="//flow/block[4]/lineArea[1]/text/@ipd"/>
      <eval expected="89480" xpath="//flow/block[4]/lineArea[2]/text/@ipd"/>

      <eval expected="3" xpath="count(//flow/block[6]/lineArea)"/>
      <eval expected="166150" xpath="//flow/block[6]/lineArea[1]/text/@ipd"/>
      <eval expected="161160" xpath="//flow/block[6]/lineArea[2]/text/@ipd"/>
      <eval expected="70030" xpath="//flow/block[6]/lineArea[3]/text/@ipd"/>

      <eval expected="2" xpath="count(//flow/block[8]/lineArea)"/>
      <eval expected="151160" xpath="//flow/block[8]/lineArea[1]/text/@ipd"/>
      <eval expected="125590" xpath="//flow/block[8]/lineArea[2]/text/@ipd"/>

      <eval expected="2" xpath="count(//flow/block[9]/lineArea)"/>
      <eval expected="151160" xpath="//flow/block[9]/lineArea[1]/text/@ipd"/>
      <eval expected="117250" xpath="//flow/block[9]/lineArea[2]/text/@ipd"/>

      <eval expected="3" xpath="count(//flow/block[11]/lineArea)"/>
      <eval expected="130590" xpath="//flow/block[11]/lineArea[1]/text/@ipd"/>
      <eval expected="168960" xpath="//flow/block[11]/lineArea[2]/text/@ipd"/>
      <eval expected="70030" xpath="//flow/block[11]/lineArea[3]/text/@ipd"/>

      <eval expected="3" xpath="count(//flow/block[13]/lineArea)"/>
      <eval expected="162290" xpath="//flow/block[13]/lineArea[1]/text/@ipd"/>
      <eval expected="158970" xpath="//flow/block[13]/lineArea[2]/text/@ipd"/>
      <eval expected="140640" xpath="//flow/block[13]/lineArea[3]/text/@ipd"/>

      <eval expected="2" xpath="count(//flow/block[15]/lineArea)"/>
      <eval expected="136130" xpath="//flow/block[15]/lineArea[1]/text/@ipd"/>
      <eval expected="111710" xpath="//flow/block[15]/lineArea[2]/text/@ipd"/>

      <eval expected="2" xpath="count(//flow/block[16]/lineArea)"/>
      <eval expected="110580" xpath="//flow/block[16]/lineArea[1]/text/@ipd"/>
      <eval expected="102270" xpath="//flow/block[16]/lineArea[2]/text/@ipd"/>

      <eval expected="3" xpath="count(//flow/block[18]/lineArea)"/>
      <eval expected="125610" xpath="//flow/block[18]/lineArea[1]/text/@ipd"/>
      <eval expected="138380" xpath="//flow/block[18]/lineArea[2]/text/@ipd"/>
      <eval expected="133960" xpath="//flow/block[18]/lineArea[3]/text/@ipd"/>

      <eval expected="3" xpath="count(//flow/block[20]/lineArea)"/>
      <eval expected="72250" xpath="//flow/block[20]/lineArea[1]/text/@ipd"/>
      <eval expected="162810" xpath="//flow/block[20]/lineArea[2]/text/@ipd"/>
      <eval expected="101700" xpath="//flow/block[20]/lineArea[3]/text/@ipd"/>

      <eval expected="3" xpath="count(//flow/block[22]/lineArea)"/>
      <eval expected="138940" xpath="//flow/block[22]/lineArea[1]/text/@ipd"/>
      <eval expected="159010" xpath="//flow/block[22]/lineArea[2]/text/@ipd"/>
      <eval expected="30570" xpath="//flow/block[22]/lineArea[3]/text/@ipd"/>

      <eval expected="3" xpath="count(//flow/block[24]/lineArea)"/>
      <eval expected="128940" xpath="//flow/block[24]/lineArea[1]/text/@ipd"/>
      <eval expected="158390" xpath="//flow/block[24]/lineArea[2]/text/@ipd"/>
      <eval expected="76140" xpath="//flow/block[24]/lineArea[3]/text/@ipd"/>

      <eval expected="2" xpath="count(//flow/block[26]/lineArea)"/>
      <eval expected="156750" xpath="//flow/block[26]/lineArea[1]/text/@ipd"/>
      <eval expected="70590" xpath="//flow/block[26]/lineArea[2]/text/@ipd"/>

      <eval expected="3" xpath="count(//flow/block[27]/lineArea)"/>
      <eval expected="114460" xpath="//flow/block[27]/lineArea[1]/text/@ipd"/>
      <eval expected="93380" xpath="//flow/block[27]/lineArea[2]/text/@ipd"/>
      <eval expected="132860" xpath="//flow/block[27]/lineArea[3]/text/@ipd"/>

      <eval expected="2" xpath="count(//flow/block[29]/lineArea)"/>
      <eval expected="147840" xpath="//flow/block[29]/lineArea[1]/text/@ipd"/>
      <eval expected="47800" xpath="//flow/block[29]/lineArea[2]/text/@ipd"/>
  </checks>
</testcase>