On Mon, Jul 29, 2024 at 12:20 PM Luca Fascione <l.fasci...@gmail.com> wrote: > > > > On Mon, Jul 29, 2024 at 11:09 AM Werner LEMBERG <w...@gnu.org> wrote: >> >> This means that it would be sufficient to make the Cairo backend also >> create logging output. In case I'm not missing something this >> shouldn't be too hard to add. > > Can this be done? > If one were to log all the calls and arguments to Cairo functions and then > write a corresponding program to replay them later, would they get the > same PDF as from a direct binding?
Possibly, but it's complicated: * some Cairo calls take FT_Face instances as argument, for example. If you log and replay the Cairo calls, how can you be sure you're passing in the right Freetype font into the replay? * Also, the current "production" backend is the PS + Ghostscript route, which wouldn't be tested by a Cairo log/replay. * Even if Cairo were the production code, then the log/replay is extra code that is not used normally. How would you be sure it is free of bugs? -- Han-Wen Nienhuys - hanw...@gmail.com - http://www.xs4all.nl/~hanwen