Hello,
3 months ago I saved a notebook which was fine - but I am not sure which version was available at this point. However, actually I am using 11.2.0.0.
The code is
WrapText[str_, transformation_] :=
Rasterize[
Module[{text},
text = Style[str, Bold, FontFamily -> "Helvetica", FontSize -> 12,
LineBreakWithin -> False];
Graphics@
Cases[ImportString[ExportString[text, "PDF"],
"TextMode" -> "Outlines"][[1, 1]],
FilledCurve[a__] :> FilledCurve[a], Infinity] /.
transformation], ImageSize -> {300, 300}]
Export[NotebookDirectory[] <> "Test.jpg",
transformationSpiral = {x_Real,
y_Real} :> {Cos[-x/(12 Pi)]*(y + 4 + x/18),
Sin[-x/(12 Pi)]*(y + 4 + x/18)};
WrapText[
"All human beings are born free and equal in dignity and rights. \
They are endowed with reason and conscience and should act towards \
one another in a spirit of brotherhood.", transformationSpiral]]
On an old os-backup with MMA 11.0.1 it works fine - except that it looks a bit different and the message “file was created with a newer version”…any ideas whats going on here?
Was there any version between 11.0.1 and 11.2 on the Raspberry? I am almost sure I saved it with actual 11.2 - but why does the output look so ‘corrupted’ now? And how could I fix it?
The problem seems to be somewhere in my OS I think (but where/why?). I did an apt-get update+upgrade on my os-backup - and this sd-card with MMA 11.2 now renders it as it should. Strange…but, however, it works fine now…as I saved it.
Interesting code. Why do you write the replacement rule
FilledCurve[a__] :> FilledCurve[a]
that weren’t my ideas, I just found it in the mentioned link in my first post (on Stackexchange) and modified it slightly. For questions you have to ask the person who posted it there.
I meanwhile found the probably original source of this code: It is contained in the documentation on FilledCurve (the last one of the “Neat Examples”). But the question remains: How could one find the useful option "TextMode" -> "Outlines" of the function ImportString other than by chance and what are possibly other options? To me it seems that ImportString is poorly documented.