FPDF - 添加 google 网络字体
FPDF - Adding a google webfont
我正在使用 FPDF 生成带有 PHP 的 pdf,我想使用与我的网站 Lato 相同的字体。但是在我的网站上,我使用 google webfont link :
所以我没有这些文件,我想知道是否有办法在我的 pdf 中使用这种字体?
谢谢
你可以做的是下载字体并将其安装到你的系统中,并定义字体路径,
define('FPDF_FONTPATH','/home/www/font');
然后相应地设置字体 - doc link
// Times regular 12
$pdf->SetFont('Times');
// Arial bold 14
$pdf->SetFont('Arial','B',14);
// Removes bold
$pdf->SetFont('');
// Times bold, italic and underlined 14
$pdf->SetFont('Times','BIU');
FPDF 只接受 .ttf, .otf or .pfb
文件类型。
快速谷歌搜索将为您找到 Lato 字体的 links,
也许您还需要检查此 link (Link)
我正在使用 FPDF 生成带有 PHP 的 pdf,我想使用与我的网站 Lato 相同的字体。但是在我的网站上,我使用 google webfont link :
所以我没有这些文件,我想知道是否有办法在我的 pdf 中使用这种字体?
谢谢
你可以做的是下载字体并将其安装到你的系统中,并定义字体路径,
define('FPDF_FONTPATH','/home/www/font');
然后相应地设置字体 - doc link
// Times regular 12
$pdf->SetFont('Times');
// Arial bold 14
$pdf->SetFont('Arial','B',14);
// Removes bold
$pdf->SetFont('');
// Times bold, italic and underlined 14
$pdf->SetFont('Times','BIU');
FPDF 只接受 .ttf, .otf or .pfb
文件类型。
快速谷歌搜索将为您找到 Lato 字体的 links,
也许您还需要检查此 link (Link)