Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.postscript > #2804 > unrolled thread

A one-page Caesar's Cipher kit, in raw PostScript

Started byDylan McNamee <dylan.mcnamee@gmail.com>
First post2016-09-13 15:29 -0700
Last post2016-10-08 11:21 -0700
Articles 17 on this page of 37 — 11 participants

Back to article view | Back to comp.lang.postscript


Contents

  A one-page Caesar's Cipher kit, in raw PostScript Dylan McNamee <dylan.mcnamee@gmail.com> - 2016-09-13 15:29 -0700
    Re: A one-page Caesar's Cipher kit, in raw PostScript jdaw1 <jdawiseman@gmail.com> - 2016-09-13 15:54 -0700
    Re: A one-page Caesar's Cipher kit, in raw PostScript Lawrence D’Oliveiro <lawrencedo99@gmail.com> - 2016-09-14 03:11 -0700
      Re: A one-page Caesar's Cipher kit, in raw PostScript Dylan McNamee <dylan.mcnamee@gmail.com> - 2016-09-14 07:54 -0700
        Re: A one-page Caesar's Cipher kit, in raw PostScript Lawrence D’Oliveiro <lawrencedo99@gmail.com> - 2016-09-14 13:55 -0700
          Re: A one-page Caesar's Cipher kit, in raw PostScript jdaw1 <jdawiseman@gmail.com> - 2016-09-15 01:06 -0700
            Re: A one-page Caesar's Cipher kit, in raw PostScript Lawrence D’Oliveiro <lawrencedo99@gmail.com> - 2016-09-15 14:46 -0700
              Re: A one-page Caesar's Cipher kit, in raw PostScript jdaw1 <jdawiseman@gmail.com> - 2016-10-01 16:04 -0700
                Re: A one-page Caesar's Cipher kit, in raw PostScript tlvp <mPiOsUcB.EtLlLvEp@att.net> - 2016-10-01 23:10 -0400
          Re: A one-page Caesar's Cipher kit, in raw PostScript Eli the Bearded <*@eli.users.panix.com> - 2016-09-20 22:24 +0000
            Re: A one-page Caesar's Cipher kit, in raw PostScript Martin Leese <please@see.Web.for.e-mail.INVALID> - 2016-09-21 13:36 -0600
              Re: A one-page Caesar's Cipher kit, in raw PostScript Lawrence D’Oliveiro <lawrencedo99@gmail.com> - 2016-09-21 16:27 -0700
    Re: A one-page Caesar's Cipher kit, in raw PostScript Alan <alan.isaac@gmail.com> - 2016-09-22 18:57 -0700
      Re: A one-page Caesar's Cipher kit, in raw PostScript Lawrence D’Oliveiro <lawrencedo99@gmail.com> - 2016-09-22 20:04 -0700
        Re: A one-page Caesar's Cipher kit, in raw PostScript luser droog <luser.droog@gmail.com> - 2016-10-01 13:45 -0700
          Re: A one-page Caesar's Cipher kit, in raw PostScript Lawrence D’Oliveiro <lawrencedo99@gmail.com> - 2016-10-03 04:29 -0700
            Re: A one-page Caesar's Cipher kit, in raw PostScript luser droog <luser.droog@gmail.com> - 2016-10-03 10:41 -0700
              Re: A one-page Caesar's Cipher kit, in raw PostScript Lawrence D’Oliveiro <lawrencedo99@gmail.com> - 2016-10-03 14:49 -0700
                Re: A one-page Caesar's Cipher kit, in raw PostScript luser droog <luser.droog@gmail.com> - 2016-10-03 21:52 -0700
      Re: A one-page Caesar's Cipher kit, in raw PostScript Markus Triska <triska@metalevel.at> - 2016-10-01 22:16 +0200
        Re: A one-page Caesar's Cipher kit, in raw PostScript luser droog <luser.droog@gmail.com> - 2016-10-01 13:30 -0700
        Re: A one-page Caesar's Cipher kit, in raw PostScript Lawrence D’Oliveiro <lawrencedo99@gmail.com> - 2016-10-02 16:07 -0700
          Re: A one-page Caesar's Cipher kit, in raw PostScript Markus Triska <triska@metalevel.at> - 2016-10-03 02:03 +0200
            Re: A one-page Caesar's Cipher kit, in raw PostScript Lawrence D’Oliveiro <lawrencedo99@gmail.com> - 2016-10-02 19:47 -0700
            Re: A one-page Caesar's Cipher kit, in raw PostScript Lawrence D’Oliveiro <lawrencedo99@gmail.com> - 2016-10-04 02:00 -0700
              Re: A one-page Caesar's Cipher kit, in raw PostScript Mark Carroll <mtbc@bcs.org> - 2016-10-04 10:10 +0100
                Re: A one-page Caesar's Cipher kit, in raw PostScript Dylan McNamee <dylan.mcnamee@gmail.com> - 2016-10-04 08:00 -0700
                Re: A one-page Caesar's Cipher kit, in raw PostScript Lawrence D’Oliveiro <lawrencedo99@gmail.com> - 2016-10-04 13:57 -0700
                  Re: A one-page Caesar's Cipher kit, in raw PostScript Mark Carroll <mtbc@bcs.org> - 2016-10-05 09:31 +0100
                    Re: A one-page Caesar's Cipher kit, in raw PostScript Lawrence D’Oliveiro <lawrencedo99@gmail.com> - 2016-10-05 06:37 -0700
                      Re: A one-page Caesar's Cipher kit, in raw PostScript ken <ken@spamcop.net> - 2016-10-05 16:10 +0100
                        Re: A one-page Caesar's Cipher kit, in raw PostScript jdaw1 <jdawiseman@gmail.com> - 2016-10-05 13:37 -0700
                        Re: A one-page Caesar's Cipher kit, in raw PostScript Lawrence D’Oliveiro <lawrencedo99@gmail.com> - 2016-10-05 18:13 -0700
              Re: A one-page Caesar's Cipher kit, in raw PostScript Markus Triska <triska@metalevel.at> - 2016-10-05 22:44 +0200
                Re: A one-page Caesar's Cipher kit, in raw PostScript Lawrence D’Oliveiro <lawrencedo99@gmail.com> - 2016-10-05 18:12 -0700
                  Re: A one-page Caesar's Cipher kit, in raw PostScript Markus Triska <triska@metalevel.at> - 2016-10-08 10:24 +0200
                    Re: A one-page Caesar's Cipher kit, in raw PostScript Lawrence D’Oliveiro <lawrencedo99@gmail.com> - 2016-10-08 11:21 -0700

Page 2 of 2 — ← Prev page 1 [2]


#2829

Fromluser droog <luser.droog@gmail.com>
Date2016-10-01 13:30 -0700
Message-ID<64549829-bfc8-4dfc-8911-c12065a18263@googlegroups.com>
In reply to#2828
On Saturday, October 1, 2016 at 3:16:31 PM UTC-5, Markus Triska wrote:
> Alan <alan.isaac@gmail.com> writes:
> 
> > Saying PDF superseded PS is just plain wrong in a thread about
> > drawing. It would be true if we were talking about document exchange
> > formats. But essentially nobody will try to draw by hand in PDF. Many
> > people find this fun and worthwhile in PS.
> 
> I wholeheartedly agree with this, thank you for putting it so clearly
> and succinctly. In fact, I would remove "in a thread about drawing".
> 

I wholeheartedly agree with /this/! 
And thank /you/ for putting it so succinctly, Markus.

[toc] | [prev] | [next] | [standalone]


#2838

FromLawrence D’Oliveiro <lawrencedo99@gmail.com>
Date2016-10-02 16:07 -0700
Message-ID<b2790854-eecd-41ae-a4aa-bf85567a66b0@googlegroups.com>
In reply to#2828
On Sunday, October 2, 2016 at 9:16:31 AM UTC+13, Markus Triska wrote:
> I use PostScript a lot for various visualizations. Python and the other
> mentioned alternatives are completely out of the question for this, not
> only because doing it would be more verbose and less convenient, but
> also because people who need the result (i.e., actually see or print the
> drawing) may not have Python or other interpreters installed, and my not
> be in a position to do so.

Or they might not have a PostScript interpreter available, either.

