Message Boards Message Boards

Glyph geometry: visualizing letters as graphics objects

Posted 4 years ago

POSTED BY: Mark Greenberg
7 Replies
Posted 4 years ago

Unfortunately, when I updated to Mathematica 12.2, the trick of exporting in PDF format no longer produced graphics objects. If you want to play with this method, it will have to be in v < 12.2. : (

POSTED BY: Mark Greenberg
Posted 3 years ago

Hi Mark,

It works in Mathematica 12.3.1 if you specify "PageGraphics" as the second argument of ImportString:

InputForm@ImportString[ExportString[l, "PDF"], "PageGraphics"]
POSTED BY: Alexey Popkov
Posted 3 years ago

Here is a ready-made solution from version 1.0.2 of ResourceObject["SVGImport"]["DefinitionNotebook"] by Richard Hennigan (Wolfram Research):

ImportString[ExportString[l, "PDF"], 
       If[$VersionNumber >= 12.2, {"PDF", "PageGraphics"}, {"PDF", "Pages"}]]

screenshot

POSTED BY: Alexey Popkov

What a cool post, Mark! I'd like to point out something that might come handy. In the docs on BoundaryDiscretizeGraphics you can find an example in Applications section about another way of getting a glyph geometry, for example:

BoundaryDiscretizeGraphics[
    Text[Style["ظ",Bold]],
_Text,MaxCellMeasure->0.01]

enter image description here

Then you can use unctions like MeshPrimitives, MeshCells, MeshCoordinates, etc. to extract underlying geometric elements.

POSTED BY: Vitaliy Kaurov

enter image description here -- you have earned Featured Contributor Badge enter image description here Your exceptional post has been selected for our editorial column Staff Picks http://wolfr.am/StaffPicks and Your Profile is now distinguished by a Featured Contributor Badge and is displayed on the Featured Contributor Board. Thank you!

POSTED BY: EDITORIAL BOARD

Thank you so much Mark for sharing this. Clear illustrations and easy to read code. It is a treat to see the Arabic letter "ظ" in your opening image. This letter's pronunciation is close to the letter "Z" in English.

POSTED BY: Ahmed Elbanna

Very nice. I hope to see this in the Wolfram Function Repository.

POSTED BY: Daniel Lichtblau
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract