Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I get glyph outlines of a letter as bézier paths using JavaScript?

Tags:

People also ask

How do I get glyphs from fonts?

Choose Type > Glyphs to display the Glyphs panel. To display a different set of characters in the Glyphs panel, do any of the following: Select a different font and type style, if available. From the Show menu, choose Entire Font.

How do I add a glyph font?

Select any glyph, or multiple glyphs (click and drag, or Shift- or Cmd-click multiple glyphs), or even all of them (Cmd-A). Then click the Generate button or press the Return key to add them to the font.


I want to retrieve the outline information of font glyphs as bézier paths in HTML5. This would allow me to randomize the outlines:

Random changed glyph outlines

In Cocoa, I would use appendBezierPathWithGlyph:inFont:. In Java, I would use TextLayout.getOutline(). How does this work in JavaScript?

I discovered that Mozilla has mozPathText but I can't get it to work.