> Another use case, real-time visualizations of search processes, is
> simply not possible in PDF or XML (how can an XML file read from
> standard input?), and is also conveniently expressed with PostScript.

How about interactive animations <https://github.com/ldo/qahirah_notebooks>?

[toc] | [prev] | [next] | [standalone]


#2839

FromMarkus Triska <triska@metalevel.at>
Date2016-10-03 02:03 +0200
Message-ID<m2wphq70ze.fsf@metalevel.at>
In reply to#2838
Lawrence D’Oliveiro <lawrencedo99@gmail.com> writes:

>> I use PostScript a lot for various visualizations. Python and the other
>> mentioned alternatives are completely out of the question for this, not
>> only because doing it would be more verbose and less convenient, but
>> also because people who need the result (i.e., actually see or print the
>> drawing) may not have Python or other interpreters installed, and my not
>> be in a position to do so.
>
> Or they might not have a PostScript interpreter available, either.

The point is that this is the less likely event of the two, in the
situations I have seen. In addition, PostScript printers are currently
vastly more widely available than Python or Cairo printers, of which I
have seen none so far. So, you can often print PostScript directly.

>> Another use case, real-time visualizations of search processes, is
>> simply not possible in PDF or XML (how can an XML file read from
>> standard input?), and is also conveniently expressed with PostScript.
>
> How about interactive animations
> <https://github.com/ldo/qahirah_notebooks>?

I hope they are great. I want to make one thing clear at this point:

There are several well-known shortcomings of PostScript, and they are
likely especially well-known in this newsgroup. However, the existence
of other tools for different tasks definitely isn't one of them, and
even less so when they cannot, either in principle or due to their being
less widely available or their not being available at all in the
situations where PostScript *is* available, subsume it. For example, a
comparatively limited page description or XML format cannot replace a
Turing-complete programming language due to inherent reasons. As another
example, a language that is not well supported by other tools in which
PostScript is well supported and where I need its functionality cannot
take the position of PostScript either. I am thinking for example of
LaTeX etc., where I frequently embed PostScript files, but not Cairo.

All the best,
Markus

[toc] | [prev] | [next] | [standalone]


#2840

FromLawrence D’Oliveiro <lawrencedo99@gmail.com>
Date2016-10-02 19:47 -0700
Message-ID<f1e99d6b-dd5f-4f7c-9461-374ab2486895@googlegroups.com>
In reply to#2839
On Monday, October 3, 2016 at 1:04:13 PM UTC+13, Markus Triska wrote:
> In addition, PostScript printers are currently
> vastly more widely available than Python or Cairo printers, of which I
> have seen none so far.

I have been able to print with Python and Cairo just fine on all the printers I’ve owned.

[toc] | [prev] | [next] | [standalone]


#2846

FromLawrence D’Oliveiro <lawrencedo99@gmail.com>
Date2016-10-04 02:00 -0700
Message-ID<dc59c1c3-a410-475f-9833-a82c4c71db8f@googlegroups.com>
In reply to#2839
On Monday, October 3, 2016 at 1:04:13 PM UTC+13, Markus Triska wrote:
> For example, a comparatively limited page description or XML format cannot
> replace a Turing-complete programming language due to inherent reasons.

But a page description is not the place for Turing completeness.

Talking about PostScript versus Python and Cairo, I just did an update on a Python script I created many years ago to lay out and print labels for audio CDs. This involves some intricate formatting involving Unicode-encoded text, leader tabs, left- and right-aligned fields, and also making sure that long track titles fitted into a fixed-width area.

Originally the script generated PostScript, which I fed through Ghostscript to generate a PNG file for printing. I just reworked the script to make direct Cairo calls to generate exactly the same layout.

Result? The code shrank from 386 lines to just 239.

[toc] | [prev] | [next] | [standalone]


#2847

FromMark Carroll <mtbc@bcs.org>
Date2016-10-04 10:10 +0100
Message-ID<87a8ekmqct.fsf@ixod.org>
In reply to#2846
On 04 Oct 2016, Lawrence D’Oliveiro wrote:

> On Monday, October 3, 2016 at 1:04:13 PM UTC+13, Markus Triska wrote:
>> For example, a comparatively limited page description or XML format cannot
>> replace a Turing-complete programming language due to inherent reasons.
>
> But a page description is not the place for Turing completeness.

