Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add useSubstitutions-conf for CJK #509

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions action.php
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,10 @@ protected function generatePDF($cachefile, $event)
$mpdf->showWatermarkText = true;
}

if ($this->getExportConfig('useSubstitutions')) {
$mpdf->useSubstitutions = true;
}

// load the template
$template = $this->loadTemplate();

Expand Down Expand Up @@ -1030,6 +1034,8 @@ protected function loadExportConfig()
$this->exportConfig['template'] = $tpl;

$this->exportConfig['isDebug'] = $conf['allowdebug'] && $INPUT->has('debughtml');

$this->exportConfig['useSubstitutions'] = $this->getConf('useSubstitutions');
}

/**
Expand Down Expand Up @@ -1095,6 +1101,7 @@ public function addsvgbutton(Event $event)
}

array_splice($event->data['items'], -1, 0, [new MenuItem()]);
//array_splice($event->data['items'], -1, 0, [new MenuItemNS()]);
}

/**
Expand Down
1 change: 1 addition & 0 deletions conf/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@
$conf['usestyles'] = 'wrap,';
$conf['qrcodescale'] = '1';
$conf['showexportbutton'] = 1;
$conf['useSubstitutions'] = 0;
1 change: 1 addition & 0 deletions conf/metadata.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@
$meta['usestyles'] = array('string');
$meta['qrcodescale'] = array('string', '_pattern' => '/^(|\d+(\.\d+)?)$/');
$meta['showexportbutton'] = array('onoff');
$meta['useSubstitutions'] = array('onoff');
1 change: 1 addition & 0 deletions lang/en/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@
$lang['usestyles'] = 'You can give a comma separated list of plugins of which the <code>style.css</code> or <code>screen.css</code> should be used for PDF generation. By default only <code>print.css</code> and <code>pdf.css</code> are used.';
$lang['qrcodescale'] = 'Size scaling of the embedded QR code. Empty or <code>0</code> to disable.';
$lang['showexportbutton'] = 'Show PDF export button (only when supported by your template)';
$lang['useSubstitutions'] = 'Substitute missing characters in UTF-8(multibyte) documents - from other fonts';
1 change: 1 addition & 0 deletions lang/zh/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,4 @@
$lang['usecache'] = '开启 PDF 文件缓存?内嵌的图片将不会受 ACL 权限限制。如果你担心安全问题,请将其禁用。';
$lang['usestyles'] = 'PDF 生成过程中的 <code>style.css</code> 或者 <code>screen.css</code> ,以英文逗号,分割。默认只有<code>print.css</code> 和 <code>pdf.css</code> 被使用。';
$lang['showexportbutton'] = '显示导出 PDF 按钮。(只有在模版支持并在白名单里的时候才能使用)';
$lang['useSubstitutions'] = '从其他字体寻找并使用UTF-8(多字节)文档中丢失的字符';