Closed JanBliznicenko closed 1 year ago
Thank you I will review it
I have tried on macOs(ventura) and I did not found an error. I will try it on windows
You are right, it is Windows-only problem. It seems to work on Debian as well.
Hello I have test it on windows, I yes I got the error, at this moment for png or pdf export Roassal uses AthensCairoPDFSurface for pdf and method writeToPng:
probably the error is present on windows because of the encoding of the name
The resulting string seems to be equal to when you try to decode UTF-8 encoded string with Windows-1250 decoder (so UTF-8 string is being put somewhere where it expects Windows-1250)
According to this: https://bugs.freedesktop.org/show_bug.cgi?id=103536 it seems cairo lib used to expect native encoding for each platform in version 1.14 (and older), but since 1.15.10, it works with UTF-8 on all platforms, incl. Windows: https://cairographics.org/releases/ChangeLog.cairo-1.15.10 (search for "UTF"). Pharo VM for Windows, unfortunately, is shipped with 1.14.12.
Thank you for this information, Yes I have tried utf8 on windows but the result is the same.
RSPNGExporter >> #exportToFile: file
| morph |
morph := self morph.
self cameraSetter set: [
| surface |
surface := AthensCairoSurface extent: morph extent asIntegerPoint.
surface drawDuring: [ :can | morph fullDrawOnAthensCanvas: can ].
surface writeToPng: file pathString utf8Encoded.
surface flush.
"The following may fail when the VM is run in the headless mode"
[ surface finish ] on: Error do: [ :ex | "Do nothing" ].
]
Maybe this is an issue then for pharo to update the current version of cairo, also @tinchodias, told me that new cairo supports new features.
We have talk with Pablo Tesone and next week we will update cairo version in pharo11
The new VM will probably come with Cairo 1.17.4
@JanBliznicenko I check it on windows and it is fixed, you can download the new vm and that will include the new version of cairo
Thank you, @akevalion Is it the VM marked as stable (that is downloaded by Pharo Launcher) or does it need to be latest?
In my case remove my last vm and the PharoLauncher downloaded the new vm.
Indeed, it works now. And not just in Pharo 11, but also 10 and 9, awesome!
PNG and PDF exporters do not handle non-ASCII filenames very well. A user of OpenPonk reported that in his case the export did not happen at all and in my case (Windows 10) the resulting file name is complete garbage. Probably some encoding issue along the way of ffi calls.
SVG export works well.
The issue is in Roassal2 as well, that's why I know it (OpenPonk uses Roassal2).
How to reproduce: