Name
doc:LoadType1Font -- load a Type1 font
Synopsis
font = doc:LoadType1Font(afmfilename, pfmfilename)
Function
doc:LoadType1Font() loads a Type1 font from an external file and registers it in the document object.

When doc:LoadType1Font() succeeds, it returns the name of a font. Otherwise, it returns Nil and the error handler is called.

Inputs
afmfilename
path to an AFM file
pfmfilename
path to a PFA/PFB file
Results
font
name of the font as a string
Errors
#HPDF_INVALID_DOCUMENT - An invalid document handle was set.

#HPDF_FAILED_TO_ALLOC_MEM - Memory allocation failed.

#HPDF_FONT_EXISTS - The font of the same name has already been registered.

#HPDF_INVALID_AFM_HEADER - Cannot recognize AFM file.

#HPDF_INVALID_CHAR_MATRICS_DATA - Cannot recognize AFM file.

#HPDF_INVALID_N_DATA - Cannot recognize AFM file.

#HPDF_UNSUPPORTED_TYPE1_FONT - Cannot recognize PFA/PFB file.


Show TOC