This depends on what one wants to print and how. For instance, if I want
to use fonts that are built in to the printer, then I write my diagram
layout and wordwrap code and whatever in PostScript itself, then my
documents adjust perfectly to the exact font metrics. It is lovely to be
able to do that kind of thing. More relevantly, it's lovely to have the
option of being able to adjust my document in any way based on fine
details of what the final destination printer can offer me.

But PostScript isn't a "page description" so much as a "how to draw the
pages". If you think of it as the former then of course it will seem
overpowered.

-- Mark

[toc] | [prev] | [next] | [standalone]


#2848

FromDylan McNamee <dylan.mcnamee@gmail.com>
Date2016-10-04 08:00 -0700
Message-ID<4d8718ff-36e1-417f-861f-bf75eec57f1b@googlegroups.com>
In reply to#2847
On Tuesday, October 4, 2016 at 2:10:43 AM UTC-7, Mark Carroll wrote:
> On 04 Oct 2016, Lawrence D’Oliveiro wrote:
> 
> > On Monday, October 3, 2016 at 1:04:13 PM UTC+13, Markus Triska wrote:
> >> For example, a comparatively limited page description or XML format cannot
> >> replace a Turing-complete programming language due to inherent reasons.
> >
> > But a page description is not the place for Turing completeness.
> 
> This depends on what one wants to print and how....

Indeed.  As the OP, I'll point out that the posting that started all of
this included the phrase "for the diagrams that it makes sense". I
think my use of PostScript to draw code wheels totally makes sense -
with the same routines, I could both create a kit layout, as well as
figures of an assembled wheel. With a minor tweak, I can adjust the
settings of the code wheels.  As I said in response to Lawrence's post,
I'll check out Cairo - it's always good to add arrows to my quiver.
Still, if you look at my PostScript, it's not crazy-complicated, and it
does the job succinctly.

I had no idea what a flurry this would cause - live and learn!

dylan

[toc] | [prev] | [next] | [standalone]


#2850

FromLawrence D’Oliveiro <lawrencedo99@gmail.com>
Date2016-10-04 13:57 -0700
Message-ID<4cf33965-40d1-406e-9ddf-10fb0367ba19@googlegroups.com>
In reply to#2847
On Tuesday, October 4, 2016 at 10:10:43 PM UTC+13, Mark Carroll wrote:
> For instance, if I want to use fonts that are built in to the printer...

My printer has no fonts built-in. And even in my PostScript days, Adobe’s fonts were available for PCs, not just printers. And these days, I don’t bother much with Adobe fonts. Though I still like to use the old names...

    ldo@theon:python_freetype> python3 -ic "import freetype2"
    >>> ft = freetype2.Library()
    >>> f = ft.find_face("Palatino")
    >>> f.family_name
    'URW Palladio L'
    >>> f.filename
    '/usr/share/fonts/type1/gsfonts/p052003l.pfb'

> ... then my documents adjust perfectly to the exact font metrics.
> It is lovely to be able to do that kind of thing.

Microsoft Word user, are you?

It’s the kind of thing most of us take for granted.

[toc] | [prev] | [next] | [standalone]


#2854

FromMark Carroll <mtbc@bcs.org>
Date2016-10-05 09:31 +0100
Message-ID<87vax75h9e.fsf@ixod.org>
In reply to#2850
On 04 Oct 2016, Lawrence D’Oliveiro wrote:

> On Tuesday, October 4, 2016 at 10:10:43 PM UTC+13, Mark Carroll wrote:
(snip)
>> ... then my documents adjust perfectly to the exact font metrics.
>> It is lovely to be able to do that kind of thing.
>
> Microsoft Word user, are you?
>
> It’s the kind of thing most of us take for granted.

I'm sorry, you've completely lost me here. I certainly wouldn't
associate Word use with caring at all about the fine details of how
documents look. I'm not talking about simple generic things like
Knuthian paragraph breaking or placement of floating figures, but
instead bespoke things like the internals of custom figures like
histogram binning or scatterplot tickmarks or GANTT charts that adapt
both their layout and spacing internally according to font sizes, page
widths, etc., while using the same fonts as whatever the main document
text currently is (for task names, coordinates, whatever). Then I don't
have to regenerate different kinds of diagrams and charts using myriad
source software whenever I want to adjust formatting, it all just
self-adapts.

