{"id":16255,"date":"2026-04-01T09:47:05","date_gmt":"2026-04-01T01:47:05","guid":{"rendered":"http:\/\/www.rao-bing.cn\/?p=16255"},"modified":"2026-04-01T10:05:52","modified_gmt":"2026-04-01T02:05:52","slug":"pdf-%e6%8e%92%e7%89%88%e5%ad%97%e4%bd%93%e9%97%ae%e9%a2%98%e6%8e%92%e6%9f%a5%e8%ae%b0%e5%bd%95-%e6%b5%b7%e5%a4%a9%e8%b5%b7%e7%82%b9%e6%8a%a5%e4%bb%b7%e5%8d%95-v1v6-%e5%85%a8%e6%b5%81%e7%a8%8b","status":"publish","type":"post","link":"http:\/\/www.rao-bing.cn\/index.php\/2026\/04\/01\/16255\/","title":{"rendered":"PDF \u6392\u7248\u5b57\u4f53\u95ee\u9898\u6392\u67e5\u8bb0\u5f55 | XXXX\u62a5\u4ef7\u5355 v1~v6 \u5168\u6d41\u7a0b"},"content":{"rendered":"<p><strong>\u4e00\u3001\u9879\u76ee\u6982\u8ff0<\/strong><\/p>\n<p>\u7528\u6237\u8981\u6c42\u751f\u6210\u4e00\u4efd\u5e26XXXX\u516c\u53f8 logo \u7684\u4ea7\u54c1\u62a5\u4ef7\u5355\uff08PDF<br \/>\n\u683c\u5f0f\uff09\uff0c\u8f6f\u4ef6\u4ea7\u54c1\u540d\u79f0\u4e3a\u300cXX\u6570\u636e\u5e93\u4e00\u4f53\u673a\u7ba1\u7406\u7cfb\u7edf\u300d\uff0c\u5355\u4ef7 10<br \/>\n\u4e07\u5143\/\u8282\u70b9\u3002\u5728\u751f\u6210\u8fc7\u7a0b\u4e2d\u9646\u7eed\u9047\u5230\u4e2d\u6587\u5b57\u4f53\u4e71\u7801\u3001\u6570\u5b57\u6d88\u5931\u3001\u5168\u89d2\u62ec\u53f7\u663e\u793a\u65b9\u5757\u3001\u5c01\u9762<br \/>\nlogo \u4e0d\u663e\u793a\u7b49\u95ee\u9898\uff0c\u5386\u7ecf 6 \u4e2a\u7248\u672c\u8fed\u4ee3\u540e\u5168\u90e8\u89e3\u51b3\u3002<\/p>\n<p><strong>\u4e8c\u3001\u7248\u672c\u95ee\u9898\u603b\u89c8<\/strong><\/p>\n<p>\u4e0b\u8868\u5217\u51fa v1~v6 \u5404\u7248\u672c\u7684\u6838\u5fc3\u75c7\u72b6\u548c\u6839\u672c\u539f\u56e0\uff1a<\/p>\n<table>\n<colgroup>\n<col style=\"width: 12%\" \/>\n<col style=\"width: 23%\" \/>\n<col style=\"width: 63%\" \/>\n<\/colgroup>\n<thead>\n<tr class=\"header\">\n<th><strong>\u7248\u672c<\/strong><\/th>\n<th><strong>\u75c7\u72b6<\/strong><\/th>\n<th><strong>\u6839\u672c\u539f\u56e0<\/strong><\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr class=\"odd\">\n<td>v1<\/td>\n<td>\u4e2d\u6587\u4e71\u7801\uff08\u5b57\u4f53\u7f3a\u5931\uff09<\/td>\n<td>ReportLab \u672a\u6ce8\u518c\u4efb\u4f55\u4e2d\u6587\u5b57\u4f53\uff0c\u6240\u6709\u6587\u5b57\u8d70\u5185\u7f6e Helvetica\uff08\u4e0d\u542b CJK<br \/>\n\u5b57\u5f62\uff09<\/td>\n<\/tr>\n<tr class=\"even\">\n<td>v2<\/td>\n<td>\u6807\u9898\u4e71\u7801\uff08\u6b63\u6587\u6b63\u5e38\uff09<\/td>\n<td>\u53ea\u4fee\u590d\u4e86 Helvetica\uff08\u6b63\u6587\uff09\uff0c\u6f0f\u6389\u4e86 Times-Bold\uff08\u6807\u9898\uff09<\/td>\n<\/tr>\n<tr class=\"odd\">\n<td>v3<\/td>\n<td>\u6570\u5b57\u6d88\u5931\uff08\u6b63\u6587\u4e71\u7801\uff09<\/td>\n<td>\u5c06 DroidSansFallback \u8986\u76d6\u6ce8\u518c\u5230 Helvetica \u540d\u5b57\uff0c\u5bfc\u81f4 ASCII<br \/>\n\u6570\u5b57\u5b57\u5f62\u6620\u5c04\u9519\u4e71<\/td>\n<\/tr>\n<tr class=\"even\">\n<td>v4<\/td>\n<td>\u6570\u5b57\u6062\u590d\uff0c\u9875\u7709\u4e2d\u6587 + \u5168\u89d2\u62ec\u53f7\u65b9\u5757<\/td>\n<td>\u5f15\u5165 CJK \u5206\u6bb5\u51fd\u6570\uff0c\u4f46\u8986\u76d6 Helvetica \u5bfc\u81f4\u6570\u5b57\u5931\u6548\uff1b\u5168\u89d2\u6807\u70b9\u672a\u7eb3\u5165 CJK<br \/>\n\u8303\u56f4\uff1b\u9875\u7709\u672a\u8d70\u65b0\u6e32\u67d3\u8def\u5f84<\/td>\n<\/tr>\n<tr class=\"odd\">\n<td>v5<\/td>\n<td>\u5b57\u4f53\u5168\u6b63\u5e38\uff0cLogo \u4e0d\u663e\u793a<\/td>\n<td>\u5c01\u9762 split \u6a21\u677f\u4e0d\u652f\u6301 logo\uff0cPDF_COVER_IMAGE \u73af\u5883\u53d8\u91cf\u672a\u4f20\u5165<br \/>\ncover.py<\/td>\n<\/tr>\n<tr class=\"even\">\n<td>v6<\/td>\n<td>[OK] \u5168\u90e8\u6b63\u5e38<\/td>\n<td>\u5b57\u4f53\u5206\u79bb + CJK \u5206\u6bb5\u51fd\u6570 + _draw_cjk_string + \u73af\u5883\u53d8\u91cf + split logo<br \/>\n\u5168\u90e8\u5230\u4f4d<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><strong>\u4e09\u3001\u6839\u672c\u539f\u56e0\u5206\u6790<\/strong><\/p>\n<table>\n<colgroup>\n<col style=\"width: 29%\" \/>\n<col style=\"width: 70%\" \/>\n<\/colgroup>\n<thead>\n<tr class=\"header\">\n<th><strong>\u95ee\u9898<\/strong><\/th>\n<th><strong>\u8bf4\u660e<\/strong><\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr class=\"odd\">\n<td>DroidSansFallback \u8986\u76d6\u6ce8\u518c Helvetica<\/td>\n<td>\u5c06 TrueType CJK \u5b57\u4f53\u300c\u8986\u76d6\u6ce8\u518c\u300d\u5230 Type 1 \u5185\u7f6e\u5b57\u4f53 Helvetica<br \/>\n\u7684\u540d\u5b57\u4e0b\u3002\u4e24\u8005\u5b57\u5f62\u6620\u5c04\u673a\u5236\u4e0d\u540c\uff08Type 1 \u7528\u6807\u51c6\u5316\u7d22\u5f15\uff0cTrueType \u7528 Unicode<br \/>\ncmap\uff09\uff0c\u5bfc\u81f4 Latin\/ASCII \u6570\u5b57\u901a\u8fc7 Helvetica \u67e5\u627e\u65f6\u5168\u90e8\u5931\u6548<\/td>\n<\/tr>\n<tr class=\"even\">\n<td>CJK \u5b57\u7b26 Unicode \u8303\u56f4\u4e0d\u5b8c\u6574<\/td>\n<td>\u65e9\u671f\u53ea\u68c0\u6d4b U+2E80-U+9FFF\uff08\u6c49\u5b57\uff09\u548c U+F900-U+FAFF\uff08CJK<br \/>\n\u517c\u5bb9\u5b57\u7b26\uff09\uff0c\u6f0f\u6389\u4e86<br \/>\nU+FF00-U+FFEF\uff08\u5168\u89d2\u6807\u70b9\uff09\uff0c\u5bfc\u81f4\u4e2d\u6587\u62ec\u53f7\u300c\u300d\u3001\u3010\u3011\u3001\uff08\uff09\u3001\u5f15\u53f7\u7b49\u5168\u90e8\u6e32\u67d3\u4e3a\u65b9\u5757<\/td>\n<\/tr>\n<tr class=\"odd\">\n<td>\u5c01\u9762 split \u6a21\u677f\u4e0d\u652f\u6301 logo<\/td>\n<td>cover.py \u7684 _pattern_split() \u51fd\u6570 HTML \u4e2d\u6ca1\u6709 &lt;img&gt;<br \/>\n\u6807\u7b7e\uff1bmake.sh \u4f20\u5165 PDF_COVER_IMAGE \u73af\u5883\u53d8\u91cf\u4f46 cover.py \u6ca1\u6709\u8bfb\u53d6<\/td>\n<\/tr>\n<tr class=\"even\">\n<td>DejaVu Sans \u4e0e DroidSansFallback \u6df7\u7528\u5931\u8d25<\/td>\n<td>\u4e24\u4e2a\u5b57\u4f53\u5404\u81ea\u64c5\u957f\u4e0d\u540c\uff1aDroidSansFallback \u4e3b\u653b CJK\uff0cDejaVu Sans \u8d1f\u8d23<br \/>\nLatin\/\u6570\u5b57\u3002\u5fc5\u987b\u5404\u6ce8\u518c\u72ec\u7acb\u540d\u5b57\uff0c\u4e0d\u80fd\u4e92\u76f8\u8986\u76d6<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><strong>\u56db\u3001\u5404\u7248\u672c\u8be6\u7ec6\u6392\u67e5\u8fc7\u7a0b<\/strong><\/p>\n<p><strong>v1 \u2014 \u521d\u59cb\u7248\u672c\uff1a\u4e2d\u6587\u5168\u90e8\u4e71\u7801<\/strong><\/p>\n<p>\u75c7\u72b6\uff1aPDF \u4e2d\u6240\u6709\u4e2d\u6587\u5b57\u7b26\u663e\u793a\u4e3a\u4e71\u7801\u6216\u7a7a\u767d\u65b9\u5757\u3002<\/p>\n<p>\u6839\u672c\u539f\u56e0\uff1a<\/p>\n<ul>\n<li>\n<p>\u7cfb\u7edf\u4e2d\u6709 DroidSansFallbackFull.ttf\uff08\u4e2d\u6587\u5b57\u4f53\uff09\uff0c\u4f46 render_body.py<br \/>\n\u7684 register_fonts() \u4ece\u672a\u6ce8\u518c\u4efb\u4f55\u4e2d\u6587\u5b57\u4f53<\/p>\n<\/li>\n<li>\n<p>\u6b63\u6587\u4f7f\u7528 Helvetica\uff08\u5185\u7f6e Type 1 \u5b57\u4f53\uff09\uff0cHelvetica<br \/>\n\u4e0d\u5305\u542b\u4e2d\u65e5\u97e9\u5b57\u5f62<\/p>\n<\/li>\n<li>\n<p>\u5b57\u4f53\u6ce8\u518c\u51fd\u6570\u53ea\u5904\u7406 font_paths \u4e2d\u7684\u8def\u5f84\uff0c\u6ca1\u6709\u515c\u5e95<br \/>\nfallback<\/p>\n<\/li>\n<\/ul>\n<p>\u5904\u7406\uff1a<\/p>\n<ul>\n<li>\n<p>\u5728 register_fonts() \u4e2d\u52a0\u5165 fallback\uff1a\u68c0\u6d4b<br \/>\nDroidSansFallbackFull.ttf \u5e76\u6ce8\u518c\u5230 Helvetica \u540d\u5b57\u4e0b<\/p>\n<\/li>\n<\/ul>\n<p><strong>v2 \u2014 \u6807\u9898\u4e71\u7801\uff08\u6b63\u6587\u6b63\u5e38\u4e86\uff09<\/strong><\/p>\n<p>\u75c7\u72b6\uff1a\u6b63\u6587\u4e2d\u6587\u6b63\u5e38\u4e86\uff0c\u4f46\u300c\u62a5\u4ef7\u4fe1\u606f\u300d\u300c\u4ea7\u54c1\u62a5\u4ef7\u660e\u7ec6\u300d\u7b49\u6807\u9898\u4ecd\u662f\u4e71\u7801\u3002<\/p>\n<p>\u6839\u672c\u539f\u56e0\uff1a<\/p>\n<ul>\n<li>\n<p>v1 \u7684\u4fee\u590d\u53ea\u8986\u76d6\u4e86 Helvetica\uff08\u6b63\u6587\uff09\uff0c\u6807\u9898\u7528\u7684\u662f<br \/>\nTimes-Bold\uff0c\u4e24\u8005\u72ec\u7acb\u6ce8\u518c<\/p>\n<\/li>\n<li>\n<p>Times-Bold \u4ecd\u7136\u6307\u5411\u5185\u7f6e Type 1 \u5b57\u4f53\uff0c\u65e0 CJK \u652f\u6301<\/p>\n<\/li>\n<\/ul>\n<p>\u5904\u7406\uff1a<\/p>\n<ul>\n<li>\n<p>\u5c06 Times-Bold \u4e5f\u6ce8\u518c\u4e3a DroidSansFallbackFull.ttf\uff08\u4e0e Helvetica<br \/>\n\u76f8\u540c\u7684\u8986\u76d6\u7b56\u7565\uff09<\/p>\n<\/li>\n<\/ul>\n<p><strong>v3 \u2014 \u6570\u5b57\u6d88\u5931<\/strong><\/p>\n<p>\u75c7\u72b6\uff1a\u4e2d\u6587\u548c\u6807\u9898\u90fd\u6b63\u5e38\u4e86\uff0c\u4f46\u6570\u5b57\u300c100,000.00\u300d\u300cHT-2026-0401\u300d\u5168\u90e8\u6d88\u5931\uff08\u7a7a\u767d\uff09\u3002<\/p>\n<p>\u6839\u672c\u539f\u56e0\uff1a<\/p>\n<ul>\n<li>\n<p>DroidSansFallback \u662f TrueType \u5b57\u4f53\uff0cHelvetica \u662f Type 1<br \/>\n\u5b57\u4f53\uff0c\u5b57\u5f62\u6620\u5c04\u673a\u5236\u5b8c\u5168\u4e0d\u540c<\/p>\n<\/li>\n<li>\n<p>\u5c06 TrueType \u8986\u76d6\u6ce8\u518c\u5230 Type 1 \u5185\u7f6e\u5b57\u4f53\u540d\u540e\uff0cReportLab \u4ecd\u6309 Type 1<br \/>\n\u65b9\u5f0f\u67e5\u627e glyph\uff0c\u4f46 DroidSans \u7684 TrueType cmap \u4e0e Type 1 \u7d22\u5f15\u4e0d\u517c\u5bb9\uff0c\u5bfc\u81f4<br \/>\nLatin\/ASCII \u5b57\u7b26\u5168\u90e8\u6e32\u67d3\u5931\u8d25<\/p>\n<\/li>\n<li>\n<p>pdftotext \u80fd\u63d0\u53d6\u51fa\u300cHT-2026-0401\u300d\u548c\u300c100,000\u300d\u8bf4\u660e\u5185\u5bb9\u5b58\u5728\uff0c\u53ea\u662f<br \/>\nPDF \u89c6\u89c9\u6e32\u67d3\u5931\u6548<\/p>\n<\/li>\n<\/ul>\n<p>\u5904\u7406\u65b9\u5411\uff1a<\/p>\n<ul>\n<li>\n<p>\u5c06 DejaVu Sans\uff08\u62c9\u4e01\/\u6570\u5b57\u5b57\u4f53\uff09\u6ce8\u518c\u4e3a<br \/>\nHelvetica\uff0cDroidSansFallback \u6ce8\u518c\u4e3a\u72ec\u7acb\u540d\u5b57<br \/>\nDroidSans\uff0c\u4e24\u8005\u4e0d\u518d\u4e92\u76f8\u8986\u76d6<\/p>\n<\/li>\n<\/ul>\n<p><strong>v4 \u2014 \u6570\u5b57\u6062\u590d\uff0c\u9875\u7709\u4e2d\u6587\u548c\u5168\u89d2\u62ec\u53f7\u4ecd\u6709\u95ee\u9898<\/strong><\/p>\n<p>\u75c7\u72b6\uff1a\u6570\u5b57\u548c\u897f\u6587\u6062\u590d\u6b63\u5e38\uff0c\u4f46\u9875\u7709\/\u9875\u811a\u7684\u4e2d\u6587\u4ecd\u662f\u65b9\u5757\uff1b\u4e2d\u6587\u62ec\u53f7\u300c\u300d\u3001\u3010\u3011\u3001\uff08\uff09\u3001\u5f15\u53f7\u7b49\u663e\u793a\u5f02\u5e38\u3002<\/p>\n<p>\u6839\u672c\u539f\u56e0\uff1a<\/p>\n<ul>\n<li>\n<p>\u5f15\u5165 _cjk_font_split() \u51fd\u6570\uff0c\u6839\u636e Unicode \u8303\u56f4\u5224\u65ad\u5b57\u7b26\u7c7b\u578b\uff0c\u7528<br \/>\n&lt;font name=&#8221;DroidSans&#8221;&gt; \u5305\u88c5 CJK \u5b57\u7b26\uff0c&lt;font<br \/>\nname=&#8221;Helvetica&#8221;&gt; \u5305\u88c5 Latin \u5b57\u7b26\uff08\u5b9e\u9645\u6307\u5411 DejaVu Sans\uff09<\/p>\n<\/li>\n<li>\n<p>CJK \u5b57\u7b26\u68c0\u6d4b\u8303\u56f4\u53ea\u5305\u542b U+2E80-U+9FFF \u548c<br \/>\nU+F900-U+FAFF\uff0c\u6f0f\u6389\u4e86\u5168\u89d2\u6807\u70b9 U+FF00-U+FFEF<\/p>\n<\/li>\n<li>\n<p>\u9875\u7709\/\u9875\u811a\u4f7f\u7528 canv.drawString() \u76f4\u63a5\u6e32\u67d3\uff0c\u5b8c\u5168\u7ed5\u8fc7\u4e86 Paragraph +<br \/>\n_cjk_font_split \u8def\u5f84<\/p>\n<\/li>\n<\/ul>\n<p>\u5904\u7406\uff1a<\/p>\n<ul>\n<li>\n<p>\u6269\u5c55 CJK \u5b57\u7b26\u68c0\u6d4b\u8303\u56f4\uff0c\u52a0\u5165<br \/>\nU+FF00-U+FFEF\uff08\u5168\u89d2\u6807\u70b9\uff1a\u4e2d\u6587\u62ec\u53f7\u3001\u5f15\u53f7\u7b49\uff09<\/p>\n<\/li>\n<li>\n<p>\u65b0\u589e _draw_cjk_string() \u51fd\u6570\uff0c\u5728 Canvas<br \/>\n\u5c42\u9762\u9010\u5b57\u7b26\u5207\u6362\u6b63\u786e\u5b57\u4f53<\/p>\n<\/li>\n<li>\n<p>\u4fee\u6539 _decorate()\uff0c\u9875\u7709\/\u9875\u811a\u6539\u7528 _draw_cjk_string() \u6e32\u67d3<\/p>\n<\/li>\n<\/ul>\n<p><strong>v5 \u2014 Logo \u4e0d\u663e\u793a<\/strong><\/p>\n<p>\u75c7\u72b6\uff1a\u5b57\u4f53\u5168\u90e8\u6b63\u5e38\uff0c\u4f46\u5c01\u9762\u5de6\u4e0a\u89d2\u6ca1\u6709\u663e\u793aXXXX\u7684 logo\u3002<\/p>\n<p>\u6839\u672c\u539f\u56e0\uff1a<\/p>\n<ul>\n<li>\n<p>\u5c01\u9762\u6a21\u677f\u4f7f\u7528\u300csplit\u300d\u7248\u5f0f\uff08proposal \u7c7b\u578b\u7684\u9ed8\u8ba4\u98ce\u683c\uff09\uff0c\u8be5\u6a21\u677f\u6ca1\u6709<br \/>\n&lt;img&gt; \u6807\u7b7e<\/p>\n<\/li>\n<li>\n<p>make.sh \u811a\u672c\u8bbe\u7f6e\u4e86 PDF_COVER_IMAGE \u73af\u5883\u53d8\u91cf\uff0c\u4f46 cover.py \u7684<br \/>\nmain() \u51fd\u6570\u6ca1\u6709\u8bfb\u53d6\u5b83\uff0c\u5bfc\u81f4 logo \u8def\u5f84\u4ece\u672a\u8fdb\u5165 HTML<\/p>\n<\/li>\n<\/ul>\n<p>\u5904\u7406\uff1a<\/p>\n<ul>\n<li>\n<p>\u5728 cover.py main() \u4e2d\u663e\u5f0f\u8bfb\u53d6 PDF_COVER_IMAGE \u73af\u5883\u53d8\u91cf\u5e76\u5199\u5165<br \/>\ntokens[&#8220;cover_image&#8221;]<\/p>\n<\/li>\n<li>\n<p>\u5728 _pattern_split() \u4e2d\u52a0\u5165 logo \u7684 &lt;img&gt;<br \/>\n\u6807\u7b7e\uff0c\u8bbe\u7f6e\u4e3a\u6807\u9898\u4e0a\u65b9\u300160px \u9ad8<\/p>\n<\/li>\n<\/ul>\n<p><strong>v6 \u2014 \u5168\u90e8\u6b63\u5e38 [OK]<\/strong><\/p>\n<p>\u7efc\u5408\u6240\u6709\u4fee\u590d\uff0cPDF \u751f\u6210\u5b8c\u5168\u6b63\u5e38\uff1a<\/p>\n<ul>\n<li>\n<p>\u5c01\u9762\uff1a\u6807\u9898\u3001\u4e0a\u65b9 logo\u3001\u4f5c\u8005\u3001\u65e5\u671f\u5168\u90e8\u6b63\u786e\u6e32\u67d3<\/p>\n<\/li>\n<li>\n<p>\u6b63\u6587\uff1a\u4e2d\u6587\u3001ASCII \u6570\u5b57\u3001\u897f\u6587\u3001\u6807\u70b9\u3001\u5168\u89d2\u62ec\u53f7\u5747\u6b63\u786e<\/p>\n<\/li>\n<li>\n<p>\u9875\u7709\/\u9875\u811a\uff1a\u4e2d\u6587\u548c\u6570\u5b57\u5747\u6b63\u786e<\/p>\n<\/li>\n<li>\n<p>\u5b57\u4f53\uff1aLatin \u7528 DejaVu Sans\uff08\u6ce8\u518c\u4e3a Helvetica\uff09\uff0cCJK \u7528<br \/>\nDroidSansFallback\uff08\u6ce8\u518c\u4e3a\u72ec\u7acb\u540d DroidSans\uff09\uff0c\u4e92\u4e0d\u5e72\u6270<\/p>\n<\/li>\n<\/ul>\n<p><strong>\u4e94\u3001\u6700\u7ec8\u4fee\u590d\u65b9\u6848\u6c47\u603b<\/strong><\/p>\n<table>\n<colgroup>\n<col style=\"width: 29%\" \/>\n<col style=\"width: 70%\" \/>\n<\/colgroup>\n<thead>\n<tr class=\"header\">\n<th><strong>\u4fee\u590d\u9879<\/strong><\/th>\n<th><strong>\u5177\u4f53\u505a\u6cd5<\/strong><\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr class=\"odd\">\n<td>\u5b57\u4f53\u5206\u79bb\u6ce8\u518c<\/td>\n<td>DejaVu Sans \u6ce8\u518c\u4e3a Helvetica\uff08Latin\/\u6570\u5b57\uff09 DroidSansFallback<br \/>\n\u6ce8\u518c\u4e3a\u72ec\u7acb\u540d\u5b57 DroidSans\uff08\u4e0d\u8986\u76d6\u4efb\u4f55\u5185\u7f6e\u540d\uff09<\/td>\n<\/tr>\n<tr class=\"even\">\n<td>_cjk_font_split() \u51fd\u6570\uff08\u65b0\u589e\uff09<\/td>\n<td>\u81ea\u52a8\u68c0\u6d4b\u5b57\u7b26\u4e32\u4e2d CJK<br \/>\n\u5b57\u7b26\uff08U+2E80-U+9FFF\u3001U+F900-U+FAFF\u3001U+FF00-U+FFEF\uff09\uff0c\u4e3a\u6bcf\u6bb5\u5206\u914d\u6b63\u786e\u5b57\u4f53\u6807\u7b7e<\/td>\n<\/tr>\n<tr class=\"odd\">\n<td>_draw_cjk_string() \u51fd\u6570\uff08\u65b0\u589e\uff09<\/td>\n<td>\u4e3a\u9875\u7709\/\u9875\u811a Canvas<br \/>\n\u76f4\u63a5\u6e32\u67d3\u5b9e\u73b0\u5b57\u4f53\u5207\u6362\uff0c\u9010\u5b57\u7b26\u5224\u65ad\u7c7b\u578b\u5e76\u8c03\u7528\u6b63\u786e\u5b57\u4f53\u7684 drawString<\/td>\n<\/tr>\n<tr class=\"even\">\n<td>CJK \u5b57\u7b26\u8303\u56f4\u6269\u5c55<\/td>\n<td>\u589e\u52a0 U+FF00-U+FFEF \u5168\u89d2\u6807\u70b9\u8303\u56f4\uff0c\u8986\u76d6\u4e2d\u6587\u62ec\u53f7\u3001\u5f15\u53f7\u7b49\u5e38\u89c1\u6807\u70b9<\/td>\n<\/tr>\n<tr class=\"odd\">\n<td>cover.py logo \u652f\u6301\uff08\u65b0\u589e\uff09<\/td>\n<td>main() \u8bfb\u53d6 PDF_COVER_IMAGE \u73af\u5883\u53d8\u91cf\u5199\u5165 tokens\uff1b_pattern_split()<br \/>\n\u8f93\u51fa &lt;img&gt; \u6807\u7b7e<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><strong>\u516d\u3001\u6d89\u53ca\u4fee\u6539\u7684\u6587\u4ef6<\/strong><\/p>\n<table>\n<colgroup>\n<col style=\"width: 29%\" \/>\n<col style=\"width: 70%\" \/>\n<\/colgroup>\n<thead>\n<tr class=\"header\">\n<th><strong>\u6587\u4ef6<\/strong><\/th>\n<th><strong>\u4fee\u6539\u5185\u5bb9<\/strong><\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr class=\"odd\">\n<td>render_body.py<\/td>\n<td>register_fonts() \u2014 \u5b57\u4f53\u5206\u79bb\u6ce8\u518c\u7b56\u7565\uff08DejaVu\/DroidSans \u4e0d\u4e92\u76f8\u8986\u76d6\uff09<br \/>\n_cjk_font_split() \u2014 \u65b0\u589e CJK \u5206\u6bb5\u51fd\u6570\uff08Unicode \u8303\u56f4\u542b\u5168\u89d2\u6807\u70b9\uff09<br \/>\n_draw_cjk_string() \u2014 \u65b0\u589e Canvas \u5b57\u4f53\u5207\u6362\u6e32\u67d3\u51fd\u6570 _decorate() \u2014<br \/>\n\u9875\u7709\/\u9875\u811a\u6539\u7528 _draw_cjk_string()<br \/>\n\u6240\u6709\u6587\u5b57\u6e32\u67d3\u70b9\uff08Paragraph\u3001Table\u3001Callout \u7b49\uff09\u2014 \u63a5\u5165<br \/>\n_cjk_font_split()<\/td>\n<\/tr>\n<tr class=\"even\">\n<td>cover.py<\/td>\n<td>import os \u2014 \u65b0\u589e\u7cfb\u7edf\u5e93\u5bfc\u5165 main() \u2014 \u8bfb\u53d6 PDF_COVER_IMAGE<br \/>\n\u73af\u5883\u53d8\u91cf\uff0c\u5199\u5165 tokens[&#8220;cover_image&#8221;] _pattern_split() \u2014 HTML \u6a21\u677f\u52a0\u5165<br \/>\nlogo &lt;img&gt; \u6807\u7b7e<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><strong>\u4e03\u3001\u6280\u672f\u8981\u70b9\u603b\u7ed3<\/strong><\/p>\n<p><strong>1. ReportLab \u5b57\u4f53\u6ce8\u518c\u673a\u5236<\/strong><\/p>\n<p>ReportLab \u652f\u6301 TrueType\uff08TTFont\uff09\u548c Type 1\uff08CIDFont\uff09\u4e24\u79cd\u5b57\u4f53\u3002TTFont<br \/>\n\u53ef\u4ee5\u6ce8\u518c\u5230\u4efb\u610f\u540d\u5b57\u4e0b\u8986\u76d6\u5185\u7f6e\u5b57\u4f53\uff0c\u4f46 CIDFont \u53ea\u80fd\u901a\u8fc7 UnicodeCIDFont<br \/>\n\u65b9\u5f0f\u4f7f\u7528\u3002\u5f53\u540c\u4e00\u4e2a\u540d\u5b57\u88ab\u591a\u6b21\u6ce8\u518c\u65f6\uff0c\u4ee5\u6700\u540e\u4e00\u6b21\u6ce8\u518c\u4e3a\u51c6\u3002STSong-Light\u3001MSung-Light\u3001HeiseiMin-W3<br \/>\n\u7b49CJK\u5b57\u4f53\u5747\u4e3a CIDFont\uff0cReportLab<br \/>\n\u5185\u7f6e\u4e86\u5b83\u4eec\u7684\u5bbd\u5ea6\u8868\u4f46\u9700\u8981\u5b57\u4f53\u6587\u4ef6\u652f\u6301\u3002<\/p>\n<p><strong>2. \u4e3a\u4ec0\u4e48\u4e0d\u80fd\u300c\u8986\u76d6 Helvetica\u300d\u6ce8\u518c CJK<\/strong><\/p>\n<p>Helvetica \u662f ReportLab \u5185\u7f6e\u7684 Type 1 \u5b57\u4f53\uff0cLatin\/ASCII \u5b57\u7b26\u7684 glyph<br \/>\n\u7d22\u5f15\u662f\u56fa\u5b9a\u7684\u3002\u7528 TrueType\uff08DroidSansFallback\uff09\u8986\u76d6\u540e\uff0cReportLab \u4ecd\u6309<br \/>\nType 1 \u65b9\u5f0f\u67e5\u627e glyph\uff0c\u4f46 TrueType cmap \u8868\u683c\u5f0f\u4e0e Type 1 \u5b8c\u5168\u4e0d\u540c\uff0c\u5bfc\u81f4<br \/>\nLatin \u5b57\u7b26\u5168\u90e8\u5931\u6548\u3002\u89e3\u51b3\u65b9\u6848\uff1a\u4e24\u4e2a\u5b57\u4f53\u5404\u6ce8\u518c\u72ec\u7acb\u540d\u5b57\uff0c\u4e92\u4e0d\u8986\u76d6\u3002<\/p>\n<p><strong>3. CJK Unicode \u8303\u56f4\u53c2\u8003<\/strong><\/p>\n<table>\n<colgroup>\n<col style=\"width: 25%\" \/>\n<col style=\"width: 74%\" \/>\n<\/colgroup>\n<thead>\n<tr class=\"header\">\n<th><strong>\u8303\u56f4<\/strong><\/th>\n<th><strong>\u5185\u5bb9<\/strong><\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr class=\"odd\">\n<td>U+2E80 &#8211; U+9FFF<\/td>\n<td>CJK \u7edf\u4e00\u6c49\u5b57\uff08\u5e38\u7528\u6c49\u5b57\u7ea6 2 \u4e07\u5b57\uff09<\/td>\n<\/tr>\n<tr class=\"even\">\n<td>U+F900 &#8211; U+FAFF<\/td>\n<td>CJK \u517c\u5bb9\u5b57\u7b26\uff08\u517c\u5bb9\u6c49\u5b57\u3001\u8868\u610f\u6587\u5b57\u63cf\u8ff0\u5b57\u7b26\u7b49\uff09<\/td>\n<\/tr>\n<tr class=\"odd\">\n<td>U+FE30 &#8211; U+FE4F<\/td>\n<td>CJK \u6807\u70b9\u517c\u5bb9\uff08\u7ad6\u6392\u6807\u70b9\u7b49\uff09<\/td>\n<\/tr>\n<tr class=\"even\">\n<td>U+FF00 &#8211; U+FFEF<\/td>\n<td>\u5168\u89d2\u6807\u70b9\uff1a\u4e2d\u6587\u62ec\u53f7\u300c\u300d\uff08\uff09\u3010\u3011\u3001\u300a\u300b\uff08\uff09\u548c\u5168\u89d2 ASCII \u6807\u70b9<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><strong>4. Playwright \u5c01\u9762\u6e32\u67d3 logo \u7f3a\u5931\u7684\u6839\u56e0<\/strong><\/p>\n<p>\u5c01\u9762\u901a\u8fc7 Playwright\uff08Chromium \u65e0\u5934\u6d4f\u89c8\u5668\uff09\u5c06 HTML \u6e32\u67d3\u4e3a<br \/>\nPDF\u3002cover.py \u8bfb\u53d6 tokens[&#8220;cover_image&#8221;] \u6765\u51b3\u5b9a\u662f\u5426\u5728 HTML \u4e2d\u8f93\u51fa<br \/>\n&lt;img&gt; \u6807\u7b7e\u3002make.sh \u6ce8\u5165\u7684\u662f\u73af\u5883\u53d8\u91cf PDF_COVER_IMAGE\uff0c\u4f46 cover.py<br \/>\n\u7684 main() \u51fd\u6570\u4ece\u672a\u8bfb\u53d6\u8be5\u73af\u5883\u53d8\u91cf\uff0c\u5bfc\u81f4 logo \u8def\u5f84\u4ece\u672a\u8fdb\u5165 HTML<br \/>\n\u6a21\u677f\uff0cPlaywright \u6e32\u67d3 PDF \u65f6\u81ea\u7136\u627e\u4e0d\u5230\u56fe\u7247\u3002\u4fee\u590d\u65b9\u5f0f\u662f\u5728 main()<br \/>\n\u4e2d\u663e\u5f0f\u8bfb\u53d6\u5e76\u5199\u5165 tokens\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e00\u3001\u9879\u76ee\u6982\u8ff0 \u7528\u6237\u8981\u6c42\u751f\u6210\u4e00\u4efd\u5e26XXXX\u516c\u53f8 logo \u7684\u4ea7\u54c1\u62a5\u4ef7\u5355\uff08PDF \u683c\u5f0f\uff09\uff0c\u8f6f\u4ef6\u4ea7\u54c1\u540d\u79f0\u4e3a\u300cXX\u6570\u636e\u5e93\u4e00\u4f53\u673a\u7ba1\u7406\u7cfb\u7edf\u300d\uff0c\u5355\u4ef7 10 \u4e07\u5143\/\u8282\u70b9\u3002\u5728\u751f\u6210&#8230;<\/p>\n<p class=\"read-more\"><a class=\"btn btn-default\" href=\"http:\/\/www.rao-bing.cn\/index.php\/2026\/04\/01\/16255\/\"> Read More<span class=\"screen-reader-text\">  Read More<\/span><\/a><\/p>\n","protected":false},"author":3,"featured_media":16259,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"aside","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[1],"tags":[],"class_list":["post-16255","post","type-post","status-publish","format-aside","has-post-thumbnail","hentry","category-uncategorized","post_format-post-format-aside"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"http:\/\/www.rao-bing.cn\/wp-content\/uploads\/2026\/04\/image.png","jetpack_shortlink":"https:\/\/wp.me\/p8gSFq-4eb","jetpack_likes_enabled":true,"jetpack-related-posts":[{"id":305,"url":"http:\/\/www.rao-bing.cn\/index.php\/2017\/01\/19\/305\/","url_meta":{"origin":16255,"position":0},"title":"Zabbix\u57fa\u672c\u914d\u7f6e\u53ca\u76d1\u63a7\u4e3b\u673a","author":"raobing","date":"2017-01-19","format":"aside","excerpt":"\u76d1\u63a7\u4e3b\u673a\u4e00\u7248\u9700\u8981\u5728\u88ab\u76d1\u63a7\u7684\u4e3b\u673a\u4e0a\u5b89\u88c5Zabbix Agent \u76d1\u63a7\u4e3b\u673a \u5b89\u88c5zabbix-agent\u2026","rel":"","context":"\u5728\u201cTools\u201d\u4e2d","block_context":{"text":"Tools","link":"http:\/\/www.rao-bing.cn\/index.php\/category\/tools\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.rao-bing.cn\/wp-content\/uploads\/2017\/01\/011917_0223_Zabbix5.png?resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.rao-bing.cn\/wp-content\/uploads\/2017\/01\/011917_0223_Zabbix5.png?resize=350%2C200 1x, https:\/\/i0.wp.com\/www.rao-bing.cn\/wp-content\/uploads\/2017\/01\/011917_0223_Zabbix5.png?resize=525%2C300 1.5x, https:\/\/i0.wp.com\/www.rao-bing.cn\/wp-content\/uploads\/2017\/01\/011917_0223_Zabbix5.png?resize=700%2C400 2x, https:\/\/i0.wp.com\/www.rao-bing.cn\/wp-content\/uploads\/2017\/01\/011917_0223_Zabbix5.png?resize=1050%2C600 3x"},"classes":[]},{"id":16246,"url":"http:\/\/www.rao-bing.cn\/index.php\/2026\/03\/29\/16246\/","url_meta":{"origin":16255,"position":1},"title":"Apache Doris \u7248\u672c\u5347\u7ea7\u6307\u5357 | \u4ece 2.0.1.1 \u5230 2.1.11","author":"\u9976, \u51b0","date":"2026-03-29","format":"aside","excerpt":"\u672c\u6587\u6863\u8be6\u7ec6\u4ecb\u7ecd Apache Doris \u4ece 2.0.1.1 \u5347\u7ea7\u5230 2.1.11 \u7684\u5b8c\u6574\u64cd\u4f5c\u6d41\u7a0b\uff0c\u2026","rel":"","context":"\u7c7b\u4f3c\u6587\u7ae0","block_context":{"text":"\u7c7b\u4f3c\u6587\u7ae0","link":""},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":480,"url":"http:\/\/www.rao-bing.cn\/index.php\/2017\/01\/22\/480\/","url_meta":{"origin":16255,"position":2},"title":"\u901a\u8fc7RDS\u5907\u4efd\uff1aOracle Secure Backup\u7b80\u4ecb","author":"raobing","date":"2017-01-22","format":"aside","excerpt":"\u00a0 \u80cc\u666f \u6700\u65e9\u542c\u8bf4\u8fd9\u4e2a\u540d\u5b57\u662f\u5728\u51e0\u5e74\u524d\u5b9e\u65bd\u7b2c\u4e00\u53f0EXADATA\u7684\u65f6\u5019\uff0c\u5f53\u65f6\u53ea\u662f\u5728\u6295\u6807\u6587\u4ef6\u91cc\u8ba4\u2026","rel":"","context":"\u5728\u201cOracle\u201d\u4e2d","block_context":{"text":"Oracle","link":"http:\/\/www.rao-bing.cn\/index.php\/category\/oracle\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.rao-bing.cn\/wp-content\/uploads\/2017\/01\/Oracle-Security-Backup.jpg?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":205,"url":"http:\/\/www.rao-bing.cn\/index.php\/2017\/01\/07\/205\/","url_meta":{"origin":16255,"position":3},"title":"\u5229\u7528Oracle RUEI+EM12c\u8fdb\u884c\u5e94\u7528\u7684\u201c\u7aef\u5230\u7aef\u201d\u6027\u80fd\u8bca\u65ad","author":"raobing","date":"2017-01-07","format":false,"excerpt":"\u6982\u8ff0 \u6211\u4eec\u77e5\u9053\uff0c\u5f71\u54cd\u4e00\u4e2aB\/S\u5e94\u7528\u6027\u80fd\u7684\u56e0\u7d20\uff0c\u7c97\u7565\u5730\u8bf4\uff0c\u6709\u4ee5\u4e0b\u51e0\u4e2a\u5927\u7684\u73af\u8282\uff1a \u5ba2\u6237\u7aef\u73af\u8282 \u7f51\u7edc\u73af\u8282\uff08\u2026","rel":"","context":"\u5728\u201cOracle\u201d\u4e2d","block_context":{"text":"Oracle","link":"http:\/\/www.rao-bing.cn\/index.php\/category\/oracle\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.rao-bing.cn\/wp-content\/uploads\/2017\/01\/010717_1555_OracleRUEIE1.png?resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.rao-bing.cn\/wp-content\/uploads\/2017\/01\/010717_1555_OracleRUEIE1.png?resize=350%2C200 1x, https:\/\/i0.wp.com\/www.rao-bing.cn\/wp-content\/uploads\/2017\/01\/010717_1555_OracleRUEIE1.png?resize=525%2C300 1.5x"},"classes":[]},{"id":174,"url":"http:\/\/www.rao-bing.cn\/index.php\/2017\/01\/07\/174\/","url_meta":{"origin":16255,"position":4},"title":"\u4f7f\u7528Oracle\u5b98\u65b9\u5de1\u68c0\u5de5\u5177ORAchk\u5de1\u68c0\u6570\u636e\u5e93","author":"raobing","date":"2017-01-07","format":false,"excerpt":"ORAchk\u6982\u8ff0 ORAchk\u662fOracle\u5b98\u65b9\u51fa\u54c1\u7684Oracle\u4ea7\u54c1\u5065\u5eb7\u68c0\u67e5\u5de5\u5177\uff0c\u53ef\u4ee5\u4eceMOS\uff08M\u2026","rel":"","context":"\u5728\u201cOracle\u201d\u4e2d","block_context":{"text":"Oracle","link":"http:\/\/www.rao-bing.cn\/index.php\/category\/oracle\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.rao-bing.cn\/wp-content\/uploads\/2017\/01\/010717_1313_OracleO14.png?resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.rao-bing.cn\/wp-content\/uploads\/2017\/01\/010717_1313_OracleO14.png?resize=350%2C200 1x, https:\/\/i0.wp.com\/www.rao-bing.cn\/wp-content\/uploads\/2017\/01\/010717_1313_OracleO14.png?resize=525%2C300 1.5x, https:\/\/i0.wp.com\/www.rao-bing.cn\/wp-content\/uploads\/2017\/01\/010717_1313_OracleO14.png?resize=700%2C400 2x, https:\/\/i0.wp.com\/www.rao-bing.cn\/wp-content\/uploads\/2017\/01\/010717_1313_OracleO14.png?resize=1050%2C600 3x"},"classes":[]},{"id":732,"url":"http:\/\/www.rao-bing.cn\/index.php\/2017\/05\/26\/732\/","url_meta":{"origin":16255,"position":5},"title":"\u5728SUSE Linux Enterprise Server 11\u4e0a\u4f7f\u7528inbox OFED","author":"raobing","date":"2017-05-26","format":"aside","excerpt":"\u6211\u4eec\u4f7f\u7528\u7684\u89e3\u51b3\u65b9\u6848\u4e3b\u8981\u662f\u7528Mellanox\u7684Infiniband HCA\uff0c\u4e00\u822c\u4e5f\u90fd\u662f\u7528Mellano\u2026","rel":"","context":"\u7c7b\u4f3c\u6587\u7ae0","block_context":{"text":"\u7c7b\u4f3c\u6587\u7ae0","link":""},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.rao-bing.cn\/wp-content\/uploads\/2017\/05\/clip_image003_thumb.png?resize=350%2C200","width":350,"height":200},"classes":[]}],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"http:\/\/www.rao-bing.cn\/index.php\/wp-json\/wp\/v2\/posts\/16255","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.rao-bing.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.rao-bing.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.rao-bing.cn\/index.php\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"http:\/\/www.rao-bing.cn\/index.php\/wp-json\/wp\/v2\/comments?post=16255"}],"version-history":[{"count":3,"href":"http:\/\/www.rao-bing.cn\/index.php\/wp-json\/wp\/v2\/posts\/16255\/revisions"}],"predecessor-version":[{"id":16258,"href":"http:\/\/www.rao-bing.cn\/index.php\/wp-json\/wp\/v2\/posts\/16255\/revisions\/16258"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/www.rao-bing.cn\/index.php\/wp-json\/wp\/v2\/media\/16259"}],"wp:attachment":[{"href":"http:\/\/www.rao-bing.cn\/index.php\/wp-json\/wp\/v2\/media?parent=16255"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.rao-bing.cn\/index.php\/wp-json\/wp\/v2\/categories?post=16255"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.rao-bing.cn\/index.php\/wp-json\/wp\/v2\/tags?post=16255"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}