I am trying to create an SVG font, so I need to create some paths. One of the letters is defined by the following path:
Which I created with svgwrite, by creating two circles
and a rect
, and then using inkscape to take the difference of the two circles and the intersection with the straight line, like so:
My question is if I can do this directly with SVG or svgwrite? Either doing the boolean operations, or creating a path that behaves as the one above.
I've tried to create a black and white circle with a path like:
d="M0,128 A128,128,1,1,0 0 127.9 Z\
M 32 128 A 96 96 1 1 0 32 127.9 Z"
with fill="#000000", stroke = "none", fill-rule="evenodd"
However this ring is not recognized by the SVG font editor (it just creates a black disc).
I also tried to create the combination of paths (outer circle, inner circle, horizontal line)
d="M0,128 A128,128,1,1,0 0 127.9 Z\
M 32 128 A 96 96 1 1 0 32 127.9 Z \
M 38 128 l 0 15 l 180 0 l 0 -30 l -180 0 z"
but although I can see the right-looking result when I open the SVG, the font editor will not recognize the path created which looks like this:
Is there some way to generate programmatically the path of the first picture above?
following @martineau's suggestion and this SO question, I came to this solution:
then use
fill-rule: evenodd
to combine all of them.which returns something like this: . Unfortunately, the Inkscape SVG font editor only renders this:
So I'll have to continue investigating where the problem may come from. Further suggestions are welcome.