【发布时间】:2022-03-30 19:25:12
【问题描述】:
我正在使用 PuppeteerSharp,它通过使用以下 WebFonts 部署到 Azure Linux Functions。我不能保证打印出所有不同语言字符的 PDF 输出。
$font-family: Arial-Unicode-MS,myanmar3,Noto-Sans-Khmer;
@font-face{
font-family:"Arial-Unicode-MS";
font-style: normal;
font-weight: 400;
font-display: swap;
src:url('fonts/Arial-Unicode-MS.woff2') format("woff2");
}
@font-face{
font-family:"myanmar3";
font-style: normal;
font-weight: 400;
font-display: auto;
src:url('fonts/myanmar3.woff2') format("woff2");
}
@font-face {
font-family: 'Noto-Sans-Khmer';
font-style: normal;
font-weight: 400;
font-display: auto;
src: url('fonts/noto-sans-khmer-v9-khmer-regular.woff2') format('woff2');
}
但是,打印出来的 PDF 有不同的输出:
案例 1:大多数情况下打印的 PDF 仅包含拉丁字符:
案例 2:缺少高棉字符:
案例3:打印所有语言字符:
【问题讨论】:
-
如果您从 html 打印到 pdf,应该没问题,但是在这里打印高棉文本的解决方案是什么?
-
嗨@Osify,我的解决方案是使用带有客户映像的 Azure Linux 功能(在 docker 映像中安装字体)。