Closed Jan-E closed 7 years ago
Background: I am adding php_cairo.dll to all my PHP 5.x builds at https://www.apachelounge.com/viewtopic.php?t=6359
Example: https://phpdev.toolsforresearch.com/php-5.6.27-Win32-VC11-x86.htm https://phpdev.toolsforresearch.com/php-5.6.27-Win32-VC11-x86.zip
I guess this will fix your Appveyor builds as well: https://ci.appveyor.com/project/auroraeosrose/cairo/build/0.3.2.19/job/olg8c565yqq8aj00
looks good, but I still have a segfault on bad ttf files I have to fix yet :)
OK. Wish you good luck.
BTW: the reason I stumbled over the cairo extension was that I was looking for a way to convert SVG's on the fly to PNG. In the end I chose for a system call to inkscape. But just curious: is it possible to import an svg in the cairo extension and write it as png?
This was the (generated SVG: https://pwnfi2.spp.e-lijst.nl/images/dwars.php?y=Juridische+Zaken&z1=man&z2=vrouw&x1=tot+24+jaar&11=&12=&x2=25+-+34+jaar&21=&22=&x3=35+-+44+jaar&31=1.0&32=0.8&x4=45+-+54+jaar&41=&42=&x5=55+en+ouder&51=1.0&52=0.8421&x6=totaal&61=2.0&62=1.6421
And this is the same, generated by a system call to inkscape, the moment you load it: https://pwnfi2.spp.e-lijst.nl/images/svg2png.php?img=1&uri=https://pwnfi2.spp.e-lijst.nl/images/dwars.php&y=Juridische+Zaken&z1=man&z2=vrouw&x1=tot+24+jaar&11=&12=&x2=25+-+34+jaar&21=&22=&x3=35+-+44+jaar&31=1.0&32=0.8&x4=45+-+54+jaar&41=&42=&x5=55+en+ouder&51=1.0&52=0.8421&x6=totaal&61=2.0&62=1.6421
In the short: as far as I know there is no such possibility.
Pity. Thanks for answering.
ah, actually you can do this if we also had the librsvg extension tied in.... paging @mgdm ?? do you still have that wrapper around?
because librsvg will parse in the svg and then it can export it to a cairo context - which you can then render as a png (hello graphics library magic) - the hard part is parsing out the svg
you could also do a port of this library -> http://cairosvg.org/ from python to PHP , basically it parses the svg and turns it into a cairo context with raw cairo (ewww but it would work)
https://github.com/mgdm/php-rsvg - hah, it does exist
SO @Jan-E you can use that extension with cairo - load the svg, put it into a cairo context, export as a png :)
Although... I may have @mgdm move it to the gtkforphp org here and it needs tests and...
cool :)
If I look at the config.w32 it does not compile out-of-the-box on Windows, but I will have to compile librsvd first to test that.
we'll get it fixed if it's broken :( it's pretty old
Recent versions of libcairo requite libpng.lib to be linked