Subject: [rfc-i] Text in SVG diagrams

From: "Martin Thomson" <[email-masked]>
Date: Thu, 07 Oct 2021 10:55:48 +1100

https://www.rfc-editor.org/rfc/rfc8899.html appears to use SVG quite effectively.  The diagrams really help illustrate the concepts in the document.

Lucas Pardue recently noted that appearances are not everything.  It is not possible (at least in browsers I have available to me) to search for text in these diagrams.  This is because every single character is placed separately as a distinct SVG element.

You can see the effect of this if you try to select text in any of the figures (https://www.rfc-editor.org/rfc/rfc8899.html#figure-4 is a good example).  I don't know what characters to be shuffled this way, but the effect is that text cannot be searched for or selected in any useful way.

I'm certain that this is not malice on the part of the authors or RPC, but the effect is that these diagrams are far less accessible than they could be.  Is there something we might do to improve this situation?
_______________________________________________
rfc-interest mailing list
[email-masked]
https://www.rfc-editor.org/mailman/listinfo/rfc-interest

---

From: Carsten Bormann <[email-masked]>
Date: Thu, 7 Oct 2021 02:36:30 +0200

This is mitigated nicely by the plaintext. 

Sent from mobile, sorry for terse

> On 7. Oct 2021, at 01:56, Martin Thomson <[email-masked]> wrote:
>

---

From: Leonard Rosenthol <[email-masked]>
Date: Thu, 7 Oct 2021 01:14:35 +0000

There is an an entire annex that was created for SVG 2 (that was never completed) about accessibility that is worth looking at - https://www.w3.org/TR/SVG/access.html.

Leonard

From: rfc-interest <[email-masked]> on behalf of Carsten Bormann <[email-masked]>
Date: Wednesday, October 6, 2021 at 8:37 PM
To: Martin Thomson <[email-masked]>
Cc: [email-masked] <[email-masked]>
Subject: Re: [rfc-i] Text in SVG diagrams
This is mitigated nicely by the plaintext.
Sent from mobile, sorry for terse

---

From: Brian E Carpenter <[email-masked]>
Date: Thu, 7 Oct 2021 16:37:18 +1300

Martin,

> I'm certain that this is not malice on the part of the authors or RPC, but the effect is that these diagrams are far less accessible than they could be.  Is there something we might do to improve t…

It all depends on the drawing tool used. If you look at the figures in RFC8989, note that the text strings are searchable and selectable. In that case, the drawing tool was dia and it handles text as text. Other tools do much more eccentric things.

    Brian

---

From: "Martin Thomson" <[email-masked]>
Date: Thu, 07 Oct 2021 14:48:48 +1100

On Thu, Oct 7, 2021, at 14:37, Brian E Carpenter wrote:
> It all depends on the drawing tool used. 

I'm aware of that.  I just think that if we use SVG we should take steps to avoid this sort of thing happening again.

---

From: Bosubabu <[email-masked]>
Date: Thu, 7 Oct 2021 10:02:41 +0530

Dear sir 🙏,
Thank you for your quick reply and Support always,

Iam trying to install NroffEditor,still not working. In the way trying to
write RFC Internet Draft in Word.v2.0.dot template format,

Kindly guide me how to convert word template into required formats like
.XML, .html,.ps, and .txt format.

On Thu, Oct 7, 2021, 05:26 Martin Thomson <[email-masked]> wrote:

> https://www.rfc-editor.org/rfc/rfc8899.html appears to use SVG quite
> effectively.  The diagrams really help illustrate the concepts in the
> document.
>
> Lucas Pardue recently noted that appearances are not everything.  It is
> not possible (at least in browsers I have available to me) to search for
> text in these diagrams.  This is because every single character is placed
> separately as a distinct SVG element.
>
> You can see the effect of this if you try to select text in any of the
> figures (https://www.rfc-editor.org/rfc/rfc8899.html#figure-4 is a good
> example).  I don't know what characters to be shuffled this way, but the
> effect is that text cannot be searched for or selected in any useful way.
>
> I'm certain that this is not malice on the part of the authors or RPC, but
> the effect is that these diagrams are far less accessible than they could
> be.  Is there something we might do to improve this situation?

---

From: Martin J. Dürst <[email-masked]>
Date: Thu, 7 Oct 2021 15:37:19 +0900

> I'm aware of that.  I just think that if we use SVG we should take steps to avoid this sort of thing happening again.

Very much so. Some drawing tools have a strong tendency to blow up 
things. A simple rectangle can end up as something very complex. 
Apparently, this also happens to text. I seem to remember there once was 
a Website that lobbied against this, and for simpler SVG. Can't find it 
anymore. But we should clearly try to avoid such stuff.

Regards,   Marti.n

---

From: Julian Reschke <[email-masked]>
Date: Thu, 7 Oct 2021 09:22:58 +0200

Am 07.10.2021 um 08:37 schrieb Martin J. Dürst:
>> I'm aware of that.  I just think that if we use SVG we should take
>> steps to avoid this sort of thing happening again.
>

Absolutely.

In this case it seems the drawing tool tried to position each character
separately.

Ideas:

- RFC Editor should do a sanity check on text handling
- find out what produced these SVGs (otherwise beautiful!) and see
whether it can be configured differently

...and if that's not possible: write a simple post-processor that fixes
the SVG (or embed that functionality into xml2rfc).

Best regards, Julian

---

From: "Joel M. Halpern" <[email-masked]>
Date: Thu, 7 Oct 2021 09:00:22 -0400

Given the range of ways things can be represented in SVG, and the 
demonstrated range of ways tools work, I would be amazed if a converter 
was simple.

Yours,
Joel

---

From: Julian Reschke <[email-masked]>
Date: Thu, 7 Oct 2021 15:06:12 +0200

> demonstrated range of ways tools work, I would be amazed if a converter

You're saying this so that I write a PoC, right?

Best regards, Julian

---

From: Paul Hoffman <[email-masked]>
Date: Thu, 07 Oct 2021 08:30:32 -0700

Alternate idea: the RFC Editor scans all the SVG before publication, and 
if it finds any words in the SVG that are not searchable, it adds those 
words as hidden/invisible text to the SVG.

--Paul Hoffman

---

From: Brian E Carpenter <[email-masked]>
Date: Fri, 8 Oct 2021 10:12:38 +1300

> You're saying this so that I write a PoC, right?

I think that is a real challenge. The utter garbage generated by LibreOffice appears completely intractable to me, for example. As far as I can see, every case is a special case.

To meet Martin's requirement, the RPC would find itself asking people to redo their drawings from zero, using a tool known to produce clean SVG.

   Brian

---

From: "Paul Duffy (paduffy)" <[email-masked]>
Date: Fri, 8 Oct 2021 01:14:23 +0000

Possible thread hijack, apologies if so.

Has anyone confirmed the SVG output from websequencediagrams.com?

I'll happily offer a sample if there is interest.

Cheers

-----Original Message-----
From: rfc-interest <[email-masked]> On Behalf Of Brian E Carpenter
Sent: Thursday, October 7, 2021 5:13 PM
To: [email-masked]
Subject: Re: [rfc-i] Text in SVG diagrams

On 08-Oct-21 02:06, Julian Reschke wrote:
>> demonstrated range of ways tools work, I would be amazed if a 
>> converter was simple.
>>
>> Yours,
>> Joel
> 

   Brian

---

From: Carsten Bormann <[email-masked]>
Date: Fri, 8 Oct 2021 09:00:55 +0200

> Has anyone confirmed the SVG output from websequencediagrams.com?

I haven’t done that, but kramdown-rfc supports several sequence diagram tools, and for all of these we needed to implement some postprocessing before their output can be integrated.

https://github.com/cabo/kramdown-rfc2629/wiki/SVG

> I'll happily offer a sample if there is interest.

If you have a realistic one, please do!

Grüße, Carsten

---

From: Bob Hinden <[email-masked]>
Date: Sat, 9 Oct 2021 10:21:04 -0700

Hi,

> On Oct 7, 2021, at 6:06 AM, Julian Reschke <[email-masked]> wrote:
> 

Is there a guide or BCP on how to create SVG for diagrams in drafts/RFCs?    What tools work, which don’t, sample diagrams, etc.

Bob

---

From: Alice Russo <[email-masked]>
Date: Mon, 11 Oct 2021 09:20:05 -0700

Hi Bob,

Here's a page of tips, compiled from a few sources:
https://www.rfc-editor.org/rse/wiki/doku.php?id=svg_files

Based on Brian's comment, we should add a note to recommend Dia so that text strings are searchable and selectable.

Alice

> On Oct 9, 2021, at 10:21 AM, Bob Hinden <[email-masked]> wrote:
> 
> Hi,
>

---

From: "Martin Thomson" <[email-masked]>
Date: Tue, 12 Oct 2021 11:11:01 +1100

One of the authors of RFC 8899 contacted me privately (he was working out how to post here) and indicated that tool was https://github.com/blampe/goat

This is a great tool, but it seems like it has a small problem.  It might be possible to patch it up.  Carsten mentioned that some post-processing was involved in getting goat to work nicely, so maybe he already has the necessary fixups in place.  Maybe a little work might be invested in upstreaming any tweaks.

It looks like this tool is exactly the sort of thing that people should be using, assuming that we can address issues regarding text placement.

On Tue, Oct 12, 2021, at 03:20, Alice Russo wrote:
> Based on Brian's comment, we should add a note to recommend Dia so that 
> text strings are searchable and selectable.
>
> Alice
>

---

From: "John Levine" <[email-masked]>
Date: 11 Oct 2021 20:52:18 -0400

It appears that Brian E Carpenter  <[email-masked]> said:
>> Lucas Pardue recently noted that appearances are not everything.  It is not possible (at least in browsers I have available to me) to search for text in
>these diagrams.  This is because every single character is placed separately as a distinct SVG element.

>It all depends on the drawing tool used. If you look at the figures in RFC8989, note that the text strings are searchable and selectable. In that case, the
>drawing tool was dia and it handles text as text. Other tools do much more eccentric things.

I took a look at the SVG in the XML and it appears that the unsearchable text puts each character in a separate <text ... attributes ...>x</text>
element, while the searchable text uses <text ... attrs ...><tspan>word</tspan></text>.

If that really is the difference, put each string in a <tspan/> I expect we could provide a lint tool or even have the submission
tool check and warn if the text appears to be fractured.

R's,
John
-- 
Regards,
John Levine, [email-masked], Primary Perpetrator of "The Internet for Dummies",
Please consider the environment before reading this e-mail. https://jl.ly
_______________________________________________
rfc-interest mailing list
[email-masked]
https://www.rfc-editor.org/mailman/listinfo/rfc-interest

---

From: Bosubabu <[email-masked]>
Date: Tue, 12 Oct 2021 11:20:06 +0530

>> I'm certain that this is not malice on the part of the authors or RPC,
>> but the effect is that these diagrams are far less accessible than they
>> could be.  Is there something we might do to improve this situation?

-- 

    *S. Bosubabu*   MCA, M.Tech, AMIE, (Ph.D.), PGDCC, Patents, ©, ®

      Scientist - Innovator, Author

      Assistant Professor, CSE Dept,

      Raghu Engineering College (A), Visakhapatnam, JNTU Kakinada

      Editor-In-Chief, IJRDES <http://www.ijrdes.com/index.php>

      + 91 9640641136

      https://www.bosubabu.com/

---

From: Bosubabu <[email-masked]>
Date: Tue, 12 Oct 2021 13:15:20 +0530

Dear Sir,
Sir, I am not familiar with programming, you said install python and open
GitHub link, but I don't know the next procedure finally output comes,
still now I don't know utilize GitHub and guide me further
proceedings, tell me the steps to process to outcomes, please.

When I tried to install NorffEditor through guidelines but not installed it
properly even the *.jar* file also did not open. Kindly installs my
computer in NroffEditor through Anydesk, Kindly help me, sir. I tried to 4
months onwards in so many ways, my problem is still pending sir, kindly
please accept my longest request, sir.

http://aaa-sec.com/nroffedit/nroffedit/download.html

On Tue, Oct 12, 2021 at 11:26 AM Martin Thomson <[email-masked]> wrote:

> Offlist.
>
> I recommend learning a markdown format, like this one:
> https://github.com/cabo/kramdown-rfc2629
>
> That tool will convert markdown to XML.  You can use xml2rfc (available
> from pypi.org) to convert that into HTML or text.
>
> When you are able to do that, you can convert from word to a form of
> markdown using https://word2md.com/  It needs a little work then to
> generate the right format for use with the markdown tools, but it is easy
> enough to go from there.
>
> On Tue, Oct 12, 2021, at 16:50, Bosubabu wrote:
> >>
> >> Dear sir 🙏,
> >> Iam trying to install NroffEditor,still not working. In the way trying
> to write RFC Internet Draft in Word.v2.0.dot template format,
> >>
> >>> Lucas Pardue recently noted that appearances are not everything.  It
> is not possible (at least in browsers I have available to me) to search for
> > *    **S. Bosubabu*   MCA, M.Tech, AMIE, (Ph.D.), PGDCC, Patents, ©, ®

-- 

      + 91 9640641136

---

From: Joe Touch <[email-masked]>
Date: Tue, 12 Oct 2021 07:16:18 -0700

> On Oct 11, 2021, at 10:50 PM, Bosubabu <[email-masked]> wrote:
> 
> 
>> 
>> Dear sir 🙏, 
>> Iam trying to install NroffEditor,still not working. In the way trying to write RFC Internet Draft in Word.v2.0.dot template format, 
>> 
>> Kindly guide me how to convert word template into required formats like .XML, .html,.ps, and .txt format.

The v2.0 template is the one I updated and it’s use is documented in RFC 5325. It generates only txt, but this is sufficient for submission.

It uses only one step after ‘print to text’, a Perl script.

Joe

---

From: Joe Touch <[email-masked]>
Date: Tue, 12 Oct 2021 07:17:22 -0700

That’s rfc5385. 

> On Oct 12, 2021, at 7:16 AM, Joe Touch <[email-masked]> wrote:
> 
> 
> 
>

---

From: Bob Hinden <[email-masked]>
Date: Tue, 12 Oct 2021 07:59:19 -0700

Alice,

Thanks, I will take a look.

Bob

> On Oct 11, 2021, at 9:20 AM, Alice Russo <[email-masked]> wrote:
> 
> Hi Bob,
>

---

From: Julian Reschke <[email-masked]>
Date: Thu, 14 Oct 2021 21:52:08 +0200

> You're saying this so that I write a PoC, right?

So the problem is that goat positions every non-line-art character
separately.

The attached script will try to recombine SVG text elements that are
"next" to each other (as produced by Goat, not in general!)

The attachment x.svg is the post-processed output for
<https://www.rfc-editor.org/rfc/rfc8899.html#section-5-3.1.1>.

Best regards, Julian