diff options
author | Jeremias Maerki <jeremias@apache.org> | 2011-01-18 08:54:08 +0000 |
---|---|---|
committer | Jeremias Maerki <jeremias@apache.org> | 2011-01-18 08:54:08 +0000 |
commit | 992d7e9d1d3a71209ae689eb60b5e3c15295fe2d (patch) | |
tree | 7fc8445564597ae49eb9b1a082d7f8498409a4bf /test | |
parent | ce6d9e1eeef5f7b17fada9f07145e7e430586bf1 (diff) | |
parent | 5a367c3b12e19af7a66fc923d7149bf22cdfb596 (diff) | |
download | xmlgraphics-fop-992d7e9d1d3a71209ae689eb60b5e3c15295fe2d.tar.gz xmlgraphics-fop-992d7e9d1d3a71209ae689eb60b5e3c15295fe2d.zip |
Merge from Trunk, revisions 965390 to 1060234.
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/Temp_Color@1060241 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'test')
39 files changed, 821 insertions, 295 deletions
diff --git a/test/java/org/apache/fop/GenericFOPTestCase.java b/test/java/org/apache/fop/GenericFOPTestCase.java index 26053cdad..5b51a34e1 100644 --- a/test/java/org/apache/fop/GenericFOPTestCase.java +++ b/test/java/org/apache/fop/GenericFOPTestCase.java @@ -31,12 +31,13 @@ import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; -import org.apache.fop.apps.Fop; +import org.xml.sax.InputSource; + import org.apache.fop.apps.FOUserAgent; +import org.apache.fop.apps.Fop; import org.apache.fop.apps.FopFactory; import org.apache.fop.apps.MimeConstants; import org.apache.fop.util.DigestFilter; -import org.xml.sax.InputSource; /** * Framework for simple regression testing. @@ -76,8 +77,8 @@ public final class GenericFOPTestCase extends TestCase { public void testSimple() throws Exception { final String digestIn = "17bf13298796065f7775db8707133aeb"; final String digestOut = "e2761f51152f6663911e567901596707"; - final String fo = - "<fo:root xmlns:fo='http://www.w3.org/1999/XSL/Format'>" + final String fo + = "<fo:root xmlns:fo='http://www.w3.org/1999/XSL/Format'>" + " <fo:layout-master-set>" + " <fo:simple-page-master master-name='simple'" + " page-height='25cm' page-width='20cm'>" @@ -118,8 +119,8 @@ public final class GenericFOPTestCase extends TestCase { FOUserAgent foUserAgent = fopFactory.newFOUserAgent(); foUserAgent.setCreationDate(new Date(10000)); MessageDigest outDigest = MessageDigest.getInstance("MD5"); - DigestOutputStream out = - new DigestOutputStream(new ByteArrayOutputStream(), outDigest); + DigestOutputStream out + = new DigestOutputStream(new ByteArrayOutputStream(), outDigest); Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF, foUserAgent, out); InputSource source = new InputSource(new StringReader(fo)); DigestFilter filter = new DigestFilter("MD5"); diff --git a/test/java/org/apache/fop/StandardTestSuite.java b/test/java/org/apache/fop/StandardTestSuite.java index 281301789..caf75b4b4 100644 --- a/test/java/org/apache/fop/StandardTestSuite.java +++ b/test/java/org/apache/fop/StandardTestSuite.java @@ -23,7 +23,6 @@ import junit.framework.Test; import junit.framework.TestSuite; import org.apache.fop.fonts.DejaVuLGCSerifTest; -import org.apache.fop.fonts.TrueTypeAnsiTestCase; import org.apache.fop.image.loader.batik.ImageLoaderTestCase; import org.apache.fop.image.loader.batik.ImagePreloaderTestCase; import org.apache.fop.intermediate.IFMimickingTestCase; @@ -54,7 +53,6 @@ public class StandardTestSuite { suite.addTest(new TestSuite(PDFEncodingTestCase.class)); suite.addTest(new TestSuite(PDFCMapTestCase.class)); suite.addTest(new TestSuite(PDFsRGBSettingsTestCase.class)); - suite.addTest(new TestSuite(TrueTypeAnsiTestCase.class)); suite.addTest(new TestSuite(DejaVuLGCSerifTest.class)); suite.addTest(RichTextFormatTestSuite.suite()); suite.addTest(new TestSuite(ImageLoaderTestCase.class)); diff --git a/test/java/org/apache/fop/URIResolutionTestCase.java b/test/java/org/apache/fop/URIResolutionTestCase.java index fd4f879da..0a197722b 100644 --- a/test/java/org/apache/fop/URIResolutionTestCase.java +++ b/test/java/org/apache/fop/URIResolutionTestCase.java @@ -92,7 +92,7 @@ public class URIResolutionTestCase extends AbstractFOPTestCase { MyURIResolver resolver = new MyURIResolver(withStream); ua.setURIResolver(resolver); - ua.setBaseURL(foFile.getParentFile().toURL().toString()); + ua.setBaseURL(foFile.getParentFile().toURI().toURL().toString()); Document doc = createAreaTree(foFile, ua); @@ -119,7 +119,7 @@ public class URIResolutionTestCase extends AbstractFOPTestCase { FOUserAgent ua = fopFactory.newFOUserAgent(); MyURIResolver resolver = new MyURIResolver(false); ua.setURIResolver(resolver); - ua.setBaseURL(foFile.getParentFile().toURL().toString()); + ua.setBaseURL(foFile.getParentFile().toURI().toURL().toString()); ByteArrayOutputStream baout = new ByteArrayOutputStream(); diff --git a/test/java/org/apache/fop/config/BaseUserConfigTestCase.java b/test/java/org/apache/fop/config/BaseUserConfigTestCase.java index 5c803317e..6ce833312 100644 --- a/test/java/org/apache/fop/config/BaseUserConfigTestCase.java +++ b/test/java/org/apache/fop/config/BaseUserConfigTestCase.java @@ -100,7 +100,7 @@ public abstract class BaseUserConfigTestCase extends BasePDFTestCase { /** * @return user config File */ - abstract protected String getUserConfigFilename(); + protected abstract String getUserConfigFilename(); /* * @see junit.framework.TestCase#getName() diff --git a/test/java/org/apache/fop/events/EventChecker.java b/test/java/org/apache/fop/events/EventChecker.java index 767c590ed..afef11d87 100644 --- a/test/java/org/apache/fop/events/EventChecker.java +++ b/test/java/org/apache/fop/events/EventChecker.java @@ -40,7 +40,7 @@ class EventChecker extends Assert implements EventListener { if (event.getEventID().equals(expectedEventID)) { eventReceived = true; } else { - fail("Unexpected event: id = " + event.getEventID() + ": "+ msg); + fail("Unexpected event: id = " + event.getEventID() + ": " + msg); } } diff --git a/test/java/org/apache/fop/fonts/EncodingModeTest.java b/test/java/org/apache/fop/fonts/EncodingModeTest.java new file mode 100644 index 000000000..4e81c46d6 --- /dev/null +++ b/test/java/org/apache/fop/fonts/EncodingModeTest.java @@ -0,0 +1,36 @@ +/* + * 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$ */ + +package org.apache.fop.fonts; + +import junit.framework.TestCase; + +public class EncodingModeTest extends TestCase { + public void testGetName() { + assertEquals("auto", EncodingMode.AUTO.getName()); + assertEquals("single-byte", EncodingMode.SINGLE_BYTE.getName()); + assertEquals("cid", EncodingMode.CID.getName()); + } + + public void testGetValue() { + assertEquals(EncodingMode.AUTO, EncodingMode.getEncodingMode("auto")); + assertEquals(EncodingMode.SINGLE_BYTE, EncodingMode.getEncodingMode("single-byte")); + assertEquals(EncodingMode.CID, EncodingMode.getEncodingMode("cid")); + } +} diff --git a/test/java/org/apache/fop/fonts/TrueTypeAnsiTestCase.java b/test/java/org/apache/fop/fonts/TrueTypeAnsiTestCase.java deleted file mode 100644 index 3f98c93f4..000000000 --- a/test/java/org/apache/fop/fonts/TrueTypeAnsiTestCase.java +++ /dev/null @@ -1,107 +0,0 @@ -/* - * 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$ */ - -package org.apache.fop.fonts; - -import java.io.File; -import java.io.OutputStream; -import java.io.StringReader; -import java.net.URL; -import java.util.List; - -import javax.xml.transform.Result; -import javax.xml.transform.Source; -import javax.xml.transform.Transformer; -import javax.xml.transform.TransformerFactory; -import javax.xml.transform.sax.SAXResult; -import javax.xml.transform.stream.StreamSource; - -import junit.framework.TestCase; - -import org.apache.commons.io.output.NullOutputStream; - -import org.apache.fop.apps.FOUserAgent; -import org.apache.fop.apps.Fop; -import org.apache.fop.apps.FopFactory; -import org.apache.fop.fonts.apps.TTFReader; -import org.apache.fop.render.pdf.PDFRenderer; - -/** - * Tests XML font metrics file generation and usage for WinAnsi mode. - */ -public class TrueTypeAnsiTestCase extends TestCase { - - /** - * Tests a TrueType font in WinAnsi mode. - * @throws Exception if an error occurs - */ - public void testTrueTypeAnsi() throws Exception { - String fontFamily = "Gladiator Bold"; - File ttfFile = new File("./test/resources/fonts/glb12.ttf"); - File workDir = new File("./build/test-results"); - if (!workDir.isDirectory()) { - assertTrue(workDir.mkdirs()); - } - File metricsFile = new File(workDir, ttfFile.getName() + ".xml"); - if (metricsFile.isFile()) { - assertTrue(metricsFile.delete()); - } - - String[] args = new String[] {"-enc", "ansi", - ttfFile.getCanonicalPath(), metricsFile.getCanonicalPath()}; - TTFReader.main(args); - assertTrue(metricsFile.isFile()); - - FopFactory fopFactory = FopFactory.newInstance(); - FOUserAgent ua = fopFactory.newFOUserAgent(); - PDFRenderer renderer = new PDFRenderer(); - renderer.setUserAgent(ua); - List fontList = new java.util.ArrayList(); - List triplets = new java.util.ArrayList(); - triplets.add(new FontTriplet(fontFamily, "normal", Font.WEIGHT_NORMAL)); - EmbedFontInfo font = new EmbedFontInfo( - metricsFile.toURI().toASCIIString(), - true, triplets, - ttfFile.toURI().toASCIIString(), null); - fontList.add(font); - renderer.addFontList(fontList); - - ua.setRendererOverride(renderer); - OutputStream out = new NullOutputStream(); - - Fop fop = fopFactory.newFop(null, ua, out); - - TransformerFactory tFactory = TransformerFactory.newInstance(); - Source src = new StreamSource(new StringReader( - "<root font-family='" + fontFamily + "'>Test!</root>")); - Result res = new SAXResult(fop.getDefaultHandler()); - Transformer transformer = tFactory.newTransformer( - getSourceForResource(this, "fonttest.xsl")); - transformer.transform(src, res); - } - - private static Source getSourceForResource(Object reference, String name) { - URL url = reference.getClass().getResource(name); - if (url == null) { - throw new NullPointerException("Resource not found: " + name); - } - return new StreamSource(url.toExternalForm()); - } - -} diff --git a/test/java/org/apache/fop/fonts/fonttest.xsl b/test/java/org/apache/fop/fonts/fonttest.xsl deleted file mode 100644 index 26c7d72a5..000000000 --- a/test/java/org/apache/fop/fonts/fonttest.xsl +++ /dev/null @@ -1,24 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" - xmlns:fo="http://www.w3.org/1999/XSL/Format"> - - <xsl:output method="xml" indent="yes"/> - - <xsl:template match="root"> - <fo:root> - <fo:layout-master-set> - <fo:simple-page-master master-name="A4" page-height="29.7cm" page-width="21cm" - margin="2cm"> - <fo:region-body/> - </fo:simple-page-master> - </fo:layout-master-set> - <fo:page-sequence master-reference="A4"> - <fo:flow flow-name="xsl-region-body"> - <fo:block font-family="{@font-family}"> - <xsl:value-of select="."/> - </fo:block> - </fo:flow> - </fo:page-sequence> - </fo:root> - </xsl:template> -</xsl:stylesheet> diff --git a/test/java/org/apache/fop/fotreetest/FOTreeUnitTester.java b/test/java/org/apache/fop/fotreetest/FOTreeUnitTester.java index bfe9018b1..5513a89ab 100644 --- a/test/java/org/apache/fop/fotreetest/FOTreeUnitTester.java +++ b/test/java/org/apache/fop/fotreetest/FOTreeUnitTester.java @@ -94,6 +94,6 @@ public abstract class FOTreeUnitTester extends TestCase { foReader.setErrorHandler(fop.getDefaultHandler()); foReader.setEntityResolver(fop.getDefaultHandler()); - foReader.parse(new File("test/fotree/unittests/" + filename).toURL().toExternalForm()); + foReader.parse(new File("test/fotree/unittests/" + filename).toURI().toURL().toExternalForm()); } } diff --git a/test/java/org/apache/fop/fotreetest/ext/TestElementMapping.java b/test/java/org/apache/fop/fotreetest/ext/TestElementMapping.java index 1d9127d0c..eee0efac4 100644 --- a/test/java/org/apache/fop/fotreetest/ext/TestElementMapping.java +++ b/test/java/org/apache/fop/fotreetest/ext/TestElementMapping.java @@ -40,7 +40,7 @@ public class TestElementMapping extends ElementMapping { /** @see org.apache.fop.fo.ElementMapping#initialize() */ protected void initialize() { if (foObjs == null) { - foObjs = new java.util.HashMap(); + foObjs = new java.util.HashMap<String, Maker>(); foObjs.put("assert", new AssertMaker()); } } diff --git a/test/java/org/apache/fop/layoutengine/LayoutEngineTester.java b/test/java/org/apache/fop/layoutengine/LayoutEngineTester.java index d938a852b..2c0cf8504 100644 --- a/test/java/org/apache/fop/layoutengine/LayoutEngineTester.java +++ b/test/java/org/apache/fop/layoutengine/LayoutEngineTester.java @@ -116,7 +116,7 @@ public class LayoutEngineTester { //Setup FOP for area tree rendering FOUserAgent ua = effFactory.newFOUserAgent(); - ua.setBaseURL(testFile.getParentFile().toURL().toString()); + ua.setBaseURL(testFile.getParentFile().toURI().toURL().toString()); ua.getEventBroadcaster().addEventListener( new ConsoleEventListenerForTests(testFile.getName(), EventSeverity.WARN)); diff --git a/test/java/org/apache/fop/memory/MemoryEater.java b/test/java/org/apache/fop/memory/MemoryEater.java index a665580ae..337027dc4 100644 --- a/test/java/org/apache/fop/memory/MemoryEater.java +++ b/test/java/org/apache/fop/memory/MemoryEater.java @@ -79,7 +79,7 @@ public class MemoryEater { OutputStream out = new NullOutputStream(); //write to /dev/nul try { FOUserAgent userAgent = fopFactory.newFOUserAgent(); - userAgent.setBaseURL(foFile.getParentFile().toURL().toExternalForm()); + userAgent.setBaseURL(foFile.getParentFile().toURI().toURL().toExternalForm()); Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF, userAgent, out); Result res = new SAXResult(fop.getDefaultHandler()); diff --git a/test/java/org/apache/fop/memory/Stats.java b/test/java/org/apache/fop/memory/Stats.java index 9e371251d..354952347 100644 --- a/test/java/org/apache/fop/memory/Stats.java +++ b/test/java/org/apache/fop/memory/Stats.java @@ -71,7 +71,7 @@ class Stats { public void dumpFinalStats() { long duration = System.currentTimeMillis() - startTime; System.out.println("Final statistics"); - System.out.println("Pages produced: " +totalPagesProduced); + System.out.println("Pages produced: " + totalPagesProduced); long ppm = 60000 * totalPagesProduced / duration; System.out.println("Average speed: " + ppm + "ppm"); } diff --git a/test/java/org/apache/fop/render/RendererFactoryTest.java b/test/java/org/apache/fop/render/RendererFactoryTest.java index 4a40ac7c1..6b8e8f5f3 100644 --- a/test/java/org/apache/fop/render/RendererFactoryTest.java +++ b/test/java/org/apache/fop/render/RendererFactoryTest.java @@ -33,7 +33,6 @@ import org.apache.fop.render.intermediate.IFContext; import org.apache.fop.render.intermediate.IFDocumentHandler; import org.apache.fop.render.intermediate.IFRenderer; import org.apache.fop.render.pdf.PDFDocumentHandler; -import org.apache.fop.render.pdf.PDFRenderer; import org.apache.fop.render.rtf.RTFHandler; /** @@ -73,29 +72,15 @@ public class RendererFactoryTest extends TestCase { RendererFactory factory = fopFactory.getRendererFactory(); FOUserAgent ua; Renderer renderer; - Renderer overrideRenderer; ua = fopFactory.newFOUserAgent(); renderer = factory.createRenderer(ua, MimeConstants.MIME_PDF); assertTrue(renderer instanceof IFRenderer); - factory.setRendererPreferred(true); //Test legacy setting - ua = fopFactory.newFOUserAgent(); - renderer = factory.createRenderer(ua, MimeConstants.MIME_PDF); - assertTrue(renderer instanceof PDFRenderer); - ua = fopFactory.newFOUserAgent(); renderer = factory.createRenderer(ua, MimeConstants.MIME_FOP_IF); assertTrue(renderer instanceof IFRenderer); - factory.setRendererPreferred(false); - ua = fopFactory.newFOUserAgent(); - overrideRenderer = new PDFRenderer(); - overrideRenderer.setUserAgent(ua); - ua.setRendererOverride(overrideRenderer); - renderer = factory.createRenderer(ua, null); - assertTrue(renderer == overrideRenderer); - ua = fopFactory.newFOUserAgent(); IFDocumentHandler overrideHandler; overrideHandler = new PDFDocumentHandler(); diff --git a/test/java/org/apache/fop/render/pdf/PDFCMapTestCase.java b/test/java/org/apache/fop/render/pdf/PDFCMapTestCase.java index f5d2f84cf..bd5c8ade1 100644 --- a/test/java/org/apache/fop/render/pdf/PDFCMapTestCase.java +++ b/test/java/org/apache/fop/render/pdf/PDFCMapTestCase.java @@ -27,38 +27,38 @@ import org.apache.fop.pdf.CMapBuilder; /** Simple sanity test of the PDFCmap class */ public class PDFCMapTestCase extends TestCase { + private static final String EOL = "\n"; public void testPDFCMapFillInPDF() throws Exception { - final String EOL = "\n"; - final String expected = - "%!PS-Adobe-3.0 Resource-CMap" + EOL - +"%%DocumentNeededResources: ProcSet (CIDInit)" + EOL - +"%%IncludeResource: ProcSet (CIDInit)" + EOL - +"%%BeginResource: CMap (test)" + EOL - +"%%EndComments" + EOL - +"/CIDInit /ProcSet findresource begin" + EOL - +"12 dict begin" + EOL - +"begincmap" + EOL - +"/CIDSystemInfo 3 dict dup begin" + EOL - +" /Registry (Adobe) def" + EOL - +" /Ordering (Identity) def" + EOL - +" /Supplement 0 def" + EOL - +"end def" + EOL - +"/CMapVersion 1 def" + EOL - +"/CMapType 1 def" + EOL - +"/CMapName /test def" + EOL - +"1 begincodespacerange" + EOL - +"<0000> <FFFF>" + EOL - +"endcodespacerange" + EOL - +"1 begincidrange" + EOL - +"<0000> <FFFF> 0" + EOL - +"endcidrange" + EOL - +"endcmap" + EOL - +"CMapName currentdict /CMap defineresource pop" + EOL - +"end" + EOL - +"end" + EOL - +"%%EndResource" + EOL - +"%%EOF" + EOL + final String expected + = "%!PS-Adobe-3.0 Resource-CMap" + EOL + + "%%DocumentNeededResources: ProcSet (CIDInit)" + EOL + + "%%IncludeResource: ProcSet (CIDInit)" + EOL + + "%%BeginResource: CMap (test)" + EOL + + "%%EndComments" + EOL + + "/CIDInit /ProcSet findresource begin" + EOL + + "12 dict begin" + EOL + + "begincmap" + EOL + + "/CIDSystemInfo 3 dict dup begin" + EOL + + " /Registry (Adobe) def" + EOL + + " /Ordering (Identity) def" + EOL + + " /Supplement 0 def" + EOL + + "end def" + EOL + + "/CMapVersion 1 def" + EOL + + "/CMapType 1 def" + EOL + + "/CMapName /test def" + EOL + + "1 begincodespacerange" + EOL + + "<0000> <FFFF>" + EOL + + "endcodespacerange" + EOL + + "1 begincidrange" + EOL + + "<0000> <FFFF> 0" + EOL + + "endcidrange" + EOL + + "endcmap" + EOL + + "CMapName currentdict /CMap defineresource pop" + EOL + + "end" + EOL + + "end" + EOL + + "%%EndResource" + EOL + + "%%EOF" + EOL ; final StringWriter w = new StringWriter(); diff --git a/test/java/org/apache/fop/render/ps/ImageHandlingTestCase.java b/test/java/org/apache/fop/render/ps/ImageHandlingTestCase.java index 7f0462a75..72c677a0c 100644 --- a/test/java/org/apache/fop/render/ps/ImageHandlingTestCase.java +++ b/test/java/org/apache/fop/render/ps/ImageHandlingTestCase.java @@ -43,52 +43,22 @@ import org.apache.fop.render.intermediate.IFContext; public class ImageHandlingTestCase extends AbstractPostScriptTestCase { /** - * Tests JPEG handling with the {@link PSRenderer}. + * Tests JPEG handling. * @throws Exception if an error occurs */ - public void testJPEGImageWithRendererLevel3() throws Exception { - innerTestJPEGImageWithRenderer(3); + public void testJPEGImageLevel3() throws Exception { + innerTestJPEGImage(3); } /** - * Tests JPEG handling with the {@link PSRenderer}. + * Tests JPEG handling. * @throws Exception if an error occurs */ - public void testJPEGImageWithRendererLevel2() throws Exception { - innerTestJPEGImageWithRenderer(2); + public void testJPEGImageLevel2() throws Exception { + innerTestJPEGImage(2); } - /** - * Tests JPEG handling with the {@link PSDocumentHandler}. - * @throws Exception if an error occurs - */ - public void testJPEGImageWithIFLevel3() throws Exception { - innerTestJPEGImageWithIF(3); - } - - /** - * Tests JPEG handling with the {@link PSDocumentHandler}. - * @throws Exception if an error occurs - */ - public void testJPEGImageWithIFLevel2() throws Exception { - innerTestJPEGImageWithIF(2); - } - - private void innerTestJPEGImageWithRenderer(int level) throws Exception { - FOUserAgent ua = fopFactory.newFOUserAgent(); - PSRenderer renderer = new PSRenderer(); - renderer.setUserAgent(ua); - PSRenderingUtil psUtil = renderer.getPSUtil(); - psUtil.setLanguageLevel(level); - psUtil.setOptimizeResources(true); - ua.setRendererOverride(renderer); - - // Prepare output file - File outputFile = renderFile(ua, "ps-jpeg-image.fo", "-rend-l" + psUtil.getLanguageLevel()); - verifyPostScriptFile(outputFile, psUtil.getLanguageLevel()); - } - - private void innerTestJPEGImageWithIF(int level) throws Exception { + private void innerTestJPEGImage(int level) throws Exception { FOUserAgent ua = fopFactory.newFOUserAgent(); PSDocumentHandler handler = new PSDocumentHandler(); handler.setContext(new IFContext(ua)); @@ -159,10 +129,6 @@ public class ImageHandlingTestCase extends AbstractPostScriptTestCase { } } - private void assertMatches(String text, String regex) { - assertTrue("Text didn't match '" + regex + "'", text.matches(regex)); - } - private void assertContains(String text, String searchString) { assertTrue("Text doesn't contain '" + searchString + "'", text.indexOf(searchString) >= 0); } diff --git a/test/java/org/apache/fop/render/ps/ResourceOptimizationTestCase.java b/test/java/org/apache/fop/render/ps/ResourceOptimizationTestCase.java index e5b9a4d27..862ad5205 100644 --- a/test/java/org/apache/fop/render/ps/ResourceOptimizationTestCase.java +++ b/test/java/org/apache/fop/render/ps/ResourceOptimizationTestCase.java @@ -54,28 +54,10 @@ import org.apache.fop.render.intermediate.IFContext; public class ResourceOptimizationTestCase extends AbstractPostScriptTestCase { /** - * Tests resource optimization with the {@link PSRenderer}. + * Tests resource optimization. * @throws Exception if an error occurs */ - public void testResourceOptimizationWithRenderer() throws Exception { - FOUserAgent ua = fopFactory.newFOUserAgent(); - PSRenderer renderer = new PSRenderer(); - renderer.setUserAgent(ua); - // This is the important part: we're enabling resource optimization - renderer.getPSUtil().setOptimizeResources(true); - ua.setRendererOverride(renderer); - - // Prepare output file - File outputFile = renderFile(ua, "ps-resources.fo", - "-rend-l" + renderer.getPSUtil().getLanguageLevel()); - verifyPostScriptFile(outputFile); - } - - /** - * Tests resource optimization with the {@link PSDocumentHandler}. - * @throws Exception if an error occurs - */ - public void testResourceOptimizationWithIF() throws Exception { + public void testResourceOptimization() throws Exception { FOUserAgent ua = fopFactory.newFOUserAgent(); PSDocumentHandler handler = new PSDocumentHandler(); handler.setContext(new IFContext(ua)); diff --git a/test/java/org/apache/fop/text/linebreak/LineBreakStatusTest.java b/test/java/org/apache/fop/text/linebreak/LineBreakStatusTest.java index 8d2936127..e9b2ff90d 100644 --- a/test/java/org/apache/fop/text/linebreak/LineBreakStatusTest.java +++ b/test/java/org/apache/fop/text/linebreak/LineBreakStatusTest.java @@ -320,6 +320,12 @@ public class LineBreakStatusTest extends TestCase { "^^^^^^" + "^" + "_^^^^" )); + // Unassigned codepoint: should yield same result as AL + assertTrue(testBreak( + "No" + "\u1F7E" + "break", + "^^" + "^" + "^^^^^" + )); + } /** diff --git a/test/java/org/apache/fop/text/linebreak/LineBreakUtilsTest.java b/test/java/org/apache/fop/text/linebreak/LineBreakUtilsTest.java index 31ad950c7..bb6d209c2 100644 --- a/test/java/org/apache/fop/text/linebreak/LineBreakUtilsTest.java +++ b/test/java/org/apache/fop/text/linebreak/LineBreakUtilsTest.java @@ -41,6 +41,7 @@ public class LineBreakUtilsTest extends TestCase { assertEquals(LineBreakUtils.getLineBreakProperty('\n'), LineBreakUtils.LINE_BREAK_PROPERTY_LF); assertEquals(LineBreakUtils.getLineBreakProperty('\r'), LineBreakUtils.LINE_BREAK_PROPERTY_CR); assertEquals(LineBreakUtils.getLineBreakProperty('('), LineBreakUtils.LINE_BREAK_PROPERTY_OP); + assertEquals(LineBreakUtils.getLineBreakProperty('\u1F7E'), 0); } public void testLineBreakPair() { diff --git a/test/java/org/apache/fop/traits/BorderPropsTestCase.java b/test/java/org/apache/fop/traits/BorderPropsTestCase.java index 8ca097985..6eb41daac 100644 --- a/test/java/org/apache/fop/traits/BorderPropsTestCase.java +++ b/test/java/org/apache/fop/traits/BorderPropsTestCase.java @@ -23,6 +23,7 @@ import java.awt.Color; import junit.framework.TestCase; +import org.apache.xmlgraphics.java2d.color.ColorSpaces; import org.apache.xmlgraphics.java2d.color.DeviceCMYKColorSpace; import org.apache.fop.fo.Constants; diff --git a/test/java/org/apache/fop/util/DigestFilter.java b/test/java/org/apache/fop/util/DigestFilter.java index 0384b42df..94e8d67d2 100644 --- a/test/java/org/apache/fop/util/DigestFilter.java +++ b/test/java/org/apache/fop/util/DigestFilter.java @@ -43,7 +43,7 @@ import org.xml.sax.helpers.XMLFilterImpl; public class DigestFilter extends XMLFilterImpl { private MessageDigest digest; - private byte value[]; + private byte[] value; private boolean isNamespaceAware; public DigestFilter(String algorithm) throws NoSuchAlgorithmException { @@ -133,7 +133,7 @@ public class DigestFilter extends XMLFilterImpl { */ public void setFeature(String feature, boolean value) throws SAXNotRecognizedException, SAXNotSupportedException { - if(feature.equals("http://xml.org/sax/features/namespaces")) { + if (feature.equals("http://xml.org/sax/features/namespaces")) { isNamespaceAware = value; } super.setFeature(feature, value); diff --git a/test/java/org/apache/fop/visual/AbstractPSPDFBitmapProducer.java b/test/java/org/apache/fop/visual/AbstractPSPDFBitmapProducer.java index 0d976219d..678e80e7d 100644 --- a/test/java/org/apache/fop/visual/AbstractPSPDFBitmapProducer.java +++ b/test/java/org/apache/fop/visual/AbstractPSPDFBitmapProducer.java @@ -122,7 +122,7 @@ public abstract class AbstractPSPDFBitmapProducer extends AbstractBitmapProducer try { FOUserAgent userAgent = fopFactory.newFOUserAgent(); userAgent.setTargetResolution(context.getTargetResolution()); - userAgent.setBaseURL(src.getParentFile().toURL().toString()); + userAgent.setBaseURL(src.getParentFile().toURI().toURL().toString()); File tempOut = new File(context.getTargetDir(), src.getName() + "." + index + "." + getTargetExtension()); diff --git a/test/java/org/apache/fop/visual/BitmapProducerJava2D.java b/test/java/org/apache/fop/visual/BitmapProducerJava2D.java index bd78fd93f..997a75931 100644 --- a/test/java/org/apache/fop/visual/BitmapProducerJava2D.java +++ b/test/java/org/apache/fop/visual/BitmapProducerJava2D.java @@ -70,7 +70,7 @@ public class BitmapProducerJava2D extends AbstractBitmapProducer implements Conf try { FOUserAgent userAgent = fopFactory.newFOUserAgent(); userAgent.setTargetResolution(context.getTargetResolution()); - userAgent.setBaseURL(src.getParentFile().toURL().toString()); + userAgent.setBaseURL(src.getParentFile().toURI().toURL().toString()); File outputFile = new File(context.getTargetDir(), src.getName() + "." + index + ".java2d.png"); diff --git a/test/layoutengine/disabled-testcases.xml b/test/layoutengine/disabled-testcases.xml index 1fb4f2926..6c61ca747 100644 --- a/test/layoutengine/disabled-testcases.xml +++ b/test/layoutengine/disabled-testcases.xml @@ -39,12 +39,6 @@ <description>Font-stretch is not implemented, yet.</description> </testcase> <testcase> - <name>Hyphenation with preserved linefeeds</name> - <file>block_hyphenation_linefeed_preserve.xml</file> - <description>When hyphenation is enabled and linefeeds are preserved, - the text is output multiple times.</description> - </testcase> - <testcase> <name>linefeed-treatment</name> <file>block_linefeed-treatment.xml</file> <description>Preserved linefeeds in a fo:character are not handled diff --git a/test/layoutengine/hyphenation-testcases/block_hyphenation_linefeed_preserve.xml b/test/layoutengine/hyphenation-testcases/block_hyphenation_linefeed_preserve.xml index d1231892f..ac13e9875 100644 --- a/test/layoutengine/hyphenation-testcases/block_hyphenation_linefeed_preserve.xml +++ b/test/layoutengine/hyphenation-testcases/block_hyphenation_linefeed_preserve.xml @@ -19,7 +19,11 @@ <testcase> <info> <p> - Check for bug: Duplicate content and linefeeds as "#". + Check for bug 38264: + <ul> + <li>duplication of content with linefeed-treatment="preserve" and hyphenate="true"</li> + <li>missing hyphens with white-space-treatment="preserve" and hyphenate="true"</li> + </ul> </p> </info> <fo> @@ -31,21 +35,39 @@ </fo:layout-master-set> <fo:page-sequence master-reference="simple"> <fo:flow flow-name="xsl-region-body"> - <fo:block line-height="10pt" background-color="orange" - white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve">Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Maecenas semper. Proin at.</fo:block> - <fo:block line-height="10pt" background-color="orange" - white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve"> + <fo:block white-space-collapse="false" white-space-treatment="preserve" linefeed-treatment="preserve"> line1 line2 -Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Maecenas semper. Proin at1. -</fo:block> +Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Maecenas semper. Proin at. + </fo:block> </fo:flow> </fo:page-sequence> </fo:root> </fo> <checks> - <!-- Dummy check. We don't want an NPE. --> - <eval expected="2" xpath="count(//*[contains(text(), 'adipiscing')])"/> + <!-- check number of lines and word fragments --> + <eval expected="13" xpath="count(//flow[1]/block/lineArea)" /> + <eval expected="17" xpath="count(//flow[1]/block/lineArea/text/word)" /> + <!-- check individual word fragments --> + <eval expected="line1" xpath="(//flow[1]/block/lineArea/text/word)[1]" /> + <eval expected="line2" xpath="(//flow[1]/block/lineArea/text/word)[2]" /> + <eval expected="Lorem" xpath="(//flow[1]/block/lineArea/text/word)[3]" /> + <eval expected="ip-" xpath="(//flow[1]/block/lineArea/text/word)[4]" /> + <eval expected="sum" xpath="(//flow[1]/block/lineArea/text/word)[5]" /> + <eval expected="dolor" xpath="(//flow[1]/block/lineArea/text/word)[6]" /> + <eval expected="sit" xpath="(//flow[1]/block/lineArea/text/word)[7]" /> + <eval expected="amet," xpath="(//flow[1]/block/lineArea/text/word)[8]" /> + <eval expected="con-" xpath="(//flow[1]/block/lineArea/text/word)[9]" /> + <eval expected="sectetuer" xpath="(//flow[1]/block/lineArea/text/word)[10]" /> + <eval expected="adipiscing" xpath="(//flow[1]/block/lineArea/text/word)[11]" /> + <eval expected="elit." xpath="(//flow[1]/block/lineArea/text/word)[12]" /> + <eval expected="Maece-" xpath="(//flow[1]/block/lineArea/text/word)[13]" /> + <eval expected="nas" xpath="(//flow[1]/block/lineArea/text/word)[14]" /> + <eval expected="semper." xpath="(//flow[1]/block/lineArea/text/word)[15]" /> + <eval expected="Proin" xpath="(//flow[1]/block/lineArea/text/word)[16]" /> + <eval expected="at." xpath="(//flow[1]/block/lineArea/text/word)[17]" /> + <!-- check preservation of spaces on the last line --> + <eval expected="10" xpath="count((//flow[1]/block/lineArea)[13]/text/space)" /> </checks> </testcase> diff --git a/test/layoutengine/hyphenation-testcases/hyphenation-pattern_fallback.xml b/test/layoutengine/hyphenation-testcases/hyphenation-pattern_fallback.xml new file mode 100644 index 000000000..3af71a3ea --- /dev/null +++ b/test/layoutengine/hyphenation-testcases/hyphenation-pattern_fallback.xml @@ -0,0 +1,137 @@ +<?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> + Checks fallback from hyphenation pattern for (lang,country) to hyphenation pattern for (lang) + </p> + </info> + <fo> +<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"> + + <fo:layout-master-set> + <fo:simple-page-master master-name="simple" + page-height="29.7cm" + page-width="21cm" + margin-top="1cm" + margin-bottom="2cm" + margin-left="7cm" + margin-right="3cm"> + <fo:region-body margin-top="1.5cm"/> + </fo:simple-page-master> + </fo:layout-master-set> + <!-- end: defines page layout --> + + + <fo:page-sequence master-reference="simple"> + + <fo:flow flow-name="xsl-region-body" + text-align="justify"> + + <fo:block font-size="12pt" + font-family="sans-serif" + background-color="blue" + color="white" + text-align="start"> + language="en",country="IN" + </fo:block> + <fo:block font-size="12pt" + font-family="sans-serif" + space-after="3pt" + language="en" + country="IN" + hyphenate="true" + hyphenation-ladder-count="no-limit" + > + This document has been reviewed by W3C Members and other interested parties and has been endorsed by the Director as a + W3C Recommendation. It is a stable document and may be used as reference material or cited as a normative reference from + another document. W3C's role in making the Recommendation is to draw attention to the specification and to promote its + widespread deployment. This enhances the functionality and interoperability of the Web. + </fo:block> + + <fo:block font-size="12pt" + font-family="sans-serif" + background-color="blue" + color="white" + text-align="start"> + language="em" + </fo:block> + <fo:block font-size="12pt" + font-family="sans-serif" + space-after="3pt" + language="em" + hyphenate="true" + hyphenation-ladder-count="no-limit" + > + This document has been reviewed by W3C Members and other interested parties and has been endorsed by the Director as a + W3C Recommendation. It is a stable document and may be used as reference material or cited as a normative reference from + another document. W3C's role in making the Recommendation is to draw attention to the specification and to promote its + widespread deployment. This enhances the functionality and interoperability of the Web. + </fo:block> + + <fo:block font-size="12pt" + font-family="sans-serif" + background-color="blue" + color="white" + text-align="start"> + language="em",country="IN" + </fo:block> + <fo:block font-size="12pt" + font-family="sans-serif" + space-after="3pt" + language="em" + country="IN" + hyphenate="true" + hyphenation-ladder-count="no-limit" + > + This document has been reviewed by W3C Members and other interested parties and has been endorsed by the Director as a + W3C Recommendation. It is a stable document and may be used as reference material or cited as a normative reference from + another document. W3C's role in making the Recommendation is to draw attention to the specification and to promote its + widespread deployment. This enhances the functionality and interoperability of the Web. + </fo:block> + + </fo:flow> + </fo:page-sequence> +</fo:root> + + </fo> + + <checks> + <eval expected="8" xpath="count(//pageViewport[1]//flow/block[2]/lineArea)"/> + <eval expected="Di-" xpath="//pageViewport[1]//flow/block[2]/lineArea[2]/text/word[10]"/> + <eval expected="norma-" xpath="//pageViewport[1]//flow/block[2]/lineArea[4]/text/word[12]"/> + <eval expected="mak-" xpath="//pageViewport[1]//flow/block[2]/lineArea[5]/text/word[9]"/> + <eval expected="specifi-" xpath="//pageViewport[1]//flow/block[2]/lineArea[6]/text/word[10]"/> + <eval expected="en-" xpath="//pageViewport[1]//flow/block[2]/lineArea[7]/text/word[9]"/> + + <eval expected="9" xpath="count(//pageViewport[1]//flow/block[4]/lineArea)"/> + <eval expected="by" xpath="//pageViewport[1]//flow/block[4]/lineArea[2]/text/word[9]"/> + <eval expected="cited" xpath="//pageViewport[1]//flow/block[4]/lineArea[4]/text/word[10]"/> + <eval expected="document." xpath="//pageViewport[1]//flow/block[4]/lineArea[5]/text/word[7]"/> + <eval expected="to" xpath="//pageViewport[1]//flow/block[4]/lineArea[6]/text/word[10]"/> + <eval expected="deployment." xpath="//pageViewport[1]//flow/block[4]/lineArea[7]/text/word[8]"/> + + <eval expected="9" xpath="count(//pageViewport[1]//flow/block[6]/lineArea)"/> + <eval expected="by" xpath="//pageViewport[1]//flow/block[6]/lineArea[2]/text/word[9]"/> + <eval expected="cited" xpath="//pageViewport[1]//flow/block[6]/lineArea[4]/text/word[10]"/> + <eval expected="document." xpath="//pageViewport[1]//flow/block[6]/lineArea[5]/text/word[7]"/> + <eval expected="to" xpath="//pageViewport[1]//flow/block[6]/lineArea[6]/text/word[10]"/> + <eval expected="deployment." xpath="//pageViewport[1]//flow/block[6]/lineArea[7]/text/word[8]"/> + </checks> +</testcase> diff --git a/test/layoutengine/hyphenation-testcases/inline_hyphenation_border.xml b/test/layoutengine/hyphenation-testcases/inline_hyphenation_border.xml new file mode 100644 index 000000000..f3c133e6e --- /dev/null +++ b/test/layoutengine/hyphenation-testcases/inline_hyphenation_border.xml @@ -0,0 +1,49 @@ +<?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 whether the border is properly rendered with + hyphenation. I effectively checks whether + InlineStackingLM.applyChanges rewraps the positions properly. + </p> + </info> + <fo> + <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"> + <fo:layout-master-set> + <fo:simple-page-master master-name="normal" page-width="210mm" page-height="297mm"> + <fo:region-body/> + </fo:simple-page-master> + </fo:layout-master-set> + <fo:page-sequence master-reference="normal"> + <fo:flow flow-name="xsl-region-body"> + <fo:block hyphenate="true" language="en"> + <fo:inline border-color="#000000" border-style="solid" border-width="1pt">Test</fo:inline> + </fo:block> + </fo:flow> + </fo:page-sequence> + </fo:root> + </fo> + <checks> + <eval expected="(solid,#000000,1000)" xpath="//flow/block[1]/lineArea/inlineparent/@border-start"/> + <eval expected="(solid,#000000,1000)" xpath="//flow/block[1]/lineArea/inlineparent/@border-end"/> + <eval expected="(solid,#000000,1000)" xpath="//flow/block[1]/lineArea/inlineparent/@border-before"/> + <eval expected="(solid,#000000,1000)" xpath="//flow/block[1]/lineArea/inlineparent/@border-after"/> + </checks> +</testcase> diff --git a/test/layoutengine/standard-testcases/basic-link_for_toc.xml b/test/layoutengine/standard-testcases/basic-link_for_toc.xml new file mode 100644 index 000000000..9966c54b1 --- /dev/null +++ b/test/layoutengine/standard-testcases/basic-link_for_toc.xml @@ -0,0 +1,53 @@ +<?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 fo:basic-link in conjunction with text-align="justify" and an + fo:page-number-citation. + </p> + </info> + <fo> + <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"> + <fo:layout-master-set> + <fo:simple-page-master master-name="normal" page-width="5in" page-height="5in"> + <fo:region-body/> + </fo:simple-page-master> + </fo:layout-master-set> + <fo:page-sequence master-reference="normal"> + <fo:flow flow-name="xsl-region-body"> + <fo:block text-align="justify"> + You can read about Apache FOP in + <fo:basic-link external-destination="http://xmlgraphics.apache.org/fop/" + >chapter 1 on page <fo:page-number-citation ref-id="1"/></fo:basic-link>. + Apache FOP is open source, BTW. + </fo:block> + <fo:block id="1"/> + </fo:flow> + </fo:page-sequence> + </fo:root> + </fo> + <checks> + <eval expected="http://xmlgraphics.apache.org/fop/" xpath="substring-after(//flow/block[1]/lineArea/inlineparent/@external-link,'dest=')"/> + <eval expected="360000" xpath="//flow/block[1]/lineArea/@ipd"/> + <eval expected="104440" xpath="//flow/block[1]/lineArea/inlineparent/text[1]/@ipd"/> + <eval expected="6672" xpath="//flow/block[1]/lineArea/inlineparent/text[2]/@ipd"/> + <eval expected="111112" xpath="//flow/block[1]/lineArea/inlineparent/@ipd"/> + </checks> +</testcase> diff --git a/test/layoutengine/standard-testcases/block-container_break.xml b/test/layoutengine/standard-testcases/block-container_break.xml new file mode 100644 index 000000000..352f755f0 --- /dev/null +++ b/test/layoutengine/standard-testcases/block-container_break.xml @@ -0,0 +1,47 @@ +<?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 that a forced break on a child element of an fo:block-container is honored. + </p> + </info> + <fo> + <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"> + <fo:layout-master-set> + <fo:simple-page-master master-name="page" + page-height="420pt" page-width="320pt" margin="10pt"> + <fo:region-body/> + </fo:simple-page-master> + </fo:layout-master-set> + <fo:page-sequence master-reference="page"> + <fo:flow flow-name="xsl-region-body"> + <fo:block-container> + <fo:block id="before-break" break-after="page">Before the break.</fo:block> + <fo:block id="after-break">After the break.</fo:block> + </fo:block-container> + </fo:flow> + </fo:page-sequence> + </fo:root> + </fo> + <checks> + <eval expected="2" xpath="count(//pageViewport)"/> + <eval expected="After the break." xpath="//pageViewport[2]//flow/block/block/block//text"/> + </checks> +</testcase> diff --git a/test/layoutengine/standard-testcases/flow_changing-ipd_image.xml b/test/layoutengine/standard-testcases/flow_changing-ipd_image.xml new file mode 100644 index 000000000..37014f49a --- /dev/null +++ b/test/layoutengine/standard-testcases/flow_changing-ipd_image.xml @@ -0,0 +1,60 @@ +<?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 that an image is properly positioned after a page break triggering changing + IPD. + </p> + </info> + <fo> + <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"> + <fo:layout-master-set> + <fo:simple-page-master master-name="narrow" + page-height="220pt" page-width="320pt" margin="10pt"> + <fo:region-body background-color="#F0F0F0"/> + </fo:simple-page-master> + <fo:simple-page-master master-name="wide" + page-height="220pt" page-width="420pt" margin="10pt"> + <fo:region-body background-color="#F0F0F0"/> + </fo:simple-page-master> + <fo:page-sequence-master master-name="pages"> + <fo:repeatable-page-master-alternatives> + <fo:conditional-page-master-reference odd-or-even="odd" master-reference="narrow"/> + <fo:conditional-page-master-reference odd-or-even="even" master-reference="wide"/> + </fo:repeatable-page-master-alternatives> + </fo:page-sequence-master> + </fo:layout-master-set> + <fo:page-sequence master-reference="pages" font-size="8pt" line-height="10pt"> + <fo:flow flow-name="xsl-region-body" text-align="justify"> + <fo:block space-after="180pt">First block</fo:block> + <fo:block id="before">Block before the page break.</fo:block> + <fo:block id="after">Block after the page break.</fo:block> + <fo:block id="image-block"><fo:external-graphic id="image" + src="../../resources/images/fop-logo-color-24bit.png"/></fo:block> + </fo:flow> + </fo:page-sequence> + </fo:root> + </fo> + <checks> + <eval expected="Block before the page break." xpath="//pageViewport[1]//flow/block[2]//text"/> + <eval expected="Block after the page break." xpath="//pageViewport[2]//flow/block[1]//text"/> + <eval expected="0" xpath="//pageViewport[2]//flow/block[2]//viewport/@offset"/> + </checks> +</testcase> diff --git a/test/layoutengine/standard-testcases/flow_changing-ipd_table-after-break.xml b/test/layoutengine/standard-testcases/flow_changing-ipd_table-after-break.xml index 956563e20..1b10d722c 100644 --- a/test/layoutengine/standard-testcases/flow_changing-ipd_table-after-break.xml +++ b/test/layoutengine/standard-testcases/flow_changing-ipd_table-after-break.xml @@ -56,13 +56,19 @@ <fo:table table-layout="fixed" width="100%"> <fo:table-body> <fo:table-row> - <fo:table-cell> - <fo:block>After the table 1</fo:block> + <fo:table-cell border="1pt solid black"> + <fo:block>Cell 1.1</fo:block> + </fo:table-cell> + <fo:table-cell border="1pt solid black"> + <fo:block>Cell 1.2</fo:block> </fo:table-cell> </fo:table-row> <fo:table-row> - <fo:table-cell> - <fo:block>After the table 2</fo:block> + <fo:table-cell border="1pt solid black"> + <fo:block>Cell 2.1</fo:block> + </fo:table-cell> + <fo:table-cell border="1pt solid black"> + <fo:block>Cell 2.2</fo:block> </fo:table-cell> </fo:table-row> </fo:table-body> @@ -74,7 +80,12 @@ <checks> <eval expected="Block before the page break." xpath="//pageViewport[1]//flow/block[2]//text"/> <eval expected="Block after the page break." xpath="//pageViewport[2]//flow/block[1]//text"/> - <eval expected="After the table 1" xpath="//pageViewport[2]//flow/block[2]/block[1]//text"/> - <eval expected="After the table 2" xpath="//pageViewport[2]//flow/block[2]/block[2]//text"/> + <eval expected="400000" xpath="//pageViewport[2]//flow/block[2]/@ipd"/> + <eval expected="199000" xpath="//pageViewport[2]//flow/block[2]/block[1]/@ipd"/> + <eval expected="Cell 1.1" xpath="//pageViewport[2]//flow/block[2]/block[1]//text"/> + <eval expected="199000" xpath="//pageViewport[2]//flow/block[2]/block[2]/@ipd"/> + <eval expected="Cell 1.2" xpath="//pageViewport[2]//flow/block[2]/block[2]//text"/> + <eval expected="Cell 2.1" xpath="//pageViewport[2]//flow/block[2]/block[3]//text"/> + <eval expected="Cell 2.2" xpath="//pageViewport[2]//flow/block[2]/block[4]//text"/> </checks> </testcase> diff --git a/test/layoutengine/standard-testcases/fox_widow-content-limit_bug48380.xml b/test/layoutengine/standard-testcases/fox_widow-content-limit_bug48380.xml new file mode 100644 index 000000000..83d5bd499 --- /dev/null +++ b/test/layoutengine/standard-testcases/fox_widow-content-limit_bug48380.xml @@ -0,0 +1,61 @@ +<?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> + Check for bug 48380: ClassCastException when using fox:widow-content-limit. + </p> + </info> + <fo> + <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:fox="http://xmlgraphics.apache.org/fop/extensions"> + <fo:layout-master-set> + <fo:simple-page-master master-name="normal" page-width="210mm" page-height="297mm"> + <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"> + <fo:table fox:orphan-content-limit="4em" fox:widow-content-limit="4em" table-layout="fixed" width="100%"> + <fo:table-body> + <fo:table-row> + <fo:table-cell> + <fo:block> + <fo:list-block space-after="6pt"> + <fo:list-item> + <fo:list-item-label> + <fo:block>.</fo:block> + </fo:list-item-label> + <fo:list-item-body> + <fo:block start-indent="1cm">test</fo:block> + </fo:list-item-body> + </fo:list-item> + </fo:list-block> + </fo:block> + </fo:table-cell> + </fo:table-row> + </fo:table-body> + </fo:table> + </fo:flow> + </fo:page-sequence> + </fo:root> + </fo> + <checks> + <!-- Run only basic checks; should not throw a ClassCastException --> + </checks> +</testcase>
\ No newline at end of file diff --git a/test/layoutengine/standard-testcases/inline_keep-together.xml b/test/layoutengine/standard-testcases/inline_keep-together.xml index 6ec4ce603..0c6ae682a 100644 --- a/test/layoutengine/standard-testcases/inline_keep-together.xml +++ b/test/layoutengine/standard-testcases/inline_keep-together.xml @@ -38,6 +38,22 @@ <fo:block keep-together.within-line="always">This is Blah blah blah blah!</fo:block> <fo:block>This is <fo:inline keep-together.within-line="always">Blah blah blah blah!</fo:inline></fo:block> <fo:block>This is <fo:wrapper keep-together.within-line="always">Blah blah blah blah!</fo:wrapper></fo:block> + <fo:block> + <fo:inline keep-together.within-line="always"> + This<fo:inline> entire</fo:inline> sentence + <fo:inline>should be </fo:inline>kept + <fo:inline>together + <fo:inline>on + <fo:inline>one + <fo:inline>very, + <fo:inline>very,</fo:inline> + <fo:inline>very,</fo:inline> + <fo:inline>very,</fo:inline> + <fo:inline>long</fo:inline> + </fo:inline></fo:inline></fo:inline>line + </fo:inline> + </fo:inline> + </fo:block> </fo:block-container> </fo:flow> </fo:page-sequence> @@ -54,6 +70,9 @@ <!-- The layout engine should warn the user about the overflow in this case. --> <eval expected="This is" xpath="//flow/block[1]/block[1]/block[3]/lineArea[1]"/> <eval expected="Blah blah blah blah!" xpath="//flow/block[1]/block[1]/block[3]/lineArea[2]"/> + + <!-- check effect of nested inlines (see Bugzilla #49848) --> + <eval expected="1" xpath="count(//flow/block[1]/block[1]/block[4]/lineArea)" /> </checks> </testcase> diff --git a/test/layoutengine/standard-testcases/inline_letter-spacing_3.xml b/test/layoutengine/standard-testcases/inline_letter-spacing_3.xml index b86162ac1..39eac6d40 100644 --- a/test/layoutengine/standard-testcases/inline_letter-spacing_3.xml +++ b/test/layoutengine/standard-testcases/inline_letter-spacing_3.xml @@ -48,7 +48,7 @@ </fo:root> </fo> <checks> - <eval expected="105384" + <eval expected="117384" xpath="//flow/block[1]/lineArea[1]/inlineparent[1]/@ipd" desc="IPD of containing inline area"/> <eval expected="73368" diff --git a/test/layoutengine/standard-testcases/knuth_element-null_position.xml b/test/layoutengine/standard-testcases/knuth_element-null_position.xml new file mode 100644 index 000000000..cf964fdf5 --- /dev/null +++ b/test/layoutengine/standard-testcases/knuth_element-null_position.xml @@ -0,0 +1,44 @@ +<?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 check tests that Knuth elements with a null position do +not cause a NPE (in InlineStackingLM.applyChanges)</p> + </info> + <fo> + <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:fox="http://xmlgraphics.apache.org/fop/extensions" hyphenate="true" language="de"> + <fo:layout-master-set> + <fo:simple-page-master master-name="A4" page-height="29.7cm" page-width="21cm" margin="2cm"> + <fo:region-body/> + </fo:simple-page-master> + </fo:layout-master-set> + + <fo:page-sequence master-reference="A4"> + + <fo:flow flow-name="xsl-region-body"> + <fo:block><fo:inline padding-left="1cm"><fo:basic-link internal-destination="N1003F">Abluftanlage</fo:basic-link></fo:inline></fo:block> + <fo:block id="N1003F"/> + </fo:flow> + </fo:page-sequence> + </fo:root> + </fo> + <checks> + <eval expected="Abluftanlage" xpath="//flow/block/lineArea/inlineparent/inlineparent/text/word"/> + </checks> +</testcase> diff --git a/test/layoutengine/standard-testcases/page-number-citation-last_complex.xml b/test/layoutengine/standard-testcases/page-number-citation-last_complex.xml index 38728606c..a3f9256dc 100644 --- a/test/layoutengine/standard-testcases/page-number-citation-last_complex.xml +++ b/test/layoutengine/standard-testcases/page-number-citation-last_complex.xml @@ -28,7 +28,7 @@ </p> </info> <fo> - <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:svg="http://www.w3.org/2000/svg"> + <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:svg="http://www.w3.org/2000/svg" id="root"> <fo:layout-master-set> <fo:simple-page-master master-name="normal" page-width="5in" page-height="5in" margin="20pt"> @@ -79,6 +79,7 @@ </fo:page-sequence> <fo:page-sequence master-reference="normal"> <fo:flow flow-name="xsl-region-body" font-size="8pt"> + <fo:block>root= <fo:page-number-citation-last ref-id="root"/></fo:block> <fo:block>page-sequence= <fo:page-number-citation-last ref-id="page-sequence1"/></fo:block> <fo:block>block= <fo:page-number-citation-last ref-id="block1"/></fo:block> <fo:block>list= <fo:page-number-citation-last ref-id="list1"/></fo:block> @@ -97,18 +98,19 @@ </fo:root> </fo> <checks> - <true fail-msg="no ID for page-sequence" xpath="'page-sequence= 1' = //pageViewport[@nr=2]/page/regionViewport/regionBody/mainReference/span/flow/block[1]"/> - <true fail-msg="no ID for block" xpath="'block= 1' = //pageViewport[@nr=2]/page/regionViewport/regionBody/mainReference/span/flow/block[2]"/> - <true fail-msg="no ID for list-block" xpath="'list= 1' = //pageViewport[@nr=2]/page/regionViewport/regionBody/mainReference/span/flow/block[3]"/> - <true fail-msg="no ID for list-item" xpath="'item= 1' = //pageViewport[@nr=2]/page/regionViewport/regionBody/mainReference/span/flow/block[4]"/> - <true fail-msg="no ID for list-item-label" xpath="'item-label= 1' = //pageViewport[@nr=2]/page/regionViewport/regionBody/mainReference/span/flow/block[5]"/> - <true fail-msg="no ID for list-item-body" xpath="'item-body= 1' = //pageViewport[@nr=2]/page/regionViewport/regionBody/mainReference/span/flow/block[6]"/> - <true fail-msg="no ID for table" xpath="'table= 1' = //pageViewport[@nr=2]/page/regionViewport/regionBody/mainReference/span/flow/block[7]"/> - <!-- <true fail-msg="no ID for table-header" xpath="'table-header= 1' = //pageViewport[@nr=2]/page/regionViewport/regionBody/mainReference/span/flow/block[8]"/> - <true fail-msg="no ID for table-footer" xpath="'table-footer= 1' = //pageViewport[@nr=2]/page/regionViewport/regionBody/mainReference/span/flow/block[9]"/> - <true fail-msg="no ID for table-body" xpath="'table-body= 1' = //pageViewport[@nr=2]/page/regionViewport/regionBody/mainReference/span/flow/block[10]"/> - <true fail-msg="no ID for table-row" xpath="'table-row= 1' = //pageViewport[@nr=2]/page/regionViewport/regionBody/mainReference/span/flow/block[11]"/>--> - <true fail-msg="no ID for table-cell" xpath="'table-cell= 1' = //pageViewport[@nr=2]/page/regionViewport/regionBody/mainReference/span/flow/block[12]"/> - <true fail-msg="no ID for block-container" xpath="'block-container= 1' = //pageViewport[@nr=2]/page/regionViewport/regionBody/mainReference/span/flow/block[13]"/> + <true fail-msg="no ID for root" xpath="'root= 2' = //pageViewport[@nr=2]/page/regionViewport/regionBody/mainReference/span/flow/block[1]"/> + <true fail-msg="no ID for page-sequence" xpath="'page-sequence= 1' = //pageViewport[@nr=2]/page/regionViewport/regionBody/mainReference/span/flow/block[2]"/> + <true fail-msg="no ID for block" xpath="'block= 1' = //pageViewport[@nr=2]/page/regionViewport/regionBody/mainReference/span/flow/block[3]"/> + <true fail-msg="no ID for list-block" xpath="'list= 1' = //pageViewport[@nr=2]/page/regionViewport/regionBody/mainReference/span/flow/block[4]"/> + <true fail-msg="no ID for list-item" xpath="'item= 1' = //pageViewport[@nr=2]/page/regionViewport/regionBody/mainReference/span/flow/block[5]"/> + <true fail-msg="no ID for list-item-label" xpath="'item-label= 1' = //pageViewport[@nr=2]/page/regionViewport/regionBody/mainReference/span/flow/block[6]"/> + <true fail-msg="no ID for list-item-body" xpath="'item-body= 1' = //pageViewport[@nr=2]/page/regionViewport/regionBody/mainReference/span/flow/block[7]"/> + <true fail-msg="no ID for table" xpath="'table= 1' = //pageViewport[@nr=2]/page/regionViewport/regionBody/mainReference/span/flow/block[8]"/> + <!-- <true fail-msg="no ID for table-header" xpath="'table-header= 1' = //pageViewport[@nr=2]/page/regionViewport/regionBody/mainReference/span/flow/block[9]"/> + <true fail-msg="no ID for table-footer" xpath="'table-footer= 1' = //pageViewport[@nr=2]/page/regionViewport/regionBody/mainReference/span/flow/block[10]"/> + <true fail-msg="no ID for table-body" xpath="'table-body= 1' = //pageViewport[@nr=2]/page/regionViewport/regionBody/mainReference/span/flow/block[11]"/> + <true fail-msg="no ID for table-row" xpath="'table-row= 1' = //pageViewport[@nr=2]/page/regionViewport/regionBody/mainReference/span/flow/block[12]"/>--> + <true fail-msg="no ID for table-cell" xpath="'table-cell= 1' = //pageViewport[@nr=2]/page/regionViewport/regionBody/mainReference/span/flow/block[13]"/> + <true fail-msg="no ID for block-container" xpath="'block-container= 1' = //pageViewport[@nr=2]/page/regionViewport/regionBody/mainReference/span/flow/block[14]"/> </checks> </testcase> diff --git a/test/layoutengine/standard-testcases/region-body_column-count_span_4.xml b/test/layoutengine/standard-testcases/region-body_column-count_span_4.xml new file mode 100644 index 000000000..8bc4652ce --- /dev/null +++ b/test/layoutengine/standard-testcases/region-body_column-count_span_4.xml @@ -0,0 +1,84 @@ +<?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 multi-column documents. Check that spanned section that are broken over + to multiple pages still respect the span setting. This particular test makes sure that pages with different region-body + height are handled properly. + </p> + </info> + <fo> + <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"> + <fo:layout-master-set> + <fo:simple-page-master master-name="odd-page" page-height="3.5cm" page-width="4cm" margin="0.45cm"> + <fo:region-body margin-top="12pt * 1.2 * 2" column-count="2" background-color="yellow"/> + </fo:simple-page-master> + <fo:simple-page-master master-name="even-page" page-height="3.5cm" page-width="4cm" margin="0.45cm"> + <fo:region-body column-count="2" background-color="orange"/> + </fo:simple-page-master> + <fo:page-sequence-master master-name="master"> + <fo:repeatable-page-master-alternatives> + <fo:conditional-page-master-reference master-reference="odd-page" odd-or-even="odd" blank-or-not-blank="not-blank"/> + <fo:conditional-page-master-reference master-reference="even-page" odd-or-even="even" blank-or-not-blank="not-blank"/> + </fo:repeatable-page-master-alternatives> + </fo:page-sequence-master> + </fo:layout-master-set> + <fo:page-sequence master-reference="master"> + <fo:flow flow-name="xsl-region-body"> + <fo:block span="all"> + <fo:block>Line 1</fo:block> + <fo:block>Line 2</fo:block> + <fo:block>Line 3</fo:block> + <fo:block>Line 4</fo:block> + <fo:block>Line 5</fo:block> + <fo:block>Line 6</fo:block> + <fo:block>Line 7</fo:block> + <fo:block>Line 8</fo:block> + <fo:block>Line 9</fo:block> + <fo:block>Line 10</fo:block> + <fo:block>Line 11</fo:block> + <fo:block>Line 12</fo:block> + <fo:block>Line 13</fo:block> + <fo:block>Line 14</fo:block> + <fo:block>Line 15</fo:block> + <fo:block>Line 16</fo:block> + <fo:block>Line 17</fo:block> + <fo:block>Line 18</fo:block> + <fo:block>Line 19</fo:block> + <fo:block>Line 20</fo:block> + <fo:block>Line 21</fo:block> + <fo:block>Line 22</fo:block> + </fo:block> + </fo:flow> + </fo:page-sequence> + </fo:root> + </fo> + <checks> + <eval expected="6" xpath="count(//pageViewport)"/> + + <eval expected="3" xpath="count(//pageViewport[@nr=1]//lineArea)"/> + <eval expected="5" xpath="count(//pageViewport[@nr=2]//lineArea)"/> + <eval expected="3" xpath="count(//pageViewport[@nr=3]//lineArea)"/> + <eval expected="5" xpath="count(//pageViewport[@nr=4]//lineArea)"/> + <eval expected="3" xpath="count(//pageViewport[@nr=5]//lineArea)"/> + <eval expected="3" xpath="count(//pageViewport[@nr=6]//lineArea)"/> + + </checks> +</testcase> diff --git a/test/layoutengine/standard-testcases/word_lonely_shy.xml b/test/layoutengine/standard-testcases/word_lonely_shy.xml new file mode 100644 index 000000000..557ceea90 --- /dev/null +++ b/test/layoutengine/standard-testcases/word_lonely_shy.xml @@ -0,0 +1,98 @@ +<?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 that a word consisting of one or more Soft Hyphens is rendered as an empty word. + </p> + </info> + <fo> +<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"> + +<fo:layout-master-set> + <fo:simple-page-master page-width="297mm" page-height="210mm" master-name="a4"><fo:region-body/></fo:simple-page-master> +</fo:layout-master-set> + + <fo:page-sequence initial-page-number="auto" master-reference="a4"> + <fo:flow flow-name="xsl-region-body"> + <fo:block>Name: hy (hyphen), Unicode: U+002D (45)</fo:block> + <fo:block>-</fo:block> + <fo:block>Name: shy (soft hyphen = discretionary hyphen), Unicode: U+00AD (173)</fo:block> + <fo:block> a b c d </fo:block> + </fo:flow> +</fo:page-sequence> + +</fo:root> + </fo> + <checks> + <eval expected="" xpath="//flow/block[4]/lineArea/text/*[1]"/> + <eval expected=" " xpath="//flow/block[4]/lineArea/text/*[2]"/> + <eval expected="" xpath="//flow/block[4]/lineArea/text/*[3]"/> + <eval expected=" " xpath="//flow/block[4]/lineArea/text/*[4]"/> + <eval expected="" xpath="//flow/block[4]/lineArea/text/*[5]"/> + <eval expected=" " xpath="//flow/block[4]/lineArea/text/*[6]"/> + <eval expected="" xpath="//flow/block[4]/lineArea/text/*[7]"/> + <eval expected=" " xpath="//flow/block[4]/lineArea/text/*[8]"/> + <eval expected="" xpath="//flow/block[4]/lineArea/text/*[9]"/> + <eval expected=" " xpath="//flow/block[4]/lineArea/text/*[10]"/> + <eval expected="a" xpath="//flow/block[4]/lineArea/text/*[11]"/> + <eval expected=" " xpath="//flow/block[4]/lineArea/text/*[12]"/> + <eval expected="" xpath="//flow/block[4]/lineArea/text/*[13]"/> + <eval expected=" " xpath="//flow/block[4]/lineArea/text/*[14]"/> + <eval expected="b" xpath="//flow/block[4]/lineArea/text/*[15]"/> + <eval expected=" " xpath="//flow/block[4]/lineArea/text/*[16]"/> + <eval expected="" xpath="//flow/block[4]/lineArea/text/*[17]"/> + <eval expected=" " xpath="//flow/block[4]/lineArea/text/*[18]"/> + <eval expected="c" xpath="//flow/block[4]/lineArea/text/*[19]"/> + <eval expected=" " xpath="//flow/block[4]/lineArea/text/*[20]"/> + <eval expected="" xpath="//flow/block[4]/lineArea/text/*[21]"/> + <eval expected=" " xpath="//flow/block[4]/lineArea/text/*[22]"/> + <eval expected="d" xpath="//flow/block[4]/lineArea/text/*[23]"/> + <eval expected=" " xpath="//flow/block[4]/lineArea/text/*[24]"/> + <eval expected="" xpath="//flow/block[4]/lineArea/text/*[25]"/> +<!-- + <word offset="0"/> + <space offset="0"> </space> + <word offset="0"/> + <space offset="0"> </space> + <word offset="0"/> + <space offset="0"> </space> + <word offset="0"/> + <space offset="0"> </space> + <word offset="0"/> + <space offset="0"> </space> + <word offset="0">a</word> + <space offset="0"> </space> + <word offset="0"/> + <space offset="0"> </space> + <word offset="0">b</word> + <space offset="0"> </space> + <word offset="0"/> + <space offset="0"> </space> + <word offset="0">c</word> + <space offset="0"> </space> + <word offset="0"/> + <space offset="0"> </space> + <word offset="0">d</word> + <space offset="0"> </space> + <word offset="0"/> +--> + </checks> +</testcase> + diff --git a/test/test-no-xml-metrics.xconf b/test/test-no-xml-metrics.xconf index beb24c0ef..6005eac94 100644 --- a/test/test-no-xml-metrics.xconf +++ b/test/test-no-xml-metrics.xconf @@ -7,7 +7,7 @@ <base>./</base> <!-- Font Base URL for resolving relative font URLs --> - <font-base>./test/resources/fonts</font-base> + <font-base>./resources/fonts</font-base> <renderers> <renderer mime="application/pdf"> |