如何在FPDF中设置字体路径

I'm getting the following error:

include(/gravity/school/pdf/font/helveticab.php): failed to open stream: No such file or directory in C:\xamp\htdocs\gravity\school\pdf\fpdf.php on line 1144

Can anyone tell me how to set the fontpath?

You can place font file anywhere in your project folder, the best way to place font file is fpdf/fonts, Where fpdf is your library folder which you are using to generate PDFs. Then after set the fonts as below:

define('FPDF_FONTPATH','/Path/to/font');
require('fpdf.php');

// Arial bold 14
$pdf->SetFont('Arial','B',14);

You can refer official doc for more information: SetFont FPDF