From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-0.5 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NO_RECEIVED,NO_RELAYS, T_SCC_BODY_TEXT_LINE,URIBL_SBL_A autolearn=ham autolearn_force=no version=3.4.4 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/118039 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Max Chernoff Newsgroups: gmane.comp.tex.context Subject: SVG converter bugs Date: Thu, 06 Jul 2023 04:06:41 -0600 Message-ID: <6e9aecebc28843c4976545295c45167dd451b57a.camel@telus.net> Reply-To: mailing list for ConTeXt users Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1873"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Evolution 3.48.4 (3.48.4-1.fc38) To: ntg-context Archived-At: Original-X-From: ntg-context-bounces+gctc-ntg-context-518=m.gmane-mx.org@ntg.nl Thu Jul 06 12:09:29 2023 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane-mx.org Original-Received: from cgl.ntg.nl ([5.39.185.202]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qHLvU-0000H2-OL for gctc-ntg-context-518@m.gmane-mx.org; Thu, 06 Jul 2023 12:09:28 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by cgl.ntg.nl (Postfix) with ESMTP id 94E0A482441 for ; Thu, 6 Jul 2023 12:07:04 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at cgl.ntg.nl Original-Received: from cgl.ntg.nl ([127.0.0.1]) by localhost (cgl.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id gk6imLDCRCV4 for ; Thu, 6 Jul 2023 12:07:04 +0200 (CEST) Original-Received: from cgl.ntg.nl (localhost [127.0.0.1]) by cgl.ntg.nl (Postfix) with ESMTP id 56A654823FE for ; Thu, 6 Jul 2023 12:07:02 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by cgl.ntg.nl (Postfix) with ESMTP id A3D7548214E for ; Thu, 6 Jul 2023 12:06:45 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at cgl.ntg.nl Original-Received: from cgl.ntg.nl ([127.0.0.1]) by localhost (cgl.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id s4GEMkp7mSSp for ; Thu, 6 Jul 2023 12:06:45 +0200 (CEST) Original-Received: from mail-pg1-f169.google.com (mail-pg1-f169.google.com [209.85.215.169]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by cgl.ntg.nl (Postfix) with ESMTPS id 74EE848122E for ; Thu, 6 Jul 2023 12:06:45 +0200 (CEST) Original-Received: by mail-pg1-f169.google.com with SMTP id 41be03b00d2f7-557790487feso425498a12.0 for ; Thu, 06 Jul 2023 03:06:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telus.net; s=google; t=1688638003; x=1691230003; h=mime-version:user-agent:content-transfer-encoding:date:to:from :subject:message-id:from:to:cc:subject:date:message-id:reply-to; bh=FrB+rsybzbkgOlrOhdfn7hGveIUqiMaziQswshNN1bM=; b=Nam14f+rHlGy6TfjUrnH4I0jhsWLI3cGHqYjqw6PZJ7y1Ik0q734w+RTurJFaj/Fam g3X4flNnW0VHppYTnZf68x116lomoW7V5XnqJ98ADaME/dEkNTz6SU0PIJtiTTp7oXCl QHeMznJmqWVnZUYyLkVHEjmdy5AKV9ZjCX9v6QWrMT/tdxa6QgPaUdU2h8OoQvW3JTOV qyYA+kmyevm3pk/EzCBlFbU4sovDB+PkcbF+DLh79uY2jm0izT/k5nls4ZpIso5rg9UO 7S5oYgS3Td1tA5f2tV4wvClGn79s4tgXN7Jqi/fOdmJ99DVLpmCrCYBqDkU0Ni7Alg4n 3SRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688638003; x=1691230003; h=mime-version:user-agent:content-transfer-encoding:date:to:from :subject:message-id:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=FrB+rsybzbkgOlrOhdfn7hGveIUqiMaziQswshNN1bM=; b=HWdi3Qa3T95sq+XhcES5L6SIqnw6oRFttIJpCU8nOrqRt2L4DTZP/xQb8H9/p7Actz eECio+38qfU2bRnsnqSh1LjRB9vXk481AKluLLQWhRFUyN2v4V21K0Ujoi7tQnM+HTqT OPIIsyZsHGjrup446GYgqV/r+B+4rr8v/2CvuD5FWmcIoMQpZJDflp5b3Vtc8eRuLkol z+XvDW9bXU3KpG0xf/FYwTmya4OctgNk34SE+NjBzgtKaq33E5hoo9kTFSEnAq4C45+v 1Wlv5dEuELsigoju40a1kLs+uurSwi4VWnGLNy0fBS9ShoRpifih9aDxrRTGPrEhnNSy xhQQ== X-Gm-Message-State: ABy/qLZkj8cMaKHm4RP52jC/shiNRUNqAiDm5tLuLo/xs+fx0xtXN3Ps aBrKfH/4X+8uij2ol0qgqB+suS+pAFetC+Vo+RE= X-Google-Smtp-Source: APBJJlEaLqkI5BtceMtAZIO4sOhdHGuHvp4uIER1F+IaMrCsk9ApkDyXswpek84zGhRWJ2P/fbkc6Q== X-Received: by 2002:a17:90b:1c07:b0:264:85:f4b8 with SMTP id oc7-20020a17090b1c0700b002640085f4b8mr1279151pjb.17.1688638003411; Thu, 06 Jul 2023 03:06:43 -0700 (PDT) Original-Received: from ?IPv6:2001:56a:7259:8f00::527? ([2001:56a:7259:8f00::527]) by smtp.gmail.com with ESMTPSA id j13-20020a17090a694d00b00263fc1ef1aasm1813475pjm.10.2023.07.06.03.06.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jul 2023 03:06:43 -0700 (PDT) Message-ID-Hash: RN3WGUHOB5JHHYB5ELR7UXPZMIK4RYHQ X-Message-ID-Hash: RN3WGUHOB5JHHYB5ELR7UXPZMIK4RYHQ X-MailFrom: mseven@telus.net X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list List-Id: mailing list for ConTeXt users List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Xref: news.gmane.io gmane.comp.tex.context:118039 Archived-At: Hi Hans, I've been using the SVG->MP converter and I've found a few bugs. Most of the bugs are with "weird" SVG input, but I have no control over the input, and the metadata on most of the files shows that it was exported from Adobe Illustrator which is (unfortunately) quite popular. I've tested all of the below with the latest ConTeXt. If you give Metapost an out-of-order gradient, it produces an invalid PDF. Both pages in this example: \startbuffer[gradient] \stopbuffer \starttext \startTEXpage \includesvgbuffer[gradient] \stopTEXpage \startMPpage fill unitsquare xyscaled (200,100) withshademethod "linear" withshadecenteronefraction (0,1) withshadecentertwofraction (0,0) withshadestep ( withshadefraction 0 withshadecolors (green, green) ) withshadestep ( withshadefraction 0.75 withshadecolors (blue, green) ) withshadestep ( withshadefraction 0.25 withshadecolors (green, blue) ) withshadestep ( withshadefraction 1 withshadecolors (green, blue) ) ; \stopMPpage \stoptext write this to the PDF /Bounds [ 0 0.75 0.25 ] which is invalid and renders incorrectly in every PDF reader that I've tested. This is what the SVG 1.1 spec has to say: Each gradient offset value is required to be equal to or greater than the previous gradient stop's offset value. If a given gradient stop's offset value is not equal to or greater than all previous offset values, then the offset value is adjusted to be equal to the largest of all previous offset values. The following SVG renders incorrectly, but replacing the 0% stop with the commented one fixes it: Using a gradient as the stroke colour outputs an invalid colour to MetaPost. This example: \startbuffer[gradient] \stopbuffer \startluacode print(metapost.svgtomp{data = buffers.getcontent("gradient")}) \stopluacode gives this output: [...] withcolor "url(#gradient)" [...] "stop-opacity" seems to be ignored: \startbuffer[gradient] \stopbuffer \startTEXpage \includesvgbuffer[gradient] \stopTEXpage Finally, "display:none;" doesn't work: \startbuffer[gradient] \stopbuffer \startTEXpage \includesvgbuffer[gradient] \stopTEXpage Thanks, -- Max ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___________________________________________________________________________________