Code Comments
Programming Forum and web based access to our favorite programming groups.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
Post Follow-up to this messageOn 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.
Post Follow-up to this message> 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.
Post Follow-up to this messageDr 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.
Post Follow-up to this messageDr 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
Post Follow-up to this messageOn 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.
Post Follow-up to this message
Show a Printable Version
Email This Page to Someone!
Receive updates to this thread
Powered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.