Skip to content
Advertisement

How can I get a glyph with holes(Python)?

These are frameworks that I use:

JavaScript

I have a svg file looks like the image below this sentence(The image is upside-down).

SVG file

I load this file and add to Defcon.Font like this:

JavaScript

But after I export this Font object with ufo2ft, The glyph’s hole has disappeared :(

JavaScript

After Export

I don’t know how to make holes at glyphs. I’m guessing that there is a solution at pen object and its methods, but there is no example about glyph with holes. How can I get a glyph with holes?

Advertisement

Answer

I got a solution myself :)

I tested with Adobe Illustrator. I made ‘0’-shaped object and saved in svg file. When I export a font file with the svg file, there was a hole.

So I opened the svg file at PyCharm, there’s a option name ‘xml:space’. If its option set to “preserve”, svgPath can draw a path with holes.

I hope this article help you.

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement