From: Vincent Hennebert Date: Tue, 20 Oct 2009 16:24:44 +0000 (+0000) Subject: Added test framework for accessibility. See README file. X-Git-Tag: fop-1_0~115^2~10 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=cacfc7c9bf562ed9b34d723f10120214aa909f35;p=xmlgraphics-fop.git Added test framework for accessibility. See README file. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/Temp_Accessibility@827725 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/test/accessibility/README b/test/accessibility/README new file mode 100644 index 000000000..cbe2879e1 --- /dev/null +++ b/test/accessibility/README @@ -0,0 +1,52 @@ +his directory contains sample FO files for testing the accessibility features of +FOP. + +To every FO file in this directory correspond two PDF files in the pdf/ +sub-directory: one generated by the painter, one by the renderer. For example, +the text_1.fo file has been rendered into pdf/text_1_painter_orig.pdf and +pdf/text_1_renderer_orig.pdf. The configuration file config-painter.xconf (resp. +config-renderer.xconf) was used. + +The PDF files have been checked with Adobe Acrobat Professional 9, using both +the full accessibility checker and the read-aloud feature. The checker reports +no error /and/ the entire document can be read aloud. + + +!! DO NOT MODIFY THOSE FILES, NEITHER THE FO NOR THE PDF !! + + +... Or at least, know what you are doing +If the FO files are modified, the resulting PDFs must be checked again, both +with the checker and the read-aloud feature. (Sometimes the checker reports no +problem yet part or all of the document cannot be read aloud.) + +The purpose of this infrastructure is to be able to quickly re-test the +accessibility processing chain when any change has been made to it. The +configuration files disable the compression of the PDF streams, so it is +possible to compare a re-generated PDF with the original one by using a simple +diff tool. The files will not be identical because of the different creation +dates (and the ID key in the trailer), but apart from that there should be no +difference. + +The rationale is that using a diff tool is much quicker and less tedious than +running Acrobat's accessibility checker and read-aloud feature every time. + + +To re-generate the PDF files using the painter: + ../../fop -c config-painter.xconf text_1.fo pdf/text_1_painter.pdf + diff pdf/text_1_painter_orig.pdf pdf/text_1_painter.pdf +Or, going through the intermediate format: + ../../fop -c config-painter.xconf text_1.fo -if application/pdf text_1_if.xml + ../../fop -c config-painter.xconf -ifin text_1_if.xml pdf/text_1_painter.pdf + diff pdf/text_1_painter_orig.pdf pdf/text_1_painter.pdf + +To re-generate the PDF files using the legacy renderer: + ../../fop -c config-renderer.xconf text_1.fo pdf/text_1_renderer.pdf + diff pdf/text_1_renderer_orig.pdf pdf/text_1_renderer.pdf +Or, going through the intermediate format: + ../../fop -c config-renderer.xconf text_1.fo -at application/pdf text_1_at.xml + ../../fop -c config-renderer.xconf -atin text_1_at.xml pdf/text_1_renderer.pdf + diff pdf/text_1_renderer_orig.pdf pdf/text_1_renderer.pdf + + +$Id$ diff --git a/test/accessibility/background-image_jpg_repeat.fo b/test/accessibility/background-image_jpg_repeat.fo new file mode 100644 index 000000000..2c8f7f66d --- /dev/null +++ b/test/accessibility/background-image_jpg_repeat.fo @@ -0,0 +1,34 @@ + + + + + + + + + + + + Apache FOP (Formatting Objects Processor) is a print formatter driven by XSL + formatting objects (XSL-FO) and an output independent formatter. It is a Java application + that reads a formatting object (FO) tree and renders the resulting pages to a specified + output. + + + diff --git a/test/accessibility/background-image_jpg_single.fo b/test/accessibility/background-image_jpg_single.fo new file mode 100644 index 000000000..2250c24e2 --- /dev/null +++ b/test/accessibility/background-image_jpg_single.fo @@ -0,0 +1,36 @@ + + + + + + + + + + + + Apache FOP (Formatting Objects Processor) is a print formatter driven by XSL + formatting objects (XSL-FO) and an output independent formatter. It is a Java application + that reads a formatting object (FO) tree and renders the resulting pages to a specified + output. + + + diff --git a/test/accessibility/background-image_png_repeat.fo b/test/accessibility/background-image_png_repeat.fo new file mode 100644 index 000000000..7506c0f2b --- /dev/null +++ b/test/accessibility/background-image_png_repeat.fo @@ -0,0 +1,34 @@ + + + + + + + + + + + + Apache FOP (Formatting Objects Processor) is a print formatter driven by XSL + formatting objects (XSL-FO) and an output independent formatter. It is a Java application + that reads a formatting object (FO) tree and renders the resulting pages to a specified + output. + + + diff --git a/test/accessibility/background-image_png_single.fo b/test/accessibility/background-image_png_single.fo new file mode 100644 index 000000000..1f60e9411 --- /dev/null +++ b/test/accessibility/background-image_png_single.fo @@ -0,0 +1,36 @@ + + + + + + + + + + + + Apache FOP (Formatting Objects Processor) is a print formatter driven by XSL + formatting objects (XSL-FO) and an output independent formatter. It is a Java application + that reads a formatting object (FO) tree and renders the resulting pages to a specified + output. + + + diff --git a/test/accessibility/background-image_svg_repeat.fo b/test/accessibility/background-image_svg_repeat.fo new file mode 100644 index 000000000..6e71409d0 --- /dev/null +++ b/test/accessibility/background-image_svg_repeat.fo @@ -0,0 +1,34 @@ + + + + + + + + + + + + Apache FOP (Formatting Objects Processor) is a print formatter driven by XSL + formatting objects (XSL-FO) and an output independent formatter. It is a Java application + that reads a formatting object (FO) tree and renders the resulting pages to a specified + output. + + + diff --git a/test/accessibility/background-image_svg_single.fo b/test/accessibility/background-image_svg_single.fo new file mode 100644 index 000000000..9dc67c86c --- /dev/null +++ b/test/accessibility/background-image_svg_single.fo @@ -0,0 +1,36 @@ + + + + + + + + + + + + Apache FOP (Formatting Objects Processor) is a print formatter driven by XSL + formatting objects (XSL-FO) and an output independent formatter. It is a Java application + that reads a formatting object (FO) tree and renders the resulting pages to a specified + output. + + + diff --git a/test/accessibility/complete.fo b/test/accessibility/complete.fo new file mode 100644 index 000000000..03c57b212 --- /dev/null +++ b/test/accessibility/complete.fo @@ -0,0 +1,205 @@ + + + + + + + + + + + + + This is the page headerPage + + + + + + + (There’s another page sequence below.) + Apache FOP (Formatting Objects Processor) is a print formatter driven by XSL + formatting objects (XSL-FO) and an output independent formatter1See the + FOP + website for more + information. FOP has a nice logo: + + + + + + Header 1.1 + + + Header 1.2 + + + + + + + Cell 1.1 + + + Cell 1.2 + + + + + Cell 2.1 + + + Cell 2.2 + + + + + Apache FOP (Formatting Objects Processor) is a print formatter driven by XSL + formatting objects (XSL-FO) and an output independent formatter. It is a Java application + that reads a formatting object (FO) tree and renders the resulting pages to a specified + output. + This fo:block element spans all the columns of the + document. This is intended to test the abilities of the text-to-speech program. + And now we are back to normal content flowing in two columns. Let’s start a numbered + list: + + + + 1. + + + + Line 1 of item 1 + Line 2 of item 1 + Line 3 of item 1 + + + + + + 2. + + + + Line 1 of item 2 + Line 2 of item 2 + Line 3 of item 2 + + + + + And now we are going to see how a second page sequence is handled. + + + + + This is the page headerPage + + + + + + + Apache FOP (Formatting Objects Processor) is a print formatter driven by + XSL formatting objects (XSL-FO) and an output independent formatter1See the + FOP + website for more + information. It is a Java application that + reads a formatting object (FO) tree and renders the resulting pages to a specified + output. + + + + + Header 1.1 + + + Header 1.2 + + + + + + + Cell 1.1 + + + Cell 1.2 + + + + + Cell 2.1 + + + Cell 2.2 + + + + + Apache FOP (Formatting Objects Processor) est une + application de mise en page de documents respectant le standard XSL-FO. À partir d’un + document au format XSL-FO, cette application écrite en Java effectue une mise en page et + renvoie un document prêt pour impression. + This fo:block element spans all the columns of the + document. This is intended to test the abilities of the text-to-speech program. + And now we are back to normal content flowing in two columns. Let’s start a numbered + list: + + + + 1. + + + + Line 1 of item 1 + Line 2 of item 1 + Line 3 of item 1 + + + + + + 2. + + + + Line 1 of item 2 + Line 2 of item 2 + Line 3 of item 2 + + + + + The end of the document has now been reached. + + + diff --git a/test/accessibility/config-painter.xconf b/test/accessibility/config-painter.xconf new file mode 100644 index 000000000..8c5dc2bd5 --- /dev/null +++ b/test/accessibility/config-painter.xconf @@ -0,0 +1,23 @@ + + + true + 144 + false + ../resources/fonts/ + + + + null + + + flate + ascii-85 + + + + + + + + + diff --git a/test/accessibility/config-renderer.xconf b/test/accessibility/config-renderer.xconf new file mode 100644 index 000000000..4b55e393f --- /dev/null +++ b/test/accessibility/config-renderer.xconf @@ -0,0 +1,24 @@ + + + true + true + 144 + false + ../resources/fonts/ + + + + null + + + flate + ascii-85 + + + + + + + + + diff --git a/test/accessibility/image_jpg.fo b/test/accessibility/image_jpg.fo new file mode 100644 index 000000000..be0e24bee --- /dev/null +++ b/test/accessibility/image_jpg.fo @@ -0,0 +1,35 @@ + + + + + + + + + + + + This document contains an image in the JPEG format: . Here is the end of the text. + + + diff --git a/test/accessibility/image_png.fo b/test/accessibility/image_png.fo new file mode 100644 index 000000000..3bcd12f4f --- /dev/null +++ b/test/accessibility/image_png.fo @@ -0,0 +1,35 @@ + + + + + + + + + + + + This document contains an image in the PNG format: . Here is the end of the text. + + + diff --git a/test/accessibility/image_svg.fo b/test/accessibility/image_svg.fo new file mode 100644 index 000000000..4fac16be5 --- /dev/null +++ b/test/accessibility/image_svg.fo @@ -0,0 +1,45 @@ + + + + + + + + + + + + This document contains an image in the SVG format: . And here is the same image as an instream-foreign-object: + + + + + + + + + . + + + diff --git a/test/accessibility/image_wmf.fo b/test/accessibility/image_wmf.fo new file mode 100644 index 000000000..729b48586 --- /dev/null +++ b/test/accessibility/image_wmf.fo @@ -0,0 +1,35 @@ + + + + + + + + + + + + This document contains an image in the WMF format: Here is the end of the text. + + + diff --git a/test/accessibility/leader.fo b/test/accessibility/leader.fo new file mode 100644 index 000000000..91c9243e0 --- /dev/null +++ b/test/accessibility/leader.fo @@ -0,0 +1,38 @@ + + + + + + + + + + + + This is a text followed by a leader with leader-pattern=​"use-content", the + content being text: • + 1 + This is a text followed by a leader with + leader-pattern=​"use-content", the content being images:1 + + + diff --git a/test/accessibility/links.fo b/test/accessibility/links.fo new file mode 100644 index 000000000..66f0f66f4 --- /dev/null +++ b/test/accessibility/links.fo @@ -0,0 +1,41 @@ + + + + + + + + + + + + This is a link to the next + paragraph. + Apache FOP (Formatting Objects Processor) is a print formatter driven by + XSL formatting objects (XSL-FO) and an output independent formatter. It is a Java + application that reads a formatting object (FO) tree and renders the resulting pages to a + specified output. + For more information, see the FOP + website. + + + diff --git a/test/accessibility/pdf/background-image_jpg_repeat_painter_orig.pdf b/test/accessibility/pdf/background-image_jpg_repeat_painter_orig.pdf new file mode 100644 index 000000000..a1734f89d Binary files /dev/null and b/test/accessibility/pdf/background-image_jpg_repeat_painter_orig.pdf differ diff --git a/test/accessibility/pdf/background-image_jpg_repeat_renderer_orig.pdf b/test/accessibility/pdf/background-image_jpg_repeat_renderer_orig.pdf new file mode 100644 index 000000000..52a812b43 Binary files /dev/null and b/test/accessibility/pdf/background-image_jpg_repeat_renderer_orig.pdf differ diff --git a/test/accessibility/pdf/background-image_jpg_single_painter_orig.pdf b/test/accessibility/pdf/background-image_jpg_single_painter_orig.pdf new file mode 100644 index 000000000..13684299e Binary files /dev/null and b/test/accessibility/pdf/background-image_jpg_single_painter_orig.pdf differ diff --git a/test/accessibility/pdf/background-image_jpg_single_renderer_orig.pdf b/test/accessibility/pdf/background-image_jpg_single_renderer_orig.pdf new file mode 100644 index 000000000..0816f4843 Binary files /dev/null and b/test/accessibility/pdf/background-image_jpg_single_renderer_orig.pdf differ diff --git a/test/accessibility/pdf/background-image_png_repeat_painter_orig.pdf b/test/accessibility/pdf/background-image_png_repeat_painter_orig.pdf new file mode 100644 index 000000000..f891c0a22 Binary files /dev/null and b/test/accessibility/pdf/background-image_png_repeat_painter_orig.pdf differ diff --git a/test/accessibility/pdf/background-image_png_repeat_renderer_orig.pdf b/test/accessibility/pdf/background-image_png_repeat_renderer_orig.pdf new file mode 100644 index 000000000..30cdbccaf Binary files /dev/null and b/test/accessibility/pdf/background-image_png_repeat_renderer_orig.pdf differ diff --git a/test/accessibility/pdf/background-image_png_single_painter_orig.pdf b/test/accessibility/pdf/background-image_png_single_painter_orig.pdf new file mode 100644 index 000000000..377247c9e Binary files /dev/null and b/test/accessibility/pdf/background-image_png_single_painter_orig.pdf differ diff --git a/test/accessibility/pdf/background-image_png_single_renderer_orig.pdf b/test/accessibility/pdf/background-image_png_single_renderer_orig.pdf new file mode 100644 index 000000000..f05ad6f8e Binary files /dev/null and b/test/accessibility/pdf/background-image_png_single_renderer_orig.pdf differ diff --git a/test/accessibility/pdf/background-image_svg_repeat_painter_orig.pdf b/test/accessibility/pdf/background-image_svg_repeat_painter_orig.pdf new file mode 100644 index 000000000..434ac46ee Binary files /dev/null and b/test/accessibility/pdf/background-image_svg_repeat_painter_orig.pdf differ diff --git a/test/accessibility/pdf/background-image_svg_repeat_renderer_orig.pdf b/test/accessibility/pdf/background-image_svg_repeat_renderer_orig.pdf new file mode 100644 index 000000000..9aa7a8e82 Binary files /dev/null and b/test/accessibility/pdf/background-image_svg_repeat_renderer_orig.pdf differ diff --git a/test/accessibility/pdf/background-image_svg_single_painter_orig.pdf b/test/accessibility/pdf/background-image_svg_single_painter_orig.pdf new file mode 100644 index 000000000..8c08b3f21 Binary files /dev/null and b/test/accessibility/pdf/background-image_svg_single_painter_orig.pdf differ diff --git a/test/accessibility/pdf/background-image_svg_single_renderer_orig.pdf b/test/accessibility/pdf/background-image_svg_single_renderer_orig.pdf new file mode 100644 index 000000000..b6de5d17b Binary files /dev/null and b/test/accessibility/pdf/background-image_svg_single_renderer_orig.pdf differ diff --git a/test/accessibility/pdf/complete_painter_orig.pdf b/test/accessibility/pdf/complete_painter_orig.pdf new file mode 100644 index 000000000..856e8ca92 Binary files /dev/null and b/test/accessibility/pdf/complete_painter_orig.pdf differ diff --git a/test/accessibility/pdf/complete_renderer_orig.pdf b/test/accessibility/pdf/complete_renderer_orig.pdf new file mode 100644 index 000000000..bcca16076 Binary files /dev/null and b/test/accessibility/pdf/complete_renderer_orig.pdf differ diff --git a/test/accessibility/pdf/image_jpg_painter_orig.pdf b/test/accessibility/pdf/image_jpg_painter_orig.pdf new file mode 100644 index 000000000..6b5499092 Binary files /dev/null and b/test/accessibility/pdf/image_jpg_painter_orig.pdf differ diff --git a/test/accessibility/pdf/image_jpg_renderer_orig.pdf b/test/accessibility/pdf/image_jpg_renderer_orig.pdf new file mode 100644 index 000000000..1621e8024 Binary files /dev/null and b/test/accessibility/pdf/image_jpg_renderer_orig.pdf differ diff --git a/test/accessibility/pdf/image_png_painter_orig.pdf b/test/accessibility/pdf/image_png_painter_orig.pdf new file mode 100644 index 000000000..2d8f01f23 Binary files /dev/null and b/test/accessibility/pdf/image_png_painter_orig.pdf differ diff --git a/test/accessibility/pdf/image_png_renderer_orig.pdf b/test/accessibility/pdf/image_png_renderer_orig.pdf new file mode 100644 index 000000000..f60461f11 Binary files /dev/null and b/test/accessibility/pdf/image_png_renderer_orig.pdf differ diff --git a/test/accessibility/pdf/image_svg_painter_orig.pdf b/test/accessibility/pdf/image_svg_painter_orig.pdf new file mode 100644 index 000000000..f8cbaca53 Binary files /dev/null and b/test/accessibility/pdf/image_svg_painter_orig.pdf differ diff --git a/test/accessibility/pdf/image_svg_renderer_orig.pdf b/test/accessibility/pdf/image_svg_renderer_orig.pdf new file mode 100644 index 000000000..e399c6b1a Binary files /dev/null and b/test/accessibility/pdf/image_svg_renderer_orig.pdf differ diff --git a/test/accessibility/pdf/image_wmf_painter_orig.pdf b/test/accessibility/pdf/image_wmf_painter_orig.pdf new file mode 100644 index 000000000..5bb1be4d1 Binary files /dev/null and b/test/accessibility/pdf/image_wmf_painter_orig.pdf differ diff --git a/test/accessibility/pdf/image_wmf_renderer_orig.pdf b/test/accessibility/pdf/image_wmf_renderer_orig.pdf new file mode 100644 index 000000000..8e1dc1eac Binary files /dev/null and b/test/accessibility/pdf/image_wmf_renderer_orig.pdf differ diff --git a/test/accessibility/pdf/leader_painter_orig.pdf b/test/accessibility/pdf/leader_painter_orig.pdf new file mode 100644 index 000000000..42b74e69d Binary files /dev/null and b/test/accessibility/pdf/leader_painter_orig.pdf differ diff --git a/test/accessibility/pdf/leader_renderer_orig.pdf b/test/accessibility/pdf/leader_renderer_orig.pdf new file mode 100644 index 000000000..0cc5da967 Binary files /dev/null and b/test/accessibility/pdf/leader_renderer_orig.pdf differ diff --git a/test/accessibility/pdf/links_painter_orig.pdf b/test/accessibility/pdf/links_painter_orig.pdf new file mode 100644 index 000000000..78198cfd2 Binary files /dev/null and b/test/accessibility/pdf/links_painter_orig.pdf differ diff --git a/test/accessibility/pdf/links_renderer_orig.pdf b/test/accessibility/pdf/links_renderer_orig.pdf new file mode 100644 index 000000000..3594a7235 Binary files /dev/null and b/test/accessibility/pdf/links_renderer_orig.pdf differ diff --git a/test/accessibility/pdf/text_1_painter_orig.pdf b/test/accessibility/pdf/text_1_painter_orig.pdf new file mode 100644 index 000000000..cf3c8607d Binary files /dev/null and b/test/accessibility/pdf/text_1_painter_orig.pdf differ diff --git a/test/accessibility/pdf/text_1_renderer_orig.pdf b/test/accessibility/pdf/text_1_renderer_orig.pdf new file mode 100644 index 000000000..ee8dc117a Binary files /dev/null and b/test/accessibility/pdf/text_1_renderer_orig.pdf differ diff --git a/test/accessibility/pdf/text_2_painter_orig.pdf b/test/accessibility/pdf/text_2_painter_orig.pdf new file mode 100644 index 000000000..41a0064cb Binary files /dev/null and b/test/accessibility/pdf/text_2_painter_orig.pdf differ diff --git a/test/accessibility/pdf/text_2_renderer_orig.pdf b/test/accessibility/pdf/text_2_renderer_orig.pdf new file mode 100644 index 000000000..c75395fb3 Binary files /dev/null and b/test/accessibility/pdf/text_2_renderer_orig.pdf differ diff --git a/test/accessibility/pdf/text_font-embedding_painter_orig.pdf b/test/accessibility/pdf/text_font-embedding_painter_orig.pdf new file mode 100644 index 000000000..31ce697c6 Binary files /dev/null and b/test/accessibility/pdf/text_font-embedding_painter_orig.pdf differ diff --git a/test/accessibility/pdf/text_font-embedding_renderer_orig.pdf b/test/accessibility/pdf/text_font-embedding_renderer_orig.pdf new file mode 100644 index 000000000..337648f02 Binary files /dev/null and b/test/accessibility/pdf/text_font-embedding_renderer_orig.pdf differ diff --git a/test/accessibility/text_1.fo b/test/accessibility/text_1.fo new file mode 100644 index 000000000..2a90f6c14 --- /dev/null +++ b/test/accessibility/text_1.fo @@ -0,0 +1,34 @@ + + + + + + + + + + + + Apache FOP (Formatting Objects Processor) is a print formatter driven by XSL + formatting objects (XSL-FO) and an output independent formatter. It is a Java application + that reads a formatting object (FO) tree and renders the resulting pages to a specified + output. + + + diff --git a/test/accessibility/text_2.fo b/test/accessibility/text_2.fo new file mode 100644 index 000000000..5eff059b6 --- /dev/null +++ b/test/accessibility/text_2.fo @@ -0,0 +1,41 @@ + + + + + + + + + + + + Apache FOP (Formatting Objects Processor) is a print formatter driven by XSL + formatting objects (XSL-FO) and an output independent formatter. It is a Java application + that reads a formatting object (FO) tree and renders the resulting pages to a specified + output. + Apache FOP (Formatting Objects Processor) est une + application de mise en page de documents respectant le standard XSL-FO. À partir d’un + document au format XSL-FO, cette application écrite en Java effectue une mise en page et + renvoie un document prêt pour impression. + Back to English and let’s say it again: Apache FOP (Formatting Objects Processor) is + a print formatter driven by XSL formatting objects (XSL-FO) and an output independent + formatter. + + + diff --git a/test/accessibility/text_font-embedding.fo b/test/accessibility/text_font-embedding.fo new file mode 100644 index 000000000..1d3abe027 --- /dev/null +++ b/test/accessibility/text_font-embedding.fo @@ -0,0 +1,34 @@ + + + + + + + + + + + + Apache FOP (Formatting Objects Processor) is a print formatter driven by XSL + formatting objects (XSL-FO) and an output independent formatter. It is a Java application + that reads a formatting object (FO) tree and renders the resulting pages to a specified + output. + + + diff --git a/test/resources/images/list-item.png b/test/resources/images/list-item.png new file mode 100644 index 000000000..77ceb3f50 Binary files /dev/null and b/test/resources/images/list-item.png differ diff --git a/test/resources/images/rgb-circles.svg b/test/resources/images/rgb-circles.svg new file mode 100644 index 000000000..83700082e --- /dev/null +++ b/test/resources/images/rgb-circles.svg @@ -0,0 +1,9 @@ + + + + + + + +