Code Duplication    Length = 5-5 lines in 2 locations

src/Intraface/LegacyCpdf.php 2 locations

@@ 2639-2643 (lines=5) @@
2636
            if (isset($this->fonts[$cf]) && $this->fonts[$cf]['isUnicode']) {
2637
                $text = $this->utf8toUtf16BE($text, $bom); // convert utf8 chars into utf16
2638
                // store all used characters if subset font is set to true
2639
                if ($this->fonts[$cf]['isSubset']) {
2640
                    for ($i = 0; $i < mb_strlen($text, 'UTF-16BE'); $i++) {
2641
                        $this->fonts[$cf]['subset'][mb_substr($text, $i, 1, 'UTF-16BE')] = true;
2642
                    }
2643
                }
2644
            } else {
2645
                $text = mb_convert_encoding($text, $this->targetEncoding);
2646
                $hexStr = $this->strToHex($text);
@@ 2648-2652 (lines=5) @@
2645
                $text = mb_convert_encoding($text, $this->targetEncoding);
2646
                $hexStr = $this->strToHex($text);
2647
                // store all used characters if subset font is set to true
2648
                if ($this->fonts[$cf]['isSubset']) {
2649
                    for ($i = 0; $i < (strlen($hexStr) / 2); $i++) {
2650
                        array_push($this->fonts[$cf]['subset'], substr($hexStr, ($i * 2), 2));
2651
                    }
2652
                }
2653
            }
2654
        }
2655
        $text = strtr($text, array(')' => '\\)', '(' => '\\(', '\\' => '\\\\', chr(8) => '\\b', chr(9) => '\\t', chr(10) => '\\n', chr(12) => '\\f' ,chr(13) => '\\r'));