1
$\begingroup$

Here some code for creating wrapped text

Clear["Global`*"];

text[txt_, p1_, p2_, p3_, p4_] := 
With[{l = text[txt]}, {{l /. {x_Real, 
   y_Real} :> (p1 + y)/p2 {Sin[1/p3 x + p4], Cos[1/p3 x + p4]}}}] 
text[txt_String] := 
   text[txt] = 
   Cases[First[
   First[ImportString[
  ExportString[
   Style[txt, FontFamily -> "Calibri", FontSize -> 9.5], "PDF"], 
  "TextMode" -> "Outlines"]]], 
   FilledCurve[a__] :> {EdgeForm[Black], Black, FilledCurve[a]}, 
   Infinity]

which works fine with English letters

 g1 = Graphics[text["HAPPY BIRTHDAY JOHN", 33, 30, 15, -1]]

enter image description here

However if we use Greek letters

g2 = Graphics[text["ΧΡΟΝΙΑ ΠΟΛΛΑ ΓΙΑΝΝΗ", 33, 30, 15, -1]]

enter image description here

these are not printed in the correct format. Why? is there a way to print them correctly?

I use Mathematica v9.0.

many thanks in advance!

$\endgroup$
  • 1
    $\begingroup$ Works fine in 11.2 macOS 10.13 $\endgroup$ – M.R. Nov 19 '17 at 19:07
  • $\begingroup$ It also works fine on 9.0 in Windows. $\endgroup$ – wxffles Nov 19 '17 at 19:20
  • $\begingroup$ @M.R. You are right! I also tested it in another computer with Win7 and v11.0 and the Greek letters are printed fine. $\endgroup$ – Vaggelis_Z Nov 19 '17 at 19:21
  • $\begingroup$ Try the discretize region approach. The PDF export probably messed things up. $\endgroup$ – b3m2a1 Nov 19 '17 at 19:26
  • $\begingroup$ @b3m2a1 What exact;y do you mean? Could you please post a simple answer? $\endgroup$ – Vaggelis_Z Nov 19 '17 at 19:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.