<?xml version="1.0" encoding="UTF-8" standalone="yes"?><oembed><version><![CDATA[1.0]]></version><provider_name><![CDATA[The Osmosian Order of Plain English Programmers Welcomes You]]></provider_name><provider_url><![CDATA[http://osmosianplainenglishprogramming.blog]]></provider_url><author_name><![CDATA[gerryrzeppa]]></author_name><author_url><![CDATA[https://osmosianplainenglishprogramming.blog/author/gerryrzeppa/]]></author_url><title><![CDATA[A WYSIWYG Document&nbsp;Editor]]></title><type><![CDATA[link]]></type><html><![CDATA[<header class="entry-header">
<h1 class="entry-title"></h1>
</header>
<div class="entry-content">
<p>When my elder son and I finished writing our Plain English compiler, we decided to test its usefulness by adding a what-you-see-is-what-you-get document editor that we could then use to document our system. Two birds with one stone!</p>
<p><strong>Document View</strong></p>
<p>We call this facility the Writer. This is what our instruction manual looks like when you open it in the Writer:</p>
<p><img loading="lazy" class="alignnone size-large wp-image-313831" src="https://cdncontribute.geeksforgeeks.org/wp-content/uploads/instructions-docster-view-1024x576.jpg" alt="" width="665" height="374" /></p>
<p>We call this Document View: one line per page. Whole pages (and groups of pages, contiguous or not) can be selected, copied, cut, pasted, duplicated and printed in this view. They can also be saved in Adobe PDF format so folks without the Writer can read them.</p>
<p><strong>Page View</strong></p>
<p>When you open a page, you see that page exactly as it will appear when it is printed (or saved as a PDF page), albeit with sky-blue grid lines to aid in tasteful layout. This is how page 8 of our instruction manual appears on the screen:</p>
<p><img loading="lazy" class="alignnone size-large wp-image-313835" src="https://cdncontribute.geeksforgeeks.org/wp-content/uploads/instructions-writer-page-1024x576.jpg" alt="" width="665" height="374" /></p>
<p>In this view, whole pages can be enlarged, reduced, rotated, and spell-checked. And various text and graphic “shapes” can be added, deleted, moved, sized, colored, flipped, mirrored, rotated, copied, cut, pasted, duplicated, grouped, etc. The Home, End, Page Up, and Page Down keys can be used to conveniently flip through the pages, without returning to Document View.</p>
<p><strong>Externalized Pages</strong></p>
<p>Documents (and parts of documents) can be saved, as mentioned above, as PDFs. But the native format for permanent storage is much simpler, and is text only. Consider, for example, the document below, which has just one page with four shapes on it: a pink ellipse, a green triangle, a blue square, and a text box with “ABC” in it:</p>
<p><img loading="lazy" class="alignnone size-large wp-image-313837" src="https://cdncontribute.geeksforgeeks.org/wp-content/uploads/sample-page-1024x576.jpg" alt="" width="665" height="374" /></p>
<p>If you use our “Open as Text” command (or any other text editor) to open this document, this is what you’ll see:</p>
<p><span style="color:#00ccff;">ream cal-3024<br />
</span><span style="color:#00ccff;">page 15840 12240 1 1440</span><br />
<span style="color:#00ccff;"> ellipse 0 0 0 0 1000 875 1440 1440 2880 2880</span><br />
<span style="color:#00ccff;"> polygon 0 0 0 1500 1000 875 4 4320 1440 5760 2880 4320 2880 4320 1440</span><br />
<span style="color:#00ccff;"> rectangle 0 0 0 2100 1000 875 7200 1440 8640 2880 0</span><br />
<span style="color:#00ccff;"> text 0 0 0 -1 0 0 10080 1440 14400 2880 0 &#8220;title&#8221; &#8220;osmosian&#8221; 1440 &#8220;center&#8221; 0 0 0 yes</span><br />
<span style="color:#00ccff;"> &#8220;ABC&#8221; </span><span style="color:#00ccff;">end </span><span style="color:#00ccff;">end </span><span style="color:#00ccff;">end</span></p>
<p>One entry for the whole document, one for each page, and one for each shape on the page. And not a single “&lt;&#8221; in sight!</p>
<p>It would be too much to paste the 4,000 Plain English sentences that define the whole Writer here. They are included in the source code that comes with our system <a href="http://www.osmosian.com/cal-4700.zip" target="_blank" rel="noopener">www.osmosian.com/cal-4700.zip</a>. For now, let’s settle for a sample routine:</p>
<p><span style="color:#00ccff;">To group any selected shapes on a page:</span><br />
<span style="color:#00ccff;"> If the page is nil, exit.</span><br />
<span style="color:#00ccff;"> Create a group shape.</span><br />
<span style="color:#00ccff;"> Put &#8220;group&#8221; into the group shape&#8217;s kind.</span><br />
<span style="color:#00ccff;"> Put the page&#8217;s scale into the group shape&#8217;s scale.</span><br />
<span style="color:#00ccff;"> Move the page&#8217;s shapes to some original shapes.</span><br />
<span style="color:#00ccff;"> Loop.</span><br />
<span style="color:#00ccff;"> Put the original shapes&#8217; first into a shape.</span><br />
<span style="color:#00ccff;"> If the shape is nil, break.</span><br />
<span style="color:#00ccff;"> Remove the shape from the original shapes.</span><br />
<span style="color:#00ccff;"> If the shape is not selected, append the shape to the page&#8217;s shapes; repeat.<br />
</span><span style="color:#00ccff;">Deselect the shape.</span><br />
<span style="color:#00ccff;"> Append the shape to the group shape&#8217;s shapes.</span><br />
<span style="color:#00ccff;"> Repeat.</span><br />
<span style="color:#00ccff;"> Append the group shape to the page&#8217;s shapes.</span><br />
<span style="color:#00ccff;"> Select the group shape.</span><br />
<span style="color:#00ccff;"> Adjust the group shape.</span></p>
<p>Shapes on pages are drawn back-to-front, so the newly grouped shapes will appear on top of the other shapes on the page.</p>
<p><strong>Not a Toy</strong></p>
<p>Please keep in mind that this is facility is not a “toy.” We used it, as I mentioned above, to write the documentation for our system. And since then it’s been used to produce an 800-page illustrated “teach your kid to read” course that you can see here: <a href="http://www.rhymingreader.com/" target="_blank" rel="noopener">www.rhymingreader.com</a>. Not to mention several other books for children, numerous training manuals, and presentation materials of all kinds, large and small. This is one of my all-time favorite pages, developed by a grade school teacher in an attempt to settle an age-old question:</p>
<p><img loading="lazy" class="alignnone size-full wp-image-313848" src="https://cdncontribute.geeksforgeeks.org/wp-content/uploads/how-many-sides-does-a-circle-have.jpg" alt="" width="672" height="538" /></p>
<p>QED.</p>
</div>
]]></html><thumbnail_url><![CDATA[https://i0.wp.com/cdncontribute.geeksforgeeks.org/wp-content/uploads/instructions-docster-view-1024x576.jpg?fit=440%2C330&ssl=1]]></thumbnail_url><thumbnail_width><![CDATA[440]]></thumbnail_width><thumbnail_height><![CDATA[248]]></thumbnail_height></oembed>