Hi, Jeremias,

> Jay, if you'd like to help systematic testing here that would
> be fantastic. Please note that quite a few test cases already
> exist in test/layoutengine/standard-testcases (everything that
> starts with "external-graphic" and "instream-foreign-object").
> Please note that the size calculations for both formatting
> objects use the same code (AbstractGraphicsLayoutManager) which
> means that fixing one, fixes the other, too. Having more test
> cases like the existing ones would be great and is the first
> important step towards fixing all remaining problems.

Well, I wrote some XSLT code that produced 124 test files. Here's a 
typical file:

<?xml version="1.0" encoding="UTF-8"?>
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format";>
  <fo:layout-master-set>
    <fo:simple-page-master master-name="only"
      margin-top="1in" margin-left="1in"
      margin-right="1in" margin-bottom="1in">
      <fo:region-body region-name="only"/>
    </fo:simple-page-master>
  </fo:layout-master-set>
  <fo:page-sequence master-reference="only">
    <fo:flow flow-name="only">
      <fo:block>
        <fo:external-graphic
          src="tooWideGraphic.jpg"
          content-height="auto"
          content-width="468px"
          height="auto" width="auto"/>
      </fo:block>
    </fo:flow>
  </fo:page-sequence>
</fo:root>

Here's the XML file I used to define the testing:

<?xml version="1.0" encoding="UTF-8"?>
<test-values>
  <test name="content-width">
    <value>auto</value>
    <value>scale-to-fit</value>
    <value>16.51cm</value>
    <value>165.1mm</value>
    <value>6.5in</value>
    <value>468pt</value>
    <value>39pc</value>
    <value>468px</value>
    <value>100%</value>
  </test>
  <test name="content-height">
    <value>auto</value>
    <value>scale-to-fit</value>
    <value>16.51cm</value>
    <value>165.1mm</value>
    <value>6.5in</value>
    <value>468pt</value>
    <value>39pc</value>
    <value>468px</value>
    <value>100%</value>
  </test>
  <test name="height">
    <value>auto</value>
    <value>16.51cm</value>
    <value>165.1mm</value>
    <value>6.5in</value>
    <value>468pt</value>
    <value>39pc</value>
    <value>468px</value>
    <value>100%</value>
  </test>
  <test name="width">
    <value>auto</value>
    <value>16.51cm</value>
    <value>165.1mm</value>
    <value>6.5in</value>
    <value>468pt</value>
    <value>39pc</value>
    <value>468px</value>
    <value>100%</value>
  </test>
  <test name="image-type">
    <value>gif</value>
    <value>jpg</value>
  </test>
  <test name="image-name">
    <value>tooNarrowGraphic</value>
    <value>tooWideGraphic</value>
  </test>
</test-values>

(tooNarrowGraphic and tooWideGraphic are just simple images that are, 
respectively, narrower or wider than the content area.)

I wound up with 124 files rather than 20736 files because I blocked any 
test that had more than one value that wasn't "auto". I could generate the 
other files, but 124 is about my limit for visually checking PDF files to 
see if I got the proper output.

The good news is that I got the output I expected in all cases (though I 
had to check the spec pretty carefully to be sure of that in some cases).

I figure I'll skip checking them all into your testing system, as it would 
be massive overkill, but I thought you might want to know the results of 
my testing. If you do want them (or some subset of them), let me know.

Also, if you'd like me to programatically generate test files for other 
elements or properties, let me know. It's not hard to do.

> Concerning your suggestion of a "scale-down-to-fit" I'd say that
> this is not necessary provided I've understood your requirement.

I can certainly get by without it, but it seems like a nice convenience 
feature. It's in the 1.1 spec, so maybe I'll get to use it someday.

Jay Bryant
Bryant Communication Services
(presently consulting at Synergistic Solution Technologies)

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to