Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Consider this code:

fc = ImportString[ExportString[Style["Ma"], "PDF"], "PDF"][[1, 1, 2, 1, 1]];
lines = GeometricFunctions`DecodeFilledCurve[fc][[1]];
{lines // Length,Graphics[JoinedCurve[#]] & /@ lines}

will give what is expected:

enter image description here

but this code:

fc = ImportString[ExportString[Style["Ma", FontFamily -> "Times"], "PDF"], "PDF"][[1, 1, 2, 1, 1]];
lines = GeometricFunctions`DecodeFilledCurve[fc][[1]];
{lines // Length, Graphics[JoinedCurve[#]] & /@ lines}

gives four things, with the fourth element is just a point:

enter image description here


Why there is an extra point in the second case? I'm using version 9 on Mac.


screenshots of the problem on version 8 and 9 on mac, and version 8 on windows 7, the results seems different:

enter image description here

enter image description here enter image description here

share|improve this question
I don't get the extra point. – b.gatessucks May 10 '13 at 21:45
I don't get it either (Win7, v9.01) – Sjoerd C. de Vries May 10 '13 at 23:17
BTW The first picture is not created by the first block of code. – Sjoerd C. de Vries May 10 '13 at 23:42
@SjoerdC.deVries sorry, I corrected it. – xslittlegrass May 11 '13 at 3:54
Ok, so it is OS dependent then. Unfortunately, I can't help with that as I don't have OSX. I assume that it is caused by its PDF exporter. There is a remote possibility that it may be a problem of the font itself. – Sjoerd C. de Vries May 11 '13 at 6:29
up vote 3 down vote accepted

I've encountered this problem, coming from a slightly different direction. I think the compound paths contain an extra pair of coordinates that you're noticing when you split up the results of a FilledCurve.

Here's how I first came across this:

glyph[code_, font_, size_] := 
      Style[FromCharacterCode[code], FontSize -> size, 
       FontFamily -> font], "PDF"], "TextMode" -> "Outlines"]]]; 

a = glyph[97, "Times", 24] 
      {{1,4,3},{1,3,3},{0,1,0},{1,3,3},{1,3,3},{1,3,3}, ...
      {{3.74836,5.265},{4.01063,5.265},{4.25426,5.35078}, ...
      {{0.405,5.96742},{0.405,6.74086},{0.77502,7.35469}, ...

The {{4.1175,12.4875},{4.1175,12.4875}} is a short zero-length line that I think might be causing the problems.

I noticed it when I selected the graphic. I could see that there was something odd there:

Graphics[{Gray, a}] 

the letter a selected

The short line registers oddly as a large dot.

Looking at all the letter forms, it appears that you definitely get this extra line for many letters, not just for "compound paths".

Length[#[[2, 1, 1, 2]]] & /@ (glyph[#, "Helvetica", 24] & /@ 
   ToCharacterCode /@ Characters["abcdefghijklmnopqrstuvwxyz"]);
BarChart[%, ChartLabels -> Characters["abcdefghijklmnopqrstuvwxyz"]]


There's "a", "e", and "o" which have three elements in the relevant FilledCurve. "b" has two, like it should have, but "c" should only have one. "n", "s", and "u" also have more elements than they need. And so on.

You could probably fix this by adding a rule that makes zero-length lines get deleted from the FilledCurve, but that's proved beyond my expertise...

tl;dr I think it's a bug, but who knows whether in Mathematica or the Mac OS system.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.