It's often not much that I want to adjust formatting as now we want to
partially reuse something for someone who demands different specific
formatting. I am a big fan of tools like Basser Lout and TikZ but they
go only so far and quite often when I've thought about what I actually
want to express it turns out that PostScript itself is a very natural
fit and gives me pretty much the language to express what I had in mind.
(Unfortunately it was some years before I discovered that because the
only PostScript I'd seen was generated by printer drivers.)

I'll agree it's not perfect: for instance, when I wanted letters
nestling perfectly against each other I ended up having to write a sort
(for line segments) to find the coordinates of specific parts of the
letters. But, things like fonts are enough of a pain (different types of
font, different operating systems like them differently installed, etc.)
that I find it helpful to be able to author stuff that still looks good
if the exact fonts of interest aren't present on both the system I'm
writing on and the eventual destination (whether it be printer or not),
but you may be lucky enough to be able to rely on a fair bit of
normality and homogeneity or simply be better at installing various
fonts on various systems than I am.

-- Mark

[toc] | [prev] | [next] | [standalone]


#2855

FromLawrence D’Oliveiro <lawrencedo99@gmail.com>
Date2016-10-05 06:37 -0700
Message-ID<8422fa0f-a44c-4a3b-a03c-9d2572dc4753@googlegroups.com>
In reply to#2854
On Wednesday, October 5, 2016 at 9:31:26 PM UTC+13, Mark Carroll wrote:
> I certainly wouldn't associate Word use with caring at all about the fine
> details of how documents look.

Precisely. That’s why I thought that your resorting to PostScript in order to achieve high-quality document layout must mean you are comparing it to Microsoft Word.

Consider trying to do advanced text layouts like these <http://default-cube.deviantart.com/gallery/59919308/HarfPy-Examples>: I can do them in Python, which gives me full access to the Linux typography stack, to take advantage of the features of OpenType fonts.

How would you do that in PostScript? You’d be struggling, because PostScript has never heard of OpenType fonts.

[toc] | [prev] | [next] | [standalone]


#2856

Fromken <ken@spamcop.net>
Date2016-10-05 16:10 +0100
Message-ID<MPG.325f2821768a50b098990f@usenet.plus.net>
In reply to#2855
In article <8422fa0f-a44c-4a3b-a03c-9d2572dc4753@googlegroups.com>, 
lawrencedo99@gmail.com says...

> How would you do that in PostScript? You?d be struggling, because 
PostScript has never heard of OpenType fonts.

So what ? PostScript is a programming language, I can read an OpenType 
font perfectly easily, I can even convert it into something else if I 
want.

[toc] | [prev] | [next] | [standalone]


#2857

Fromjdaw1 <jdawiseman@gmail.com>
Date2016-10-05 13:37 -0700
Message-ID<3eb33027-0830-40a4-97ba-f29da23e745c@googlegroups.com>
In reply to#2856
Lawrence: please please start a new thread, perhaps entitled ‘Why I hate PostScript’. In that thread please comment at great length on Arab-African capital cities, and their merits over other places with internal capitalisation. 

And also please stop disrupting other conversations, even those about the (perhaps lesser) merits of towns that you might wish to believe not so elegant|populous|traffic-infested|governed by corrupt policemen.

Thank you.

[toc] | [prev] | [next] | [standalone]


#2860

FromLawrence D’Oliveiro <lawrencedo99@gmail.com>
Date2016-10-05 18:13 -0700
Message-ID<202390dc-699a-4fdb-9756-00f5e2244e5a@googlegroups.com>
In reply to#2856
On Thursday, October 6, 2016 at 4:10:08 AM UTC+13, ken wrote:
> In article <8422fa0f-a44c-4a3b-a03c-9d2572dc4753@googlegroups.com>, 
> Lawrence D’Oliveiro says...
> 
>> How would you do that in PostScript? You?d be struggling, because
>> PostScript has never heard of OpenType fonts.
> 
> So what ? PostScript is a programming language, I can read an OpenType 
> font perfectly easily, I can even convert it into something else if I 
> want.

How “perfectly easily” can you do these <http://default-cube.deviantart.com/gallery/59919308/HarfPy-Examples>?

[toc] | [prev] | [next] | [standalone]


#2858

FromMarkus Triska <triska@metalevel.at>
Date2016-10-05 22:44 +0200
Message-ID<m2oa2y7cg4.fsf@metalevel.at>
In reply to#2846
Lawrence D’Oliveiro <lawrencedo99@gmail.com> writes:

> But a page description is not the place for Turing completeness.

In my opinion, a page description is not the place to *not* have Turing
completeness. Or put differently, suppose that a page description is
really not the place for Turing completeness. How could we reconcile
this assumption with the existence and wide availability of PostScript,
which is also used for page descriptions, and its thorough support by
utilities and tasks that are intimately related to page descriptions?

> Result? The code shrank from 386 lines to just 239.

That's awesome! It seems that Cairo suits you much more than PostScript.

All the best,
Markus

[toc] | [prev] | [next] | [standalone]


#2859

FromLawrence D’Oliveiro <lawrencedo99@gmail.com>
Date2016-10-05 18:12 -0700
Message-ID<890656a8-78e0-44c0-b48e-70bbedb44b5d@googlegroups.com>
In reply to#2858
On Thursday, October 6, 2016 at 9:44:47 AM UTC+13, Markus Triska wrote:
> In my opinion, a page description is not the place to *not* have Turing
> completeness. Or put differently, suppose that a page description is
> really not the place for Turing completeness. How could we reconcile
> this assumption with the existence and wide availability of PostScript,
> which is also used for page descriptions, and its thorough support by
> utilities and tasks that are intimately related to page descriptions?

Not so widely used any more, though. Prepress, for example, now prefers PDF, precisely because it is not Turing-complete.

>> Result? The code shrank from 386 lines to just 239.
> 
> That's awesome! It seems that Cairo suits you much more than PostScript.

You think you could do better with PostScript?

[toc] | [prev] | [next] | [standalone]


#2873

FromMarkus Triska <triska@metalevel.at>
Date2016-10-08 10:24 +0200
Message-ID<m2zimfdz92.fsf@metalevel.at>
In reply to#2859
Lawrence D’Oliveiro <lawrencedo99@gmail.com> writes:

> You think you could do better with PostScript?

Probably not. I mean probably not according to what you consider better.

What I value about PostScript is not affected by this though: I value
its elegance and simplicity as a programming language, albeit limited in
several ways, as well as its uniformity and stringency. For example, I
always found it extremely elegant that each glyph is itself described by
a PostScript program, which is the same language that is then also used
on a higher level to express the positioning and layout of the glyphs.

So far, I have not found another programming language for the cases in
which I am currently using PostScript that even comes close to this. If
there were one, I would definitely consider it as an alternative.

All the best!
Markus

[toc] | [prev] | [next] | [standalone]


#2875

FromLawrence D’Oliveiro <lawrencedo99@gmail.com>
Date2016-10-08 11:21 -0700
Message-ID<5fc2a5ee-a976-4829-9805-93671ee2193e@googlegroups.com>
In reply to#2873
On Saturday, October 8, 2016 at 9:23:54 PM UTC+13, Markus Triska wrote:
> Lawrence D’Oliveiro writes:
> 
> > You think you could do better with PostScript?
> 
> Probably not. I mean probably not according to what you consider better.

As in “simpler”, “higher quality”, “more powerful graphics/typography model” -- you know, all the obvious things.

> For example, I
> always found it extremely elegant that each glyph is itself described by
> a PostScript program, which is the same language that is then also used
> on a higher level to express the positioning and layout of the glyphs.

You are talking about Type 3 fonts, which tend not to be of the best professional quality.

> So far, I have not found another programming language for the cases in
> which I am currently using PostScript that even comes close to this.

The irony is that PostScript was designed from the ground up as a graphics programming language, while Python was not. Yet Python, with a suitable graphics API binding, does graphics much better than PostScript!

[toc] | [prev] | [standalone]


Page 2 of 2 — ← Prev page 1 [2]

Back to top | Article view | comp.lang.postscript


csiph-web