SVG text looks weird

The text on my panels comes out weird looking, after I do “Objects to Paths” in Inkscape. In Inkscape it looks OK, though. Anyone any idea how to fix this?

screenshot2

When this has happened to me, I use the Node editor in Inkscape to remove the extra path segments, which is tedious but not too difficult. Often it can be as simple as selecting the broken letter, and doing Path:Union (you might have to do Path:Break apart to separate the letters and subpaths first). You might be able to manipulate some of the path attributes like “winding” to fix it, but since nanovg is a limited implementation I haven’t bothered. I don’t remember if I tried that, but on principle I try to keep the SVG as minimal as possible.

Only some fonts will run into this issue, so you might try using a different font.

This problem is one of the reasons I made label widgets that use a font I include in the package. I found this easier when iterating a panel, because I can place labels in relation to controls mathematically (and consistently).

1 Like

Ah, just changing the font worked. Thanks for the tip!

2 Likes

It’s an issue with overlapping paths rendering as “holes”–selecting all the nodes in the offending text and hitting Path > Union ought to clear that up.

Is that a bug in Inkscape? Sort of sounds like it is.

I’d also say that it’s a bug in Inkscape. It may be a simple-minded rendering of the paths in the font definition (i.e. “As Designed”), and they may say it’s a defect in the font. Some fonts take care to not have any overlapping paths, even if the construction of the letter form would be easier with the overlaps.

oh, I know all about “bad fonts”! But, yeah, if it renders as a font correctly, but convert to path looks wrong… Then at the very least the font renderer is “more robust” than that “to path” algorithm. Which I realize is exactly what you are already saying :wink:

2 Likes