From a92f098588f125b62772ec4b6e126105ded204d8 Mon Sep 17 00:00:00 2001 From: Sergei Eremenko Date: Sun, 20 Aug 2023 17:49:38 +0300 Subject: [PATCH] ffsvg.sh: handle 0 and 0.00n+ numbers in x|y|rx|ry --- tools/_clean_attrs.sed | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tools/_clean_attrs.sed b/tools/_clean_attrs.sed index 2e8992e024..10812ae555 100644 --- a/tools/_clean_attrs.sed +++ b/tools/_clean_attrs.sed @@ -148,6 +148,10 @@ s/[ ]white-space="normal"//gI s/[ ]word-spacing="normal"//gI s/[ ]writing-mode="lr-tb"//gI +# round decimal expansion to zero in x=, y=, rx=, ry= attributes +s/([ ]x|y|ry|rx)="[0-9.]+e-[0-9]+"/\1="0"/gI +s/([ ]x|y|ry|rx)="[0-9]?.00[0-9]+"/\1="0"/gI + # delete attributes with nonsense values s/[ ]fill-opacity="[1-9][0-9.]*"//gI s/[ ]fill="(#000|#000000|black)"//gI @@ -156,6 +160,11 @@ s/[ ]flood-opacity="[1-9][0-9.]*"//gI s/[ ]opacity="[1-9][0-9.]*"//gI s/[ ]stroke-opacity="[1-9][0-9.]*"//gI +# delete nonsense values for rounded corners of rectangles +/