Wednesday, August 31, 2011

ACID test for Absolute Positioned Frames.

Based on the ACID test for Absolute Positioned Tables I created another test for Absolute Positioned Frames (APFs). Make sure you have the Ahem font installed. The test document renders as follows:

Again, here is what e.g. LibreOffice.org makes out of it:


Not to mention again that APFs are important for business documents since they are used in letter heads etc.

Monday, August 29, 2011

An ACID test for Absolute Positioned Tables

Inspired by the first ACID test ACID1 also called Box Acid Test I created a simple document to test the handling of Absolute Positioned Tables (APTs). APTs are used a lot in letter heads of e.g. business documents.
The test is very simple. It uses the Ahem font from the CSS test suite. Make sure you have the font installed on your machine in order to run the test.
When successful this document is rendered as follows:

Here is what e.g. LibreOffice (3.4.2) makes out of it:

I really like these kind of tests because they are very visual and it is quite easy to understand whether the test worked or not.

Thursday, August 11, 2011

Advances in the layout engine

I started implementing "Shape" support in my layout engine. What's so special about Shapes is the fact that the text needs to flow around them when wrapping is enabled. Shapes are used a lot e.g. to construct letterheads etc. Good Shape support is absolutely crucial for business documents.
Here is my sample document I used for testing wrap03.docx:

It shows Shape objects with "tight" wrapping and the different wrapping modes as defined in 20.4.3.7 ST_WrapText (Text Wrapping Location) of the OOXML specification:

  • both (Both Sides) Specifies that text shall wrap around both sides of the object.

  • left (Left Side Only) Specifies that text shall only wrap around the left side of the object.

  • right (Right Side Only) Specifies that text shall only wrap around the right side of the object.


I'm really happy to have this key feature in the layout engine. Just to show how difficult this is to implement take a look at what Google Docs makes out of it: wrap03.docx.