Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Using Ligatures In PostScript
I run an event for which I have to make nametags, and invoices, and
certificates, and so on.  The guy who used to run it made these things
by getting the data and putting it into a spreadsheet and then saving
it as a CSV file which he imported into a word processor and lots of
other stuff.

I've been converting it to be more automatic.  I've got a Perl
program which grabs the names out of the database, directly creates
a PostScript file, and then sends that to the printer.  One click
on the admin web site, and you're done.  I've also gotten the
invoices to work the same.

But the certificates have always used fancier lettering, which fonts
aren't on the printer.  I've gotten the PostScript fonts we need, and
I've discovered that "cat font.ps foo.ps | lpr" does roughly the right
thing -- but it doesn't do the ligatures or follow any kerning rules.
"t1testpage" shows that the ligatures are there, but the PostScript I'm
generating doesn't use them.  (I don't now how to find out if any
kerning rules are included in the PS file, but the AFM file doesn't
list any kerning data at all.)

Is there some way to tell PostScript "don't use an 'f' and an 'l',
instead use character fl"?  t1testpage says it's character 257, which
would be fine if I knew some way to tell it use to character 257.

Since I'm rewriting in Perl anyway, sticking a replace for "fl" to
"PostScript Incantation For fl ligature" is likely to be pretty
painless.  But what is that incantation?

Thanks for any help.


Darren Provine ! kilroy@elvis.rowan.edu ! http://www.rowan.edu/~kilroy
"I use not only all the brains I have, but all those I can borrow as
well." -- Woodrow Wilson

Report this thread to moderator Post Follow-up to this message
Old Post
Dr Nancy's Sweetie
03-27-08 12:42 AM


Re: Using Ligatures In PostScript
On Mar 26, 7:58 pm, Dr Nancy's Sweetie <kil...@elvis.rowan.edu> wrote:
> I run an event for which I have to make nametags, and invoices, and
> certificates, and so on.  The guy who used to run it made these things
> by getting the data and putting it into a spreadsheet and then saving
> it as a CSV file which he imported into a word processor and lots of
> other stuff.
>
> I've been converting it to be more automatic.  I've got a Perl
> program which grabs the names out of the database, directly creates
> a PostScript file, and then sends that to the printer.  One click
> on the admin web site, and you're done.  I've also gotten the
> invoices to work the same.
>
> But the certificates have always used fancier lettering, which fonts
> aren't on the printer.  I've gotten the PostScript fonts we need, and
> I've discovered that "cat font.ps foo.ps | lpr" does roughly the right
> thing -- but it doesn't do the ligatures or follow any kerning rules.
> "t1testpage" shows that the ligatures are there, but the PostScript I'm
> generating doesn't use them.  (I don't now how to find out if any
> kerning rules are included in the PS file, but the AFM file doesn't
> list any kerning data at all.)
>
> Is there some way to tell PostScript "don't use an 'f' and an 'l',
> instead use character fl"?  t1testpage says it's character 257, which
> would be fine if I knew some way to tell it use to character 257.
>
> Since I'm rewriting in Perl anyway, sticking a replace for "fl" to
> "PostScript Incantation For fl ligature" is likely to be pretty
> painless.  But what is that incantation?

In addition to being "character 257", the glyph has a glyph name.
Something like \fl, maybe.



Report this thread to moderator Post Follow-up to this message
Old Post
Ross Presser
03-27-08 03:52 AM


Re: Using Ligatures In PostScript
> directly creates a PostScript file,
If that means that you're using something equivalent to hand-coded
PostScript, then you can code it to use some ligatures. (I have
routines that might help.) But if the Perl is calling some black-box
script to make the PS, then you will have to change the input to that.
Does it accept Unicode text? If yes, put the ligatures into the text.

Report this thread to moderator Post Follow-up to this message
Old Post
jdaw1
03-27-08 03:52 AM


Re: Using Ligatures In PostScript
Dr Nancy's Sweetie <kilroy@elvis.rowan.edu> wrote:

> (I don't now how to find out if any
>kerning rules are included in the PS file, but the AFM file doesn't
>list any kerning data at all.)
>
>Is there some way to tell PostScript "don't use an 'f' and an 'l',
>instead use character fl"?

PostScript has no automatic kerning and no automatic substitution of
ligatures. Since text is often set in chunks which start at known X
offsets, this could lead to gaps or overlaps, even if it was possible.

Kerning and ligature substutitution has to be done by the application
that generates the PostScript. This is especially critical where there
is text flow, since both of these could affect the line breaking
decisions.
----------------------------------------
Aandi Inston
Please support usenet! Post replies and follow-ups, don't e-mail them.


Report this thread to moderator Post Follow-up to this message
Old Post
Aandi Inston
03-27-08 10:12 AM


Re: Using Ligatures In PostScript
Dr Nancy's Sweetie wrote:
>
> Since I'm rewriting in Perl anyway, sticking a replace for "fl" to
> "PostScript Incantation For fl ligature" is likely to be pretty
> painless.  But what is that incantation?
>

Assuming Your Perl program is generating all the postscript and that
your font uses the same glyph names my LaserJet's Helvetica font uses, I
would ...

Instead of
(blah aflame blah) show
Use
(blah a) show
\fl glyphshow
(ame blah) show

Or change the font encoding vector so that the fl ligature has a
code-point less than 256. I'd maybe replace one of the more obscure
Latin-1 characters like thorn or eth. Of course, the generated
postscript would look weird in a text editor but that probably wouldn't
matter.
(blah ažame blah) show

--
RGB

Report this thread to moderator Post Follow-up to this message
Old Post
RedGrittyBrick
03-27-08 10:12 AM


Re: Using Ligatures In PostScript
On Mar 27, 2:55=A0am, RedGrittyBrick <RedGrittyBr...@SpamWeary.foo>
wrote:
> Dr Nancy's Sweetie wrote:
> 
>
> Assuming Your Perl program is generating all the postscript and that
> your font uses the same glyph names my LaserJet's Helvetica font uses, I
> would ...
>
> Instead of
> =A0 =A0 (blah aflame blah) show
> Use
> =A0 =A0 (blah a) show
> =A0 =A0 \fl glyphshow
> =A0 =A0 (ame blah) show
>
> Or change the font encoding vector so that the fl ligature has a
> code-point less than 256. I'd maybe replace one of the more obscure
> Latin-1 characters like thorn or eth. Of course, the generated
> postscript would look weird in a text editor but that probably wouldn't
> matter.
> =A0 =A0 (blah a=FEame blah) show
>
> --
> RGB

Or you can do it with an octal preceeded by a backslash:

(A \257ight of fancy) show

-David W.

Report this thread to moderator Post Follow-up to this message
Old Post
deedubman@gmail.com
03-29-08 12:22 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

PostScript archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 01:32 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.