AddFont

AddFont(string family [, string style [, string file]])

版本

1.5

內容

匯入一個 TrueType 或 Type1 字型,並且另到這個字型可以運作。必需要先行利用 makefont.php 這個程式來產生一個字型定義檔案。
這個定義檔案 (and the font file itself when embedding) 一定要放在目前使用中的目錄或利用一些指令FPDF_FONTPATH來提供路徑。如果找不這個定義檔,就會出現錯誤訊息 "Could not include font definition file"。

參數

family
字型家族(family): 你可以任意選擇字型名稱。 如果這個字型是一個標準字型家族名稱,將會不理符合的字型。
style
字型風格(style): 預設值為標準。
file
字型定義檔案。
基本上是用字型家族和字型風格作為檔案名稱,而且應該為小寫英文字和沒有空間的。

例子

$pdf->AddFont('Comic','I');

是相當於:

$pdf->AddFont('Comic','I','comici.php');

參見

SetFont().

索引