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


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

YA Type 3 Hershey font

Started byluser- -droog <mijoryx@yahoo.com>
First post2014-01-06 11:52 -0800
Last post2014-04-29 14:56 -0700
Articles 11 — 4 participants

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


Contents

  YA Type 3 Hershey font luser- -droog <mijoryx@yahoo.com> - 2014-01-06 11:52 -0800
    Re: YA Type 3 Hershey font Helge Blischke <h.blischke@acm.org> - 2014-01-07 19:23 +0100
    Re: YA Type 3 Hershey font Helge Blischke <h.blischke@acm.org> - 2014-01-07 20:40 +0100
      Re: YA Type 3 Hershey font luser- -droog <mijoryx@yahoo.com> - 2014-01-07 22:04 -0800
        Re: YA Type 3 Hershey font luser- -droog <mijoryx@yahoo.com> - 2014-01-07 23:42 -0800
          Re: YA Type 3 Hershey font luser- -droog <mijoryx@yahoo.com> - 2014-01-07 23:53 -0800
            Re: YA Type 3 Hershey font scruss@gmail.com - 2014-04-19 08:47 -0700
              Re: YA Type 3 Hershey font tlvp <mPiOsUcB.EtLlLvEp@att.net> - 2014-04-20 01:12 -0400
                Re: YA Type 3 Hershey font scruss@gmail.com - 2014-04-22 17:29 -0700
                  Re: YA Type 3 Hershey font tlvp <mPiOsUcB.EtLlLvEp@att.net> - 2014-04-22 21:42 -0400
          Re: YA Type 3 Hershey font scruss@gmail.com - 2014-04-29 14:56 -0700

#1770 — YA Type 3 Hershey font

Fromluser- -droog <mijoryx@yahoo.com>
Date2014-01-06 11:52 -0800
SubjectYA Type 3 Hershey font
Message-ID<a0f71504-9d3a-4a9a-bca3-03388af7e32b@googlegroups.com>
I've been playing with the Hershey font data, using the description at:
http://paulbourke.net/dataformats/hershey/
but not the files from there. 
All of the .jhf (John(Hunt)'s Hershey Font (Format)) use 12345 as the 
declared character code. Apparently the glyphs in these files are 
arranged positionally to match the printable ascii range, 33-126.

I got my data file somewhere else (not finding it right now), but it
appears to be the "older" single-file version, where the declared codes
have semantic meaning as described in the old Hershey report (not finding
that either, but if I found a pdf (and I did), it's out there somewhere).
It appears to be the format Bourke is talking about, too. Char #8 matches
his example.

So, this program will read the Hershey font data into a dictionary,
keyed by the "Occidental" character code. 

That's all I've got for now. 

%!
/hersheyfile (hershey_occ)(r)file def 
/buf 72 string def 
/charcodes 1 dict def 

/strcat { % a b  .  a+b 
    2 copy length exch length add string % a b new 
    dup 4 3 roll 2 copy 0 exch putinterval % b new' new' a
    length 4 3 roll putinterval % new''
} def 

/processline {
    dup length 0 gt { % non-blank line
        dup length 5 gt {
            dup 4 get % line line[4]
            dup 48 ge
            exch 57 le  % line '0'<=line[4]<='9'
            and
            { % new glyph
                dup 1 4 getinterval cvi  % line idx 
                dup /lastcode exch def 
                exch 5 1 index length 5 sub getinterval % idx line
                charcodes 3 1 roll put 
            }{
                charcodes lastcode get exch strcat % append to previous line
                charcodes exch lastcode exch put 
            } ifelse
        }{
            charcodes lastcode get exch strcat
            charcodes exch lastcode exch put 
        } ifelse
    }{ % blank line
        pop
    } ifelse
} def 

{
    hersheyfile buf readline {
        processline
    }{  
        processline
        exit
    } ifelse
} loop


I just realized there's a better way to
detect multi-line glyphs. Here I use a heuristic I came up with by
examining the data. The first column is blank followed by a 4-digit
character code on a new line. Continuation lines use the first column,
so anything not starting with space is a continuation. BUT ' R' is a
valid data point, and it starts with a space, so NOT ALL lines 
beginning with space are in fact new characters. BUT all data points
will be upper-case characters, biased around ascii 'R'.

So the heuristic is: a new glyph line must be at least 5 characters
(longer, really, but at least 5) and contain a digit in position 4
(0-based). Anything else is a continuation, or nothing if it's a
totally blank line.

A better way would be to check count field and read until the glyph
is complete. This avoids all use of "heuristic", but may actually be
more complicated to implement. :/

...to be continued...

[toc] | [next] | [standalone]


#1771

FromHelge Blischke <h.blischke@acm.org>
Date2014-01-07 19:23 +0100
Message-ID<bj2v1oFqlgbU1@mid.individual.net>
In reply to#1770
luser- -droog wrote:

> I've been playing with the Hershey font data, using the description at:
> http://paulbourke.net/dataformats/hershey/
> but not the files from there.
> All of the .jhf (John(Hunt)'s Hershey Font (Format)) use 12345 as the
> declared character code. Apparently the glyphs in these files are
> arranged positionally to match the printable ascii range, 33-126.
> 
> I got my data file somewhere else (not finding it right now), but it
> appears to be the "older" single-file version, where the declared codes
> have semantic meaning as described in the old Hershey report (not finding
> that either, but if I found a pdf (and I did), it's out there somewhere).
> It appears to be the format Bourke is talking about, too. Char #8 matches
> his example.
> 
> So, this program will read the Hershey font data into a dictionary,
> keyed by the "Occidental" character code.
> 
> That's all I've got for now.
> 
> %!
> /hersheyfile (hershey_occ)(r)file def
> /buf 72 string def
> /charcodes 1 dict def
> 
> /strcat { % a b  .  a+b
>     2 copy length exch length add string % a b new
>     dup 4 3 roll 2 copy 0 exch putinterval % b new' new' a
>     length 4 3 roll putinterval % new''
> } def
> 
> /processline {
>     dup length 0 gt { % non-blank line
>         dup length 5 gt {
>             dup 4 get % line line[4]
>             dup 48 ge
>             exch 57 le  % line '0'<=line[4]<='9'
>             and
>             { % new glyph
>                 dup 1 4 getinterval cvi  % line idx
>                 dup /lastcode exch def
>                 exch 5 1 index length 5 sub getinterval % idx line
>                 charcodes 3 1 roll put
>             }{
>                 charcodes lastcode get exch strcat % append to previous
>                 line charcodes exch lastcode exch put
>             } ifelse
>         }{
>             charcodes lastcode get exch strcat
>             charcodes exch lastcode exch put
>         } ifelse
>     }{ % blank line
>         pop
>     } ifelse
> } def
> 
> {
>     hersheyfile buf readline {
>         processline
>     }{
>         processline
>         exit
>     } ifelse
> } loop
> 
> 
> I just realized there's a better way to
> detect multi-line glyphs. Here I use a heuristic I came up with by
> examining the data. The first column is blank followed by a 4-digit
> character code on a new line. Continuation lines use the first column,
> so anything not starting with space is a continuation. BUT ' R' is a
> valid data point, and it starts with a space, so NOT ALL lines
> beginning with space are in fact new characters. BUT all data points
> will be upper-case characters, biased around ascii 'R'.
> 
> So the heuristic is: a new glyph line must be at least 5 characters
> (longer, really, but at least 5) and contain a digit in position 4
> (0-based). Anything else is a continuation, or nothing if it's a
> totally blank line.
> 
> A better way would be to check count field and read until the glyph
> is complete. This avoids all use of "heuristic", but may actually be
> more complicated to implement. :/
> 
> ...to be continued...

I just found a short description of the file format and a list of 
downloadable fonts at
http://emergent.unpythonic.net/software/hershey

Helge

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


#1772

FromHelge Blischke <h.blischke@acm.org>
Date2014-01-07 20:40 +0100
Message-ID<bj33ghFrkuqU1@mid.individual.net>
In reply to#1770
luser- -droog wrote:

> I've been playing with the Hershey font data, using the description at:
> http://paulbourke.net/dataformats/hershey/
> but not the files from there.
> All of the .jhf (John(Hunt)'s Hershey Font (Format)) use 12345 as the
> declared character code. Apparently the glyphs in these files are
> arranged positionally to match the printable ascii range, 33-126.
> 
> I got my data file somewhere else (not finding it right now), but it
> appears to be the "older" single-file version, where the declared codes
> have semantic meaning as described in the old Hershey report (not finding
> that either, but if I found a pdf (and I did), it's out there somewhere).
> It appears to be the format Bourke is talking about, too. Char #8 matches
> his example.
> 
> So, this program will read the Hershey font data into a dictionary,
> keyed by the "Occidental" character code.
> 
> That's all I've got for now.
> 
> %!
> /hersheyfile (hershey_occ)(r)file def
> /buf 72 string def
> /charcodes 1 dict def
> 
> /strcat { % a b  .  a+b
>     2 copy length exch length add string % a b new
>     dup 4 3 roll 2 copy 0 exch putinterval % b new' new' a
>     length 4 3 roll putinterval % new''
> } def
> 
> /processline {
>     dup length 0 gt { % non-blank line
>         dup length 5 gt {
>             dup 4 get % line line[4]
>             dup 48 ge
>             exch 57 le  % line '0'<=line[4]<='9'
>             and
>             { % new glyph
>                 dup 1 4 getinterval cvi  % line idx
>                 dup /lastcode exch def
>                 exch 5 1 index length 5 sub getinterval % idx line
>                 charcodes 3 1 roll put
>             }{
>                 charcodes lastcode get exch strcat % append to previous
>                 line charcodes exch lastcode exch put
>             } ifelse
>         }{
>             charcodes lastcode get exch strcat
>             charcodes exch lastcode exch put
>         } ifelse
>     }{ % blank line
>         pop
>     } ifelse
> } def
> 
> {
>     hersheyfile buf readline {
>         processline
>     }{
>         processline
>         exit
>     } ifelse
> } loop
> 
> 
> I just realized there's a better way to
> detect multi-line glyphs. Here I use a heuristic I came up with by
> examining the data. The first column is blank followed by a 4-digit
> character code on a new line. Continuation lines use the first column,
> so anything not starting with space is a continuation. BUT ' R' is a
> valid data point, and it starts with a space, so NOT ALL lines
> beginning with space are in fact new characters. BUT all data points
> will be upper-case characters, biased around ascii 'R'.
> 
> So the heuristic is: a new glyph line must be at least 5 characters
> (longer, really, but at least 5) and contain a digit in position 4
> (0-based). Anything else is a continuation, or nothing if it's a
> totally blank line.
> 
> A better way would be to check count field and read until the glyph
> is complete. This avoids all use of "heuristic", but may actually be
> more complicated to implement. :/
> 
> ...to be continued...

Another source of information:
http://ghostscript.com/doc/current/Hershey.htm

Helge

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


#1773

Fromluser- -droog <mijoryx@yahoo.com>
Date2014-01-07 22:04 -0800
Message-ID<8ab36c0b-af30-4b51-80b7-b84640c0307a@googlegroups.com>
In reply to#1772
On Tuesday, January 7, 2014 1:40:00 PM UTC-6, Helge Blischke wrote:
> luser- -droog wrote:
> 
> > I've been playing with the Hershey font data, using the description at:
> > http://paulbourke.net/dataformats/hershey/
> > but not the files from there.
> 
> > All of the .jhf (John(Hunt)'s Hershey Font (Format)) use 12345 as the

Correction: The man's name is James Hurt.

> > declared character code. Apparently the glyphs in these files are
> > arranged positionally to match the printable ascii range, 33-126.
> > 
> > I got my data file somewhere else (not finding it right now), but it
> > appears to be the "older" single-file version, where the declared codes
> > have semantic meaning as described in the old Hershey report (not finding
> > that either, but if I found a pdf (and I did), it's out there somewhere).
> > It appears to be the format Bourke is talking about, too. Char #8 matches
> > his example.
> > 
> 
> 
> Another source of information:
> 
> http://ghostscript.com/doc/current/Hershey.htm
> 

Excellent. That gave me the search terms to find this,
the original shar distribution:

http://cd.textfiles.com/sourcecode/usenet/compsrcs/unix/volume04/hershey/

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


#1774

Fromluser- -droog <mijoryx@yahoo.com>
Date2014-01-07 23:42 -0800
Message-ID<c6ebd952-71e0-4362-8d99-639b5afc6410@googlegroups.com>
In reply to#1773
Tracked down some original A.V. Hershey documents.


Hershey, A. V., FORTRAN IV Programming for Cartography and Typography
www.dtic.mil/cgi-bin/GetTRDoc?AD=AD0703220

Calligraphy for Computers is identified elsewhere with
a similar accession number: AD0662398, but it's not
available from www.dtic.mil.

Cartography and typography with true BASIC
Hershey, Allen V. 
https://calhoun.nps.edu/public/handle/10945/24386


Advanced computer typography
Hershey, A. V. 
http://calhoun.nps.edu/public/handle/10945/29691
http://www16.us.archive.org/stream/advancedcomputer00hers/advancedcomputer00hers_djvu.txt

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


#1775

Fromluser- -droog <mijoryx@yahoo.com>
Date2014-01-07 23:53 -0800
Message-ID<06ab550f-486e-4664-b5fd-72c8e289ee0b@googlegroups.com>
In reply to#1774
On Wednesday, January 8, 2014 1:42:07 AM UTC-6, luser- -droog wrote:
> Tracked down some original A.V. Hershey documents.
> 
> 
> 
> 
> 
> Hershey, A. V., FORTRAN IV Programming for Cartography and Typography
> 
> www.dtic.mil/cgi-bin/GetTRDoc?AD=AD0703220
> 
> 
> 
> Calligraphy for Computers is identified elsewhere with
> 
> a similar accession number: AD0662398, but it's not
> 
> available from www.dtic.mil.
> 
> 
> 
> Cartography and typography with true BASIC
> 
> Hershey, Allen V. 
> 
> https://calhoun.nps.edu/public/handle/10945/24386
> 
> 
> 
> 
> 
> Advanced computer typography
> 
> Hershey, A. V. 
> 
> http://calhoun.nps.edu/public/handle/10945/29691
> 
> http://www16.us.archive.org/stream/advancedcomputer00hers/advancedcomputer00hers_djvu.txt

One more. This page says not to bookmark it.
http://onlinebooks.library.upenn.edu/webbin/book/lookupid?key=ha006865721
and no pdf without credentials. :( but this is the thing!
The big nbs report.

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


#1861

Fromscruss@gmail.com
Date2014-04-19 08:47 -0700
Message-ID<09348540-2970-479a-8998-0151473f4d26@googlegroups.com>
In reply to#1775
On Wednesday, 8 January 2014 02:53:38 UTC-5, luser- -droog  wrote:
> 
> One more. This page says not to bookmark it.
> 
> http://onlinebooks.library.upenn.edu/webbin/book/lookupid?key=ha006865721
> and no pdf without credentials. :( but this is the thing!
> The big nbs report.

I got a bit hacked-off that an organization could keep a PD document locked away behind a single page viewer, and apply strict bandwidth limits to its access. So here it is, compiled as one document:

http://scruss.com/blog/2014/04/19/a-contribution-to-computer-typesetting-techniques-tables-of-coordinates-for-hersheys-repertory-of-occidental-type-fonts-and-graphic-symbols/

It's quite large (43M). The JPEG2000 scans should be intact inside, should anyone care to extract them.

 Stewart

73 de VA3PID / 
SC-3,19,-3,14;SP1;PU4,4;PD;AA6,4,270;AA6,8,-270;PU18,8;PD;AA16,8,180;
PA14,4;AA16,4,180;PU13,8;SP2;PD;AA12,8,180;AA10,8,180;PA11,4,13,8;PU;
http://scruss.com/

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


#1862

Fromtlvp <mPiOsUcB.EtLlLvEp@att.net>
Date2014-04-20 01:12 -0400
Message-ID<1gy73j21n2pox.1nogrik0zo721$.dlg@40tude.net>
In reply to#1861
On Sat, 19 Apr 2014 08:47:58 -0700 (PDT), scruss@gmail.com wrote:

> here it is, compiled as one document:
> 
> http://scruss.com/blog/2014/04/19/a-contribution-to-computer-typesetting-techniques-tables-of-coordinates-for-hersheys-repertory-of-occidental-type-fonts-and-graphic-symbols/
> 
> It's quite large (43M).

Lovely Easter present, Stewart: Thank you! Cheers, -- tlvp
-- 
Avant de repondre, jeter la poubelle, SVP.

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


#1863

Fromscruss@gmail.com
Date2014-04-22 17:29 -0700
Message-ID<09cf928e-fba6-42d7-925c-c546742f2b4c@googlegroups.com>
In reply to#1862
On Sunday, 20 April 2014 01:12:44 UTC-4, tlvp  wrote:
> 
> Lovely Easter present, Stewart: Thank you! Cheers, -- tlvp

You are very welcome. I can't quite get accurate OCR out of it, but at least you can see the glyphs now as they were meant to be seen. I'm engaged in the pleasantly futile task of plotting these letters on a 1980s HP-7470A desktop plotter.

Incidentally, this purports to be a Hershey-Unicode translation table:
http://sourceforge.net/p/plplot/code/HEAD/tree/trunk/fonts/plhershey-unicode.csv

Haven't tried it, but it looks plausible

 Stewart

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


#1864

Fromtlvp <mPiOsUcB.EtLlLvEp@att.net>
Date2014-04-22 21:42 -0400
Message-ID<1vt14aqozl1hv$.4g8nrgg1prm7.dlg@40tude.net>
In reply to#1863
On Tue, 22 Apr 2014 17:29:46 -0700 (PDT), scruss@gmail.com wrote:

> Incidentally, this purports to be a Hershey-Unicode translation table:
> http://sourceforge.net/p/plplot/code/HEAD/tree/trunk/fonts/plhershey-unicode.csv

Curious, that. Thanks for it, as well. Cheers, -- tlvp

-- 
Avant de repondre, jeter la poubelle, SVP.

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


#1868

Fromscruss@gmail.com
Date2014-04-29 14:56 -0700
Message-ID<2cd8bf89-643c-44e7-a037-e69274c7871a@googlegroups.com>
In reply to#1774
On Wednesday, 8 January 2014 02:42:07 UTC-5, luser- -droog  wrote:
> Tracked down some original A.V. Hershey documents.
> ...
> Calligraphy for Computers is identified elsewhere with
> a similar accession number: AD0662398, but it's not
> available from www.dtic.mil.

I have this. It's not as interesting as you might hope, as it appears to be a planning document for the glyphs. It does contain some interesting historical information about old output devices, though.

You might be able to snag a free copy through a 10-day trial subscription to the NTRL: http://www.ntis.gov/products/ntrl.aspx

I don't think the original data file is available any more, though. The usenet distro from 1986 lives here: http://cd.textfiles.com/sourcecode/usenet/compsrcs/unix/volume04/hershey/

 Stewart

[toc] | [prev] | [standalone]


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


csiph-web