pris icon indicating copy to clipboard operation
pris copied to clipboard

Add element as text backend

Open ruuda opened this issue 7 years ago • 0 comments

Pris internally produces frames that contain elements. Elements are then rendered to pdf by the driver. There should be an additional driver that outputs a serialized representation of every element. It could be json, for example, but any text-based format would be fine.

Such an output format would be useful for creating golden tests. If an internal change should not affect the output, then the pdf, as well as the serialized elements should remain unchanged. But if there is a change after all, it is hard to tell from the pdf file what that change is exactly. Diffing the serialized format should be much easier. Furthermore, the exact output pdf depends on the Cairo version used, which makes it not portable across systems. In particular, I cannot create golden pdfs on my machine and expect them to match on CI. But a serialized output format would be portable, and suitable for use in golden tests.

ruuda avatar Aug 12 '18 11:08 ruuda