Currently we test such issues indirectly by exporting to PDF and then checking the PDF file, but this is slow, indirect, not very reliable, and can’t test everything. One idea is to write an VCL graphics backend that just dumps the drawing commands to some sort of plain text format that can be compared against known good results.
I'm sure you will know best, but I would just (a) decide what piece of info I need (b) plumb some methods down through the layers that dump the info into something convenient, either an in-memory XML file (e.g. see the dumpAsXml helpers we use elsewhere for unit test) and whatever else takes your fancy. (c) use xpath to check the XML (like we do elsewhere) (d) keep adding info to the XML for more unit tests
So, lets say I want to dump all the glyphs being drawn with their positions, so I’d have a SalLayout::dumpAsXml()? Not sure how can I wire this one all the way from the output device, but I can give it a try. I probably will need to set some kind of a flag on the output device before creating it so that it dumps every SalLayout it draws, since these are not kept around.
Looking at sw layout tests, looks like GDIMetaFile is the thing I want (I probably saw it before then forgot about it), now I need to see if it has all the information I need.
I tried using GDIMetaFile, but it is still higher level than what I need. Back to the drawing board.