Skip to content

Explicitly set fill-rule:non-zero for text by default.

Problem Summary:

Affinity designer exports all SVGs with a document-level <svg style="fill-rule:evenodd;">. Due to this, the overlapping areas become blank.
This behaviour becomes problematic for Arabic text.

exported svg source screenshot.png

Problem Details (steps and workarounds):

Steps to reproduce:

  1. Open attached file in Inkscape.
    This is a minimal empty artwork exported from Affinity Designer.
    EmptyAffinityDesignerExport.svg
  2. Create a new text element.
  3. Write Arabic text. Sample: (i dont know what it says, copied from web)
    وحة المفاتيح العربية
  4. Notice that overlapping letters show inversions at overlap instead of solid fill.

Screenshot: image

Workaround:

style :

  • is overridable on text elements
  • can be manually fixed in the exported file

Idea:

The new text elements could default to style="fill-rule:nonzero;" since that is what's expected in most usages of text.

Comments:

I will admit I'm not deeply familiar with Inkscape, and applying default styles to elements might be an anathema, but if it's possibly an acceptable practice, I wanted to raise the idea that it might be useful to apply to text.
Ref: coming via realdoctormo on twitter


Author's original description

Summary:

I was working in an SVG file exported from Affinity Designer and having problems with Arabic text. Specifically, the points where the letterforms overlapped (which is the norm in Arabic) were inverting themselves. Being on a deadline I didn't have time to track down what was going wrong, cursed the skies, and paid for a month of Illustrator to get a job done.

image (same as in the steps above)

Eventually, I was able to figure out that Affinity Designer exports all its SVGs with a document-level style that includes "fill-rule:evenodd" for some reason. This is easily overridable on the text elements (or manually fixed in the exported file), but it occurred to me that perhaps new text elements could default to a style with "fill-rule:nonzero" since that is what's expected in 99.999...% of usages for text.

I will admit I'm not deeply familiar with Inkscape, and applying default styles to elements might be an anathema, but if it's possibly an acceptable practice, I wanted to raise the idea that it might be useful to apply to text.

I wasn't going to mention it at all, but one of the Inkscape programmers reached out on Twitter and said it was worth filing for someone to take a look at, so here we are.

Edited by Teen
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information