pdf_set_font

(PHP 3 >= 3.0.6, PHP 4, PECL)

pdf_set_font -- Deprecated: Selects a font face and size

Description

This function is deprecated, use pdf_findfont() plus pdf_setfont() instead.


add a note add a note User Contributed Notes
smutny at nexus dot sk
15-Mar-2002 01:08
Encoding - how does it works:

i had a problem to use ISO8859-2(windows-1250 or Latin-2) - All Slavic Languages(Slovak, Czech, Polish, Slovenian etc...). Solution is:

PDF_set_parameter($pdf,"resourcefile","blabla/your project folder/lib/pdflib.upr");
//see PDFlib manual
pdf_set_font($pdf, "ArialBI", 14, "cp1250");
//ArialBI is Arial CE Bold Italic font.U have to left this font in pdflib.upr's folder
//cp1250 is name for code page 1250 cp1250.cpg
pdf_show_xy($pdf, "it works", 210,807);
//now it shold works, but!!!
//U have to install your CE fonts to your system and delete font files from:
//Program Files/Adobe/Acrobat 4.0/Resource/Font
//Why??
//if Adobe reader open pdf file, it search for:
// 1. embeded fonts
// 2. Adobe Reader self fonts!!!
// 3. system fonts
// more U can find here:
http://www.pdfzone.com/resources/tips/tip0045.html
leea at digitus dot com dot au
31-Jan-2001 11:28
Here is a link to a program which will convert your ttf fonts to afm format
http://www.freshmeat.net/projects/ttf2pt1/
shan at symbiotic dot 2y dot net
21-Dec-2000 06:21
For those who are looking
the PDF core fonts Are

Courier,Courier-Bold,Courier-Oblique,Courier-BoldOblique,
Helvetica,Helvetica-Bold,Helvetica-Oblique,Helvetica-BoldOblique,
Times-Roman,Times-Bold,Times-Italic,Times-BoldItalic,
Symbol,ZapfDingbats
afsilva at netscape dot net
07-Nov-2000 03:04
To anyone who is trying to add extra FONTS to work with PHP and pdflib.

Take a look at: ftp://ftp.adobe.com/pub/adobe/type/win/all/afmfiles/ - This is collection of fonts already converted to AFM. There are thousands of fonts. What I am doing is downloading everything, and then I will grep my way through the directories to find what I am looking for.

Another tip: to get the pdflib.upr file working with your fonts add:
putenv("PDFLIBRESOURCE=/dir/where/the/file/is/fonts/pdflib.upr");
on the beginning of your php script. And make sure you change the Font Definition entry on your pdflib.upr file as well. It needs to point to the directory where the .afm files are.
cox at idecnet dot com
31-Mar-2000 08:24
There is also another encoding called 'host'. in the pdflib test examples, they say:
" We don't want to use metrics files for the sample, and therefore stick to host encoding. For this reason the sample text (which uses German special characters) must be platform-specific. Both flavors only differ in the special characters."
dberry at boomshanka dot ab dot ca
02-Mar-2000 10:41
The actual structure for libpdf2.0 should be:

void pdf_set_font(int pdf document, string font name, double size, <i>string</i> encoding, int embed);

...where <i>encoding</i> is the string "builtin", "pdfdoc", "macroman", "macexpert" or "winansi" -- NOT the integer.