You are here: Re: Postcript library and fonts. « PHP Programming Language « IT news, forums, messages
Re: Postcript library and fonts.

Posted by The Natural Philosopher on 10/18/07 09:32

Erwin Moller wrote:
> The Natural Philosopher wrote:
>> Ok..am about to embark on making PHP generate basic formatted reports
>> to a postscript printer attached to the server.
>>
>> After many struggles I have the postscript extensions installed and
>> have been reading the documentation to at least eliminate the most
>> basic stupid questions ;-)
>>
>> One stupid question remains: How do I select a (printer) embedded font?
>>
>> it seems that in order to specify a font it has to be found on the
>> server. But what if there are none? and one wants to simply use an
>> embedded one..like times roman or helvetica.? I am keen to sacrifice
>> fancy fonts for slick printing..
>>
>> I am sure there is some basically stupid issue I have failed to grasp
>> here.. be kind to me. It was my birthday yesterday ;-)
>>
>
> Hi,
>
> Congrats on your birthday!
> Hope you don't have a hangover today.
>
> I am not sure what the problem is: Why don't you simply install a nice
> font on the server?
> AFAIK you can use the fonts available at the server.
> If you are looking for free fonts, google for 'free fonts postscript'
> and you'll find a bunch.
> But since I am seriously estitically impaired, I suggest you pick the
> ones you consider slick yourself. ;-)
>
> This might also help:
> http://en.wikipedia.org/wiki/PostScript_fonts
>

Ok. I puzzled through it all..took a long time. But that was mostly
because my test machine had a mishmash of apache1.3/2.0 and php4/5.
Confused the hell out of pecl..eventually found the file to add the ps
extenion to..but..in the meantime..I discovered apache 1.3 wouldn't
restart..upgrading the latest php stuff had screwed something else.

In the end I said rude woads and settled down to make it apache2/php5
and finally got everything upgraded..

No, what I didn't realise is that postcript fonts come in two halves -
the AFM bit which is adobe font metric, and is the font specification,
and PFB which contains the font vectors I suppose.

You need to have the AFM files for any fonts you want to use in the same
directory as the PHP files. You don't need the PFB files unless you are
embedding the font with the document.

I fond the afm files for the two most basic fonts - helvetica and Times
Roman - in the open office suite. his is for printing invoices etc, so
thats enough..

Sometime around midnight I rushed down to the good lady brandishing a
sheet of A4 with 'hello world' printed on it and said 'only took me 4
1/2 hours to do that' ;-)

The file was only 11K long as well. For postcript, that's pretty good.
I've seen a blank sheet of paper take up 16Mbytes before now..

The mac viewer took a look at it and spent a minute turning it into a
1.7k PDF.

I think Macs and postcript are fucking WONDERFUL, don't you? "How to
enforce the most inefficient standard on the printing world"



My wife tells me that 'Fontographer will convert any font to postcript
if you want' and SHE has a couple of thousand littering her Mac..so
plenty more if needed.




> Good luck.
>
> Regards,
> Erwin Moller

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация