14
$\begingroup$

Possible Duplicate:
Undocumented form for FilledCurve[]

A nice trick to get the outline paths of letters is to use the PDF exporter/importer

el= 
First[
  First[
    ImportString[
      ExportString[
        Style["L", Italic, FontSize -> 24, FontFamily -> "Arial"], 
        "PDF"
      ], 
      "PDF", 
      "TextMode" -> "Outlines"
     ]
   ]
];

Graphics[{EdgeForm[Black], LightBlue, el}];

Mathematica graphics

The outline paths are given in a FilledCurve construction (new in MMA8):

el

(*
===>
{Thickness[0.07507507507507508], 
 Style[
   {FilledCurve[{{{0, 2, 0}, {0, 1, 0}, {0, 1, 0}, {0, 1, 0}, {0, 1, 0}}}, 
                {{{12.887695983062486, 5.160000000000004}, 
                  {1.8237311169604027, 5.160000000000004}, 
                  {5.496094644083314, 22.410000000000004}, 
                  {7.823731116960403, 22.410000000000004}, 
                  {4.5834973678187225, 7.222500000000004}, 
                  {13.319824330510414, 7.222500000000004}
                }}
    ]
   }, 
   Thickness -> 0.07507507507507508
  ]}
 *)

This syntax variant is not given in the FilledCurve help page:`

Mathematica graphics
with segments defined as:

Mathematica graphics

(The doc page doesn't give a formal definition of components, BTW)

While the second argument of FilledCurve in the undocumented output above is pretty obvious (the coordinates of the outline), the first part is not. My hypothesis is that it has something to do with bezier control points or so. Anyone got an idea about this?

$\endgroup$
2
  • $\begingroup$ Sjoerd, I would like to merge this Q&A into (702) to put the answers in one place. Is that OK with you? $\endgroup$
    – Mr.Wizard
    Feb 2 '15 at 8:25
  • $\begingroup$ Merged, with your permission. $\endgroup$
    – Mr.Wizard
    Feb 2 '15 at 11:49