★ wanayoo — archive 1999 http://www.php.net/manual/function.pdf-set-font.phpNouvelle recherche | Portail wanayoo

PHP Home Page

Manual Table of Contents
Up to PDF
Quick Reference
German version of this pageJapanese version of this pageItalian version of this pageFrench version of this pageHungarian version of this page
PDF
* PDF_get_info
* PDF_set_info
* PDF_open
* PDF_close
* PDF_begin_page
* PDF_end_page
* PDF_show
* PDF_show_boxed
* PDF_show_xy
* PDF_set_font
* PDF_set_leading
* PDF_set_parameter
* PDF_get_parameter
* PDF_set_value
* PDF_get_value
* PDF_set_text_rendering
* PDF_set_horiz_scaling
* PDF_set_text_rise
* PDF_set_text_matrix
* PDF_set_text_pos
* PDF_set_char_spacing
* PDF_set_word_spacing
* PDF_skew
* PDF_continue_text
* PDF_stringwidth
* PDF_save
* PDF_restore
* PDF_translate
* PDF_scale
* PDF_rotate
* PDF_setflat
* PDF_setlinejoin
* PDF_setlinecap
* PDF_setmiterlimit
* PDF_setlinewidth
* PDF_setdash
* PDF_moveto
* PDF_curveto
* PDF_lineto
* PDF_circle
* PDF_arc
* PDF_rect
* PDF_closepath
* PDF_stroke
* PDF_closepath_stroke
* PDF_fill
* PDF_fill_stroke
* PDF_closepath_fill_stroke
* PDF_endpath
* PDF_clip
* PDF_setgray_fill
* PDF_setgray_stroke
* PDF_setgray
* PDF_setrgbcolor_fill
* PDF_setrgbcolor_stroke
* PDF_setrgbcolor
* PDF_add_outline
* PDF_set_transition
* PDF_set_duration
* PDF_open_gif
* PDF_open_png
* PDF_open_memory_image
* PDF_open_jpeg
* PDF_close_image
* PDF_place_image
* PDF_put_image
* PDF_execute_image
* pdf_add_annotation
* PDF_set_border_style
* PDF_set_border_color
* PDF_set_border_dash
Manual: PDF_set_font
View the source code for this pageSearch the site



Previous page
 PDF_show_xy
 Updated
Sat, 12 Aug 2000
PDF_set_leading 
Next page


PDF_set_font

(unknown)

PDF_set_font -- Selects a font face and size

Description

void pdf_set_font (int pdf document, string font name, double size, string encoding [, int embed])

The PDF_set_font() function sets the current font face, font size and encoding. If you use pdflib 0.6 you will need to provide the Adobe Font Metrics (afm-files) for the font in the font path (default is ./fonts). If you use php3 or a version of pdflib older than 2.20 the fourth parameter encoding can take the following values: 0 = builtin, 1 = pdfdoc, 2 = macroman, 3 = macexpert, 4 = winansi. An encoding greater than 4 and less than 0 will default to winansi. winansi is often a good choice. If you use php4 and a version of pdflib >= 2.20 the encoding parameter has changed to a string. Use 'winansi', 'builtin', 'host', 'macroman' etc. instead. If the last parameter is set to 1 the font is embedded into the pdf document otherwise it is not. To embed a font is usually a good idea if the font is not widely spread and you cannot ensure that the person watching your document has access on fonts in the document. I font is only embedded once even if you call PDF_set_font() several times.

Note: This function has to be called after PDF_begin_page() in order to create a valid pdf document.

Note: If you reference a font in a .upr file make sure the name in the afm file and the font name are the same. Otherwise, the font will be embedded several times (Thanks to Paul Haddon for finding this.)


User Contributed Notes: PDF_set_font


dberry@boomshanka.ab.ca
01-Mar-2000 06: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.



cox@idecnet.com
30-Mar-2000 04: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."



 About Notes


Previous page
 PDF_show_xy
 Updated
Sat, 12 Aug 2000
PDF_set_leading 
Next page





Who's responsible for this?
Top of this page

Site
Hosting:



Located in
United States
Elements of this website are subject to copyright.
Questions about installing or using PHP should be directed to one of the mailing lists.
Only questions about the website should be directed to webmaster@php.net.