Re: [rfc-i] No, constraining to a custom SVG profile is not trivial

Phillip Hallam-Baker <phill@hallambaker.com> Tue, 21 January 2020 06:02 UTC

Return-Path: <rfc-interest-bounces@rfc-editor.org>
X-Original-To: ietfarch-rfc-interest-archive@ietfa.amsl.com
Delivered-To: ietfarch-rfc-interest-archive@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id AFB7912006E for <ietfarch-rfc-interest-archive@ietfa.amsl.com>; Mon, 20 Jan 2020 22:02:19 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -4.95
X-Spam-Level:
X-Spam-Status: No, score=-4.95 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.249, HTML_MESSAGE=0.001, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id G2S60d_gYcy8 for <ietfarch-rfc-interest-archive@ietfa.amsl.com>; Mon, 20 Jan 2020 22:02:13 -0800 (PST)
Received: from rfc-editor.org (rfc-editor.org [4.31.198.49]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id D98D1120052 for <rfc-interest-archive-eekabaiReiB1@ietf.org>; Mon, 20 Jan 2020 22:02:13 -0800 (PST)
Received: from rfcpa.amsl.com (localhost [IPv6:::1]) by rfc-editor.org (Postfix) with ESMTP id B8ADBF40742; Mon, 20 Jan 2020 22:02:05 -0800 (PST)
X-Original-To: rfc-interest@rfc-editor.org
Delivered-To: rfc-interest@rfc-editor.org
Received: from localhost (localhost [127.0.0.1]) by rfc-editor.org (Postfix) with ESMTP id 9BB6FF40742 for <rfc-interest@rfc-editor.org>; Mon, 20 Jan 2020 22:02:04 -0800 (PST)
X-Virus-Scanned: amavisd-new at rfc-editor.org
Received: from rfc-editor.org ([127.0.0.1]) by localhost (rfcpa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id u0YzstT180af for <rfc-interest@rfc-editor.org>; Mon, 20 Jan 2020 22:02:00 -0800 (PST)
Received: from mail-oi1-f174.google.com (mail-oi1-f174.google.com [209.85.167.174]) by rfc-editor.org (Postfix) with ESMTPS id 642DEF406F0 for <rfc-interest@rfc-editor.org>; Mon, 20 Jan 2020 22:02:00 -0800 (PST)
Received: by mail-oi1-f174.google.com with SMTP id p125so1500146oif.10 for <rfc-interest@rfc-editor.org>; Mon, 20 Jan 2020 22:02:08 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=K5j3KzcSEfW1jnzLGwimWAtJzTIq8ULGTXwjEkD4yn0=; b=jjwZmZzhG8bjtDHq6vGPU1nVf2KowjUKBAaNptb1shiKK13q8cjEfbutPjDz07KQlo xp3aSGv19PIGJvOyYc8Mx0l+a9Lukf1RFv5Hr4AO8VGuQVMvwbNyJjzc82y7lgwwULQS eluWowN2GoGhq9++6lnKskx4VdiP6nS2Nj3Sjnx2LnYKWTkf1i0RJpDmjCx5tlZSi0RW VXIO9ZQsz/03Jb1h/CTSmlj+JHGsZxtZ6g3nXxETxIJM3j6+3rbmG18CrYlU7kVSqGqr bmSsqVEjq9+/TCPGnWokS48Jnog7kVGizT+wLoNPvCcVlyT74ymd5mSSGn7VKnTfslLi +Kbg==
X-Gm-Message-State: APjAAAWQM+mp8dxoi0iXJqRE8iZn3Ttlb3HapdoxDvIr2hjsEC4IDyhE OyhmqkH7FbvWQ2OY4MyJCsCKSmKfRz1InoB/fIw=
X-Google-Smtp-Source: APXvYqyNw2WvSRIYXwJciklaa2OEV55ogacLtz0NYB+DBFrvTyNE6/lTuiN+PZSGVBRK38PrQ6weHs2sAFH688ioyGE=
X-Received: by 2002:a54:4f04:: with SMTP id e4mr1713932oiy.111.1579586527429; Mon, 20 Jan 2020 22:02:07 -0800 (PST)
MIME-Version: 1.0
References: <CAMm+LwiXhhJO7qYi41+DC4W7uMUVipXqyq75Fq2vagA1ppJNdA@mail.gmail.com> <10cca93f-a8b8-4c42-0653-3b12fa67ad12@gmail.com> <CAMm+LwgA-1UffBfrH-Y3J6pfh7ni9kNrndp=gHNyUyi5j=oLxg@mail.gmail.com> <53607da4-6608-783b-b875-65551e3add19@gmail.com> <CAMm+LwgNU2Dr3bB+A8k+UwbQiRRzgUkoRRh60tc6+bBv6CXwfQ@mail.gmail.com> <70ed6362-41ee-faf5-8f90-d094455dbdf4@gmail.com>
In-Reply-To: <70ed6362-41ee-faf5-8f90-d094455dbdf4@gmail.com>
From: Phillip Hallam-Baker <phill@hallambaker.com>
Date: Tue, 21 Jan 2020 01:01:56 -0500
Message-ID: <CAMm+Lwhy-AV_K5evzGdpDi-ynpLE4RxXCVB1HercickYfZaubg@mail.gmail.com>
To: Doug Royer <douglasroyer@gmail.com>
Subject: Re: [rfc-i] No, constraining to a custom SVG profile is not trivial
X-BeenThere: rfc-interest@rfc-editor.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: "A list for discussion of the RFC series and RFC Editor functions." <rfc-interest.rfc-editor.org>
List-Unsubscribe: <https://www.rfc-editor.org/mailman/options/rfc-interest>, <mailto:rfc-interest-request@rfc-editor.org?subject=unsubscribe>
List-Archive: <http://www.rfc-editor.org/pipermail/rfc-interest/>
List-Post: <mailto:rfc-interest@rfc-editor.org>
List-Help: <mailto:rfc-interest-request@rfc-editor.org?subject=help>
List-Subscribe: <https://www.rfc-editor.org/mailman/listinfo/rfc-interest>, <mailto:rfc-interest-request@rfc-editor.org?subject=subscribe>
Cc: RFC Interest <rfc-interest@rfc-editor.org>
Content-Type: multipart/mixed; boundary="===============7030521611386264391=="
Errors-To: rfc-interest-bounces@rfc-editor.org
Sender: rfc-interest <rfc-interest-bounces@rfc-editor.org>

I have read all posts on the RFC-I list that include the string 'SVG'. I
find that almost no mention whatsoever was made of SVG-Tiny until it
appeared in the drafts. There is barely any mention of an SVG profile
before it is asserted that the decision to use a profile of SVG is
immutable in 2014. I therefore reject the suggestion that this was
sufficiently discussed at the time.

If people want to claim that something was discussed and decided, I am
going to be asking for a link to the post where that happened.

But the other point I will make is that 2014 is six years ago and the
statement made then was that these issues could be reopened at a later
date. I am simply holding the group to the promise made then that these
issues can be revisited.

The state of SVG may well have been very different in 2014. Today it is
ubiquitously supported and there doesn't seem to be much interest in the
SVG-Tiny subset. Stripping out colour is simple. Converting from SVG to
SVG-Tiny is not.


On Tue, Jan 21, 2020 at 12:02 AM Doug Royer <douglasroyer@gmail.com> wrote:

> On 1/20/20 12:32 PM, Phillip Hallam-Baker wrote:
> > It is not just the greyscale that is the issue. There are numerous
> issues in the diagrams that result from the chosen profile.
> >
> > Compare the diagrams in:
> > https://tools.ietf.org/id/draft-hallambaker-mesh-architecture-12.html
> >
> > With the originals in:
> > https://mathmesh.com/Documents/draft-hallambaker-mesh-architecture.html
> >
> > Getting the diagrams to present properly is at least two weeks work for
> me on top of the weeks already spent. And I am probably not going to be the
> last person making this set of complaints. I am just the first person who
> developed specs that depend on having good diagrams in them.
>
> I think I understand your point, however the example you provided is not
> really an SVG vs RFC-7996-SVG comparison. I also agree some of the
> RFC-7996-SVG limitations seem extreme.
>
> The problem is the VISIO to RFC-7996-SVG conversion tool your using is
> selecting a wider font than the original. The conversion tool would need to
> get the em width, and match it up to a font with the same em width, or
> adjust the font size.
>

I can fix the font issue in the source files. But the much bigger problem
is the positioning of the text and the loss of the line markers.

  (1) It looks like VISIO places some object to absolute positions.
>   (2) VISIO seems to set some text objects relative to each other based on
> em ('M') width.
>   (3) VISIO seems to set font size by the size of the 'M' (em) character,
> rather than absolute point sizes. And different fonts have a different em
> sizes.
>

My tool converts everything into pixel units so that it can cope with the
dx/dy positioning attributes that are supported in SVG but not SVG-Tiny.

The set of transformations performed is:

1) Parse embedded CSS and substitute into class attributes.
2) Expand all style elements to corresponding attributes
3) Convert all relative coordinates (dx, dy) to absolute
4) Wrap text trailing a <tspan> element within the same <text> element with
a <tspan>
5) Strip out all elements and attributes that are not permitted.

The current known omissions in the conversion include:

1) Marker elements are not converted.
2) I have no idea what the set of allowed UNICODE characters is. This is
not apparent from the documentation.
3) Possible further positional issues.

If I could be confident this is all there is, I might be willing to
complete the converter but I strongly suspect that there will be an
infinite number of issues and the only way to get an acceptable conversion
is to implement a full SVG render engine in the conversion tool.

I also note that multiple Web sites report every current Web Browser
(except IE if you consider it that) has full support for the full SVG spec.
I have been unable to find any evidence for use of SVG-Tiny in any product
at any time. The only tool supporting it native seems to be Adobe
Illustrator.

So rather than embarking on an error prone exercise, the simplest approach
is to simply substitute the SVG full profile for SVG-Tiny.


The same is going to happen if the browser viewing mathmesh.com does not
> support the 'Calibri' font (unlikely, but the diagram will look messed up).
>

I have over a hundred diagrams to edit. So I am only going to make one set
of changes after I have determined what the minimal set is.



And - kind of related:
>
> The mathmesh.com SVG file far from a standard SVG file. It contains
> non-SVG Microsoft extensions from the VISIO program.
> (xmlns:v="http://schemas.microsoft.com/visio/2003/SVGExtensions/)
>

The first version of the tool striped them out without any loss. They
appear to be there to allow the SVG files to be read back into Visio.

The display only changes when the font restrictions and attribute/element
stripping is implemented.



> I do not think that a VISIO SVG-like file is reasonable as an example of
> what fails.
>
> The VISIO team that added export to SVG to VISIO seems to have done so
> without regard to actually exporting standard SVG. It exports to SVG-like
> files.
>
> (I am using your mathmesh.com SVG files to tweak my XSLT script to see
> what I can generate - I love being retired and have the time to just try
> things)
>

I rather doubt you will be able to do this type of transformation with XSLT:

(original)
  .st9 {font-family:Cambria Math;font-size:1em}
...
   <text x="17.17" y="282.11" class="st7" v:langID="1033"><v:paragraph
v:horizAlign="1"/><v:tabList/>Signature Key<v:newlineChar/><tspan
x="20.28" dy="1.225em" class="st6">Public</tspan>: X<tspan
class="st9">⊕</tspan>Y</text>

(cleaned)
      <text x="17.17" y="282.11" fill="#000000" font-family="sans-serif"
font-size="0.833336em">Signature Key<tspan x="20.28" y="294.3600392"
font-size="1em">Public</tspan>: X<tspan font-family="sans-serif"
font-size="1em">?</tspan> <tspan>Y </tspan> </text>

If you are going to enforce the restrictions properly, you have to expand
the class elements to the corresponding styles and then filter those.

You also need to catch the trailing </tspan>Y</text>, an error that is
reported by the submission tool but does not correspond to a requirement I
could see. Converting  dy="1.225em" to y="294.3600392" required an insane
amount of code. SVG has eight different units of length.
_______________________________________________
rfc-interest mailing list
rfc-interest@rfc-editor.org
https://www.rfc-editor.org/mailman/listinfo/rfc-interest