Bug introduced in 11.3, fixed in 12.3 (and possibly as early as 12.1)

I was revisiting an earlier problem of mine related to designing 3D objects with extruded text for 3D printing. The accepted answer no longer works in V11.3 if a certain subset of letters are used. For example, while this works as expected:

 BoundaryDiscretizeGraphics[Text[#], _Text] & /@ CharacterRange["A", "C"]

a slight modification results in failure to discretize the graphics.

BoundaryDiscretizeGraphics[Text[# <> #], _Text] & /@ CharacterRange["A", "C"]

enter image description here

Working through various pairs of letters, it appears as if BoundaryDiscretizeGraphics fails if neither of the letters contains an annulus (correct math term?). So "AA" and "AC" will both work, but with "CE" and "CD", only the latter text will be rendered properly.

enter image description here

Of the single letter options, only lower case "i" and lower case "j" fail, which somehow makes sense because in these two cases, there exists two regions, neither of which have an annulus.

All of these problems are not present in the 11.2 version on the Raspberry Pi.

enter image description here

While this is primarily a public service announcement, I am looking for suggestions for workarounds to creating letter-shaped regions. My application requires that it work on both traditional desktop platforms as well as the Raspberry Pi, so timing does become a concern.

  • $\begingroup$ I observe the same with version 11.3 on Windows 7 x64. Tagging as a bug. $\endgroup$ May 30, 2018 at 9:13
  • 2
    $\begingroup$ With version 12.3.1 I do not reproduce the bug. $\endgroup$ Jul 15, 2021 at 7:02
  • 1
    $\begingroup$ @AlexeyPopkov Thanks for checking, I'm still on 12.1 with my home computer and I don't see the problem there either. $\endgroup$ Jul 15, 2021 at 12:02

1 Answer 1


I think it is worth reporting this issue to support.

To see what might be going on, try DiscretizeGraphics instead:

DiscretizeGraphics[Text["CC"], _Text]

enter image description here

You'll notice that the output appears to be a non-simple polygon, and I think this is why BoundaryDiscretizeGraphics fails to produce a region. To workaround this issue, you can insert a small space between the letters:

BoundaryDiscretizeGraphics[Text["C\[VeryThinSpace]C"], _Text]

enter image description here


The OP in a comment mentioned that my workaround doesn't help for letters that have disconnected pieces, e.g., "i".

Another possibility for creating a region from letters is to use an ImportString/ExportString round trip to the "PDF" format, which creates a Graphics object, and then discretize the resulting Graphics object. For example:

g = First @ ImportString @ ExportString[Style["Ci", 100], "PDF"]

enter image description here

The output is a Graphics object:

g //Head


Use BoundaryDiscretizeRegion on this graphics object:

BoundaryDiscretizeGraphics[g, MaxCellMeasure->Infinity]

enter image description here

  • $\begingroup$ I had picked up on the same issue with DiscretizeGraphics; your workaround is very nice. $\endgroup$ May 27, 2018 at 18:20
  • $\begingroup$ The \[VeryThinSpace] solution does not work with lower case i and j since spaces cannot be added below the dots (obviously). $\endgroup$ May 30, 2018 at 11:48
  • $\begingroup$ @bobthechemist I've updated my answer with another method that hopefully proves useful. $\endgroup$
    – Carl Woll
    May 30, 2018 at 23:11
  • $\begingroup$ PDF's are now imported by default as Images instead of Graphics. Therefore, this change is needed: ImportString[ExportString[Style["Ci", 100], "PDF"], {"PDF", "PageGraphics"}] $\endgroup$ Oct 3, 2022 at 20:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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