ropensci / rsvg

SVG renderer for R based on librsvg2
Other
95 stars 1 forks source link

Add EPS support #27

Closed salim-b closed 2 years ago

salim-b commented 2 years ago

Adds rsvg_eps() which converts to Encapsulated PostScript (EPS) format.

Note that I'm a complete C noob (I 🤞 the C changes are fine). The relevant code part (cairo_ps_surface_set_eps(surface, TRUE);) was found in this librsvg commit.

jeroen commented 2 years ago

Thanks. Some feedback:

salim-b commented 2 years ago

I've amended the examples.

  • TRUE and FALSE are not C primitives, they are actually R objects. It is safer to use 0 and 1 for booleans.

Since I use a cairo_bool_t object, can't I use TRUE/FALSE, same as they do in the doc of cairo_ps_surface_set_eps?

jeroen commented 2 years ago

Since I use a cairo_bool_t object, can't I use TRUE/FALSE, same as they do in the doc of cairo_ps_surface_set_eps?

Ah maybe you are right. Hopefully it doesn't conflict with the R objects TRUE / FALSE though.

jeroen commented 2 years ago

I've amended the examples.

Can you also re-roxygenize pls?

salim-b commented 2 years ago

Ah maybe you are right. Hopefully it doesn't conflict with the R objects TRUE / FALSE though.

Works fine so far at my end...