瀏覽代碼

PDF水印生成字体修改

yeshihao 1 年之前
父節點
當前提交
6358a290a8

+ 5 - 5
dyu/application/common/service/watermark/pdf/Pdf.php

@@ -118,18 +118,18 @@ class Pdf
 		// 初始化 FPDI
 		$pdf = new Fpdi();
 
-//		$fontRegular = WEB_PATH . "static/common/fonts/msyh.ttf";
-//		$pdf->AddFont('msyh', '', $fontRegular, true);    // 常规
+		$fontRegular = __DIR__."/fonts/msyh.php";
+		$pdf->AddFont('msyh', '', $fontRegular);    // 常规
 //
 //// 设置默认字体
-//		$pdf->SetFont('msyh', '', 40);  // 使用常规字体
+		$pdf->SetFont('msyh', '', 30);  // 使用常规字体
 
 // 确保 PHP 文件编码为 UTF-8(无 BOM)
 //		$pdf->setHeaderData('', 0, '', '', [0, 0, 0], [255, 255, 255]);
 //		$pdf->setDocInfo('Creator', 'Your App', 'Title', 'Subject', 'Keywords', 'UTF-8');
 
-		$pdf->SetFont('cid0cs', '', 30); // 使用内置中文字体
-		$pdf->setLanguageArray(['a_meta_charset' => 'UTF-8']);
+//		$pdf->SetFont('cid0cs', '', 30); // 使用内置中文字体
+//		$pdf->setLanguageArray(['a_meta_charset' => 'UTF-8']);
 
 		// 加载已有 PDF
 		$pageCount = $pdf->setSourceFile($filePath);

二進制
dyu/application/common/service/watermark/pdf/fonts/msyh.ctg.z


File diff suppressed because it is too large
+ 13 - 0
dyu/application/common/service/watermark/pdf/fonts/msyh.php


二進制
dyu/application/common/service/watermark/pdf/fonts/msyh.z


Some files were not shown because too many files changed in this diff