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

Fix Undefined array key occurs in Text #2077

Open
wants to merge 2 commits into
base: development
Choose a base branch
from
Open
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
5 changes: 5 additions & 0 deletions src/Config/FontVariables.php
Original file line number Diff line number Diff line change
@@ -286,6 +286,11 @@ public function __construct()
"unbatang" => [/* Korean */
'R' => "UnBatang_0613.ttf",
],
"gb" => [ /* Chinese */
'R' => 'gb.ttf',
'B' => 'gb.ttf',
'I' => 'gb.ttf'
]
],

// Add fonts to this array if they contain characters in the SIP or SMP Unicode planes
2 changes: 1 addition & 1 deletion src/Mpdf.php
Original file line number Diff line number Diff line change
@@ -4400,7 +4400,7 @@ function Text($x, $y, $txt, $OTLdata = [], $textvar = 0, $aixextra = '', $coords
// Just output text
elseif (!$this->usingCoreFont && !($textvar & TextVars::FC_SMALLCAPS) && !($textvar & TextVars::FC_KERNING) && !(isset($this->CurrentFont['useOTL']) && ($this->CurrentFont['useOTL'] & 0xFF) && !empty($OTLdata['GPOSinfo']))) {
// IF SIP/SMP
if ($this->CurrentFont['sip'] || $this->CurrentFont['smp']) {
if ((isset($this->CurrentFont['sip']) && $this->CurrentFont['sip']) || (isset($this->CurrentFont['smp']) && $this->CurrentFont['smp'])) {
$txt2 = $this->UTF8toSubset($txt2);
$s .=sprintf('BT ' . $aix . ' %s Tj ET', $px, $py, $txt2);
} // NOT SIP/SMP
Binary file added ttfonts/gb.ttf
Binary file not shown.