PHP.nl

ps_findfont

ps_findfont

Loads a font

int **ps_findfont** resource $psdoc string $fontname string $encoding bool $embed

Loads a font for later use. Before text is output with a loaded font it must be set with . This function needs the adobe font metric file in order to calculate the space used up by the characters. A font which is loaded within a page will only be available on that page. Fonts which are to be used in the complete document have to be loaded before the first call of . Calling between pages will make that font available for all following pages. ps_setfont``ps_begin_page``ps_findfont

The name of the afm file must be . If the font shall be embedded the file containing the font outline must be present as well. fontname``.afm``fontname``.pfb

Calling before the first page requires to output the postscript header which includes the BoundingBox for the whole document. Usually the BoundingBox is set with the first call of which now comes after . Consequently the BoundingBox has not been set and a warning will be issued when is called. In order to prevent this situation, one should call to set the BoundingBox before is called. ps_findfont``ps_begin_page``ps_findfont``ps_findfont``ps_set_parameter``ps_findfont

psdoc Resource identifier of the postscript file as returned by . ps_new

fontnameThe name of the font.

encoding will try to load the file passed in the parameter . Encoding files are of the same syntax as those used by . They contain a font encoding vector (which is currently not used but must be present) and a list of extra ligatures to extend the list of ligatures derived from the afm file. ps_findfont``encoding

    can be null or the empty string if
   the default encoding (TeXBase1) shall be used.
  `encoding`


   If the encoding is set to  then there
   will be no reencoding and the font specific encoding will be used. This
   is very useful with symbol fonts.
  `builtin`

embedIf set to a value >0 the font will be embedded into the document. This requires the font outline (.pfb file) to be present.

Returns the identifier of the font or zero in case of an error. The identifier is a positive number.

ps_begin_page``ps_setfont