+ | This file and the 14 PostScript(R) AFM files it accompanies may be used, copied, and distributed for any purpose and without charge, with or without modification, provided that all copyright notices are retained; that the AFM files are not distributed without this file; that all modifications to this file or any of the AFM files are prominently noted in the modified file(s); and that this paragraph is not modified. Adobe Systems has no responsibility or obligation to support the use of the AFM files. Col | +
Source http://www.adobe.com/devnet/font/#pcfi
+ + \ No newline at end of file diff --git a/lib/dompdf/lib/html5lib/Data.php b/lib/dompdf/lib/html5lib/Data.php new file mode 100644 index 0000000..497345f --- /dev/null +++ b/lib/dompdf/lib/html5lib/Data.php @@ -0,0 +1,114 @@ + 0xFFFD, // REPLACEMENT CHARACTER + 0x0D => 0x000A, // LINE FEED (LF) + 0x80 => 0x20AC, // EURO SIGN ('€') + 0x81 => 0x0081, //*/ + $this->ignore_lf_token = 2; + + $this->original_mode = $this->mode; + $this->flag_frameset_ok = false; + $this->mode = self::IN_CDATA_RCDATA; + + /* Switch the tokeniser's content model flag to the + RCDATA state. */ + $this->content_model = HTML5_Tokenizer::RCDATA; + break; + + /* A start tag token whose tag name is "xmp" */ + case 'xmp': + /* If the stack of open elements has a p element in + scope, then act as if an end tag with the tag name + "p" has been seen. */ + if ($this->elementInScope('p')) { + $this->emitToken(array( + 'name' => 'p', + 'type' => HTML5_Tokenizer::ENDTAG + )); + } + + /* Reconstruct the active formatting elements, if any. */ + $this->reconstructActiveFormattingElements(); + + $this->flag_frameset_ok = false; + + $this->insertCDATAElement($token); + break; + + case 'iframe': + $this->flag_frameset_ok = false; + $this->insertCDATAElement($token); + break; + + case 'noembed': case 'noscript': + // XSCRIPT: should check scripting flag + $this->insertCDATAElement($token); + break; + + /* A start tag whose tag name is "select" */ + case 'select': + /* Reconstruct the active formatting elements, if any. */ + $this->reconstructActiveFormattingElements(); + + /* Insert an HTML element for the token. */ + $this->insertElement($token); + + $this->flag_frameset_ok = false; + + /* If the insertion mode is one of in table", "in caption", + * "in column group", "in table body", "in row", or "in + * cell", then switch the insertion mode to "in select in + * table". Otherwise, switch the insertion mode to "in + * select". */ + if ( + $this->mode === self::IN_TABLE || $this->mode === self::IN_CAPTION || + $this->mode === self::IN_COLUMN_GROUP || $this->mode ==+self::IN_TABLE_BODY || + $this->mode === self::IN_ROW || $this->mode === self::IN_CELL + ) { + $this->mode = self::IN_SELECT_IN_TABLE; + } else { + $this->mode = self::IN_SELECT; + } + break; + + case 'option': case 'optgroup': + if ($this->elementInScope('option')) { + $this->emitToken(array( + 'name' => 'option', + 'type' => HTML5_Tokenizer::ENDTAG, + )); + } + $this->reconstructActiveFormattingElements(); + $this->insertElement($token); + break; + + case 'rp': case 'rt': + /* If the stack of open elements has a ruby element in scope, then generate + * implied end tags. If the current node is not then a ruby element, this is + * a parse error; pop all the nodes from the current node up to the node + * immediately before the bottommost ruby element on the stack of open elements. + */ + if ($this->elementInScope('ruby')) { + $this->generateImpliedEndTags(); + } + $peek = false; + do { + /*if ($peek) { + // parse error + }*/ + $peek = array_pop($this->stack); + } while ($peek->tagName !== 'ruby'); + $this->stack[] = $peek; // we popped one too many + $this->insertElement($token); + break; + + // spec diversion + + case 'math': + $this->reconstructActiveFormattingElements(); + $token = $this->adjustMathMLAttributes($token); + $token = $this->adjustForeignAttributes($token); + $this->insertForeignElement($token, self::NS_MATHML); + if (isset($token['self-closing'])) { + // XERROR: acknowledge the token's self-closing flag + array_pop($this->stack); + } + if ($this->mode !== self::IN_FOREIGN_CONTENT) { + $this->secondary_mode = $this->mode; + $this->mode = self::IN_FOREIGN_CONTENT; + } + break; + + case 'svg': + $this->reconstructActiveFormattingElements(); + $token = $this->adjustSVGAttributes($token); + $token = $this->adjustForeignAttributes($token); + $this->insertForeignElement($token, self::NS_SVG); + if (isset($token['self-closing'])) { + // XERROR: acknowledge the token's self-closing flag + array_pop($this->stack); + } + if ($this->mode !== self::IN_FOREIGN_CONTENT) { + $this->secondary_mode = $this->mode; + $this->mode = self::IN_FOREIGN_CONTENT; + } + break; + + case 'caption': case 'col': case 'colgroup': case 'frame': case 'head': + case 'tbody': case 'td': case 'tfoot': case 'th': case 'thead': case 'tr': + // parse error + break; + + /* A start tag token not covered by the previous entries */ + default: + /* Reconstruct the active formatting elements, if any. */ + $this->reconstructActiveFormattingElements(); + + $this->insertElement($token); + /* This element will be a phrasing element. */ + break; + } + break; + + case HTML5_Tokenizer::ENDTAG: + switch ($token['name']) { + /* An end tag with the tag name "body" */ + case 'body': + /* If the stack of open elements does not have a body + * element in scope, this is a parse error; ignore the + * token. */ + if (!$this->elementInScope('body')) { + $this->ignored = true; + + /* Otherwise, if there is a node in the stack of open + * elements that is not either a dc element, a dd element, + * a ds element, a dt element, an li element, an optgroup + * element, an option element, a p element, an rp element, + * an rt element, a tbody element, a td element, a tfoot + * element, a th element, a thead element, a tr element, + * the body element, or the html element, then this is a + * parse error. + */ + } else { + // XERROR: implement this check for parse error + } + + /* Change the insertion mode to "after body". */ + $this->mode = self::AFTER_BODY; + break; + + /* An end tag with the tag name "html" */ + case 'html': + /* Act as if an end tag with tag name "body" had been seen, + then, if that token wasn't ignored, reprocess the current + token. */ + $this->emitToken(array( + 'name' => 'body', + 'type' => HTML5_Tokenizer::ENDTAG + )); + + if (!$this->ignored) { + $this->emitToken($token); + } + break; + + case 'address': case 'article': case 'aside': case 'blockquote': + case 'center': case 'datagrid': case 'details': case 'dir': + case 'div': case 'dl': case 'fieldset': case 'footer': + case 'header': case 'hgroup': case 'listing': case 'menu': + case 'nav': case 'ol': case 'pre': case 'section': case 'ul': + /* If the stack of open elements has an element in scope + with the same tag name as that of the token, then generate + implied end tags. */ + if ($this->elementInScope($token['name'])) { + $this->generateImpliedEndTags(); + + /* Now, if the current node is not an element with + the same tag name as that of the token, then this + is a parse error. */ + // XERROR: implement parse error logic + + /* If the stack of open elements has an element in + scope with the same tag name as that of the token, + then pop elements from this stack until an element + with that tag name has been popped from the stack. */ + do { + $node = array_pop($this->stack); + } while ($node->tagName !== $token['name']); + } else { + // parse error + } + break; + + /* An end tag whose tag name is "form" */ + case 'form': + /* Let node be the element that the form element pointer is set to. */ + $node = $this->form_pointer; + /* Set the form element pointer to null. */ + $this->form_pointer = null; + /* If node is null or the stack of open elements does not + * have node in scope, then this is a parse error; ignore the token. */ + if ($node === null || !in_array($node, $this->stack)) { + // parse error + $this->ignored = true; + } else { + /* 1. Generate implied end tags. */ + $this->generateImpliedEndTags(); + /* 2. If the current node is not node, then this is a parse error. */ + if (end($this->stack) !== $node) { + // parse error + } + /* 3. Remove node from the stack of open elements. */ + array_splice($this->stack, array_search($node, $this->stack, true), 1); + } + + break; + + /* An end tag whose tag name is "p" */ + case 'p': + /* If the stack of open elements has a p element in scope, + then generate implied end tags, except for p elements. */ + if ($this->elementInScope('p')) { + /* Generate implied end tags, except for elements with + * the same tag name as the token. */ + $this->generateImpliedEndTags(array('p')); + + /* If the current node is not a p element, then this is + a parse error. */ + // XERROR: implement + + /* Pop elements from the stack of open elements until + * an element with the same tag name as the token has + * been popped from the stack. */ + do { + $node = array_pop($this->stack); + } while ($node->tagName !== 'p'); + + } else { + // parse error + $this->emitToken(array( + 'name' => 'p', + 'type' => HTML5_Tokenizer::STARTTAG, + )); + $this->emitToken($token); + } + break; + + /* An end tag whose tag name is "li" */ + case 'li': + /* If the stack of open elements does not have an element + * in list item scope with the same tag name as that of the + * token, then this is a parse error; ignore the token. */ + if ($this->elementInScope($token['name'], self::SCOPE_LISTITEM)) { + /* Generate implied end tags, except for elements with the + * same tag name as the token. */ + $this->generateImpliedEndTags(array($token['name'])); + /* If the current node is not an element with the same tag + * name as that of the token, then this is a parse error. */ + // XERROR: parse error + /* Pop elements from the stack of open elements until an + * element with the same tag name as the token has been + * popped from the stack. */ + do { + $node = array_pop($this->stack); + } while ($node->tagName !== $token['name']); + } + /*else { + // XERROR: parse error + }*/ + break; + + /* An end tag whose tag name is "dc", "dd", "ds", "dt" */ + case 'dc': case 'dd': case 'ds': case 'dt': + if ($this->elementInScope($token['name'])) { + $this->generateImpliedEndTags(array($token['name'])); + + /* If the current node is not an element with the same + tag name as the token, then this is a parse error. */ + // XERROR: implement parse error + + /* Pop elements from the stack of open elements until + * an element with the same tag name as the token has + * been popped from the stack. */ + do { + $node = array_pop($this->stack); + } while ($node->tagName !== $token['name']); + } + /*else { + // XERROR: parse error + }*/ + break; + + /* An end tag whose tag name is one of: "h1", "h2", "h3", "h4", + "h5", "h6" */ + case 'h1': case 'h2': case 'h3': case 'h4': case 'h5': case 'h6': + $elements = array('h1', 'h2', 'h3', 'h4', 'h5', 'h6'); + + /* If the stack of open elements has in scope an element whose + tag name is one of "h1", "h2", "h3", "h4", "h5", or "h6", then + generate implied end tags. */ + if ($this->elementInScope($elements)) { + $this->generateImpliedEndTags(); + + /* Now, if the current node is not an element with the same + tag name as that of the token, then this is a parse error. */ + // XERROR: implement parse error + + /* If the stack of open elements has in scope an element + whose tag name is one of "h1", "h2", "h3", "h4", "h5", or + "h6", then pop elements from the stack until an element + with one of those tag names has been popped from the stack. */ + do { + $node = array_pop($this->stack); + } while (!in_array($node->tagName, $elements)); + } + /*else { + // parse error + }*/ + break; + + /* An end tag whose tag name is one of: "a", "b", "big", "em", + "font", "i", "nobr", "s", "small", "strike", "strong", "tt", "u" */ + case 'a': case 'b': case 'big': case 'code': case 'em': case 'font': + case 'i': case 'nobr': case 's': case 'small': case 'strike': + case 'strong': case 'tt': case 'u': + // XERROR: generally speaking this needs parse error logic + /* 1. Let the formatting element be the last element in + the list of active formatting elements that: + * is between the end of the list and the last scope + marker in the list, if any, or the start of the list + otherwise, and + * has the same tag name as the token. + */ + while (true) { + for ($a = count($this->a_formatting) - 1; $a >= 0; $a--) { + if ($this->a_formatting[$a] === self::MARKER) { + break; + } elseif ($this->a_formatting[$a]->tagName === $token['name']) { + $formatting_element = $this->a_formatting[$a]; + $in_stack = in_array($formatting_element, $this->stack, true); + $fe_af_pos = $a; + break; + } + } + + /* If there is no such node, or, if that node is + also in the stack of open elements but the element + is not in scope, then this is a parse error. Abort + these steps. The token is ignored. */ + if (!isset($formatting_element) || ($in_stack && + !$this->elementInScope($token['name']))) { + $this->ignored = true; + break; + + /* Otherwise, if there is such a node, but that node + is not in the stack of open elements, then this is a + parse error; remove the element from the list, and + abort these steps. */ + } elseif (isset($formatting_element) && !$in_stack) { + unset($this->a_formatting[$fe_af_pos]); + $this->a_formatting = array_merge($this->a_formatting); + break; + } + + /* Otherwise, there is a formatting element and that + * element is in the stack and is in scope. If the + * element is not the current node, this is a parse + * error. In any case, proceed with the algorithm as + * written in the following steps. */ + // XERROR: implement me + + /* 2. Let the furthest block be the topmost node in the + stack of open elements that is lower in the stack + than the formatting element, and is not an element in + the phrasing or formatting categories. There might + not be one. */ + $fe_s_pos = array_search($formatting_element, $this->stack, true); + $length = count($this->stack); + + for ($s = $fe_s_pos + 1; $s < $length; $s++) { + $category = $this->getElementCategory($this->stack[$s]); + + if ($category !== self::PHRASING && $category !== self::FORMATTING) { + $furthest_block = $this->stack[$s]; + break; + } + } + + /* 3. If there is no furthest block, then the UA must + skip the subsequent steps and instead just pop all + the nodes from the bottom of the stack of open + elements, from the current node up to the formatting + element, and remove the formatting element from the + list of active formatting elements. */ + if (!isset($furthest_block)) { + for ($n = $length - 1; $n >= $fe_s_pos; $n--) { + array_pop($this->stack); + } + + unset($this->a_formatting[$fe_af_pos]); + $this->a_formatting = array_merge($this->a_formatting); + break; + } + + /* 4. Let the common ancestor be the element + immediately above the formatting element in the stack + of open elements. */ + $common_ancestor = $this->stack[$fe_s_pos - 1]; + + /* 5. Let a bookmark note the position of the + formatting element in the list of active formatting + elements relative to the elements on either side + of it in the list. */ + $bookmark = $fe_af_pos; + + /* 6. Let node and last node be the furthest block. + Follow these steps: */ + $node = $furthest_block; + $last_node = $furthest_block; + + while (true) { + for ($n = array_search($node, $this->stack, true) - 1; $n >= 0; $n--) { + /* 6.1 Let node be the element immediately + prior to node in the stack of open elements. */ + $node = $this->stack[$n]; + + /* 6.2 If node is not in the list of active + formatting elements, then remove node from + the stack of open elements and then go back + to step 1. */ + if (!in_array($node, $this->a_formatting, true)) { + array_splice($this->stack, $n, 1); + } else { + break; + } + } + + /* 6.3 Otherwise, if node is the formatting + element, then go to the next step in the overall + algorithm. */ + if ($node === $formatting_element) { + break; + + /* 6.4 Otherwise, if last node is the furthest + block, then move the aforementioned bookmark to + be immediately after the node in the list of + active formatting elements. */ + } elseif ($last_node === $furthest_block) { + $bookmark = array_search($node, $this->a_formatting, true) + 1; + } + + /* 6.5 Create an element for the token for which + * the element node was created, replace the entry + * for node in the list of active formatting + * elements with an entry for the new element, + * replace the entry for node in the stack of open + * elements with an entry for the new element, and + * let node be the new element. */ + // we don't know what the token is anymore + // XDOM + $clone = $node->cloneNode(); + $a_pos = array_search($node, $this->a_formatting, true); + $s_pos = array_search($node, $this->stack, true); + $this->a_formatting[$a_pos] = $clone; + $this->stack[$s_pos] = $clone; + $node = $clone; + + /* 6.6 Insert last node into node, first removing + it from its previous parent node if any. */ + // XDOM + if ($last_node->parentNode !== null) { + $last_node->parentNode->removeChild($last_node); + } + + // XDOM + $node->appendChild($last_node); + + /* 6.7 Let last node be node. */ + $last_node = $node; + + /* 6.8 Return to step 1 of this inner set of steps. */ + } + + /* 7. If the common ancestor node is a table, tbody, + * tfoot, thead, or tr element, then, foster parent + * whatever last node ended up being in the previous + * step, first removing it from its previous parent + * node if any. */ + // XDOM + if ($last_node->parentNode) { // common step + $last_node->parentNode->removeChild($last_node); + } + if (in_array($common_ancestor->tagName, array('table', 'tbody', 'tfoot', 'thead', 'tr'))) { + $this->fosterParent($last_node); + /* Otherwise, append whatever last node ended up being + * in the previous step to the common ancestor node, + * first removing it from its previous parent node if + * any. */ + } else { + // XDOM + $common_ancestor->appendChild($last_node); + } + + /* 8. Create an element for the token for which the + * formatting element was created. */ + // XDOM + $clone = $formatting_element->cloneNode(); + + /* 9. Take all of the child nodes of the furthest + block and append them to the element created in the + last step. */ + // XDOM + while ($furthest_block->hasChildNodes()) { + $child = $furthest_block->firstChild; + $furthest_block->removeChild($child); + $clone->appendChild($child); + } + + /* 10. Append that clone to the furthest block. */ + // XDOM + $furthest_block->appendChild($clone); + + /* 11. Remove the formatting element from the list + of active formatting elements, and insert the new element + into the list of active formatting elements at the + position of the aforementioned bookmark. */ + $fe_af_pos = array_search($formatting_element, $this->a_formatting, true); + array_splice($this->a_formatting, $fe_af_pos, 1); + + $af_part1 = array_slice($this->a_formatting, 0, $bookmark - 1); + $af_part2 = array_slice($this->a_formatting, $bookmark); + $this->a_formatting = array_merge($af_part1, array($clone), $af_part2); + + /* 12. Remove the formatting element from the stack + of open elements, and insert the new element into the stack + of open elements immediately below the position of the + furthest block in that stack. */ + $fe_s_pos = array_search($formatting_element, $this->stack, true); + array_splice($this->stack, $fe_s_pos, 1); + + $fb_s_pos = array_search($furthest_block, $this->stack, true); + $s_part1 = array_slice($this->stack, 0, $fb_s_pos + 1); + $s_part2 = array_slice($this->stack, $fb_s_pos + 1); + $this->stack = array_merge($s_part1, array($clone), $s_part2); + + /* 13. Jump back to step 1 in this series of steps. */ + unset($formatting_element, $fe_af_pos, $fe_s_pos, $furthest_block); + } + break; + + case 'applet': case 'button': case 'marquee': case 'object': + /* If the stack of open elements has an element in scope whose + tag name matches the tag name of the token, then generate implied + tags. */ + if ($this->elementInScope($token['name'])) { + $this->generateImpliedEndTags(); + + /* Now, if the current node is not an element with the same + tag name as the token, then this is a parse error. */ + // XERROR: implement logic + + /* Pop elements from the stack of open elements until + * an element with the same tag name as the token has + * been popped from the stack. */ + do { + $node = array_pop($this->stack); + } while ($node->tagName !== $token['name']); + + /* Clear the list of active formatting elements up to the + * last marker. */ + $keys = array_keys($this->a_formatting, self::MARKER, true); + $marker = end($keys); + + for ($n = count($this->a_formatting) - 1; $n > $marker; $n--) { + array_pop($this->a_formatting); + } + } + /*else { + // parse error + }*/ + break; + + case 'br': + // Parse error + $this->emitToken(array( + 'name' => 'br', + 'type' => HTML5_Tokenizer::STARTTAG, + )); + break; + + /* An end tag token not covered by the previous entries */ + default: + for ($n = count($this->stack) - 1; $n >= 0; $n--) { + /* Initialise node to be the current node (the bottommost + node of the stack). */ + $node = $this->stack[$n]; + + /* If node has the same tag name as the end tag token, + then: */ + if ($token['name'] === $node->tagName) { + /* Generate implied end tags. */ + $this->generateImpliedEndTags(); + + /* If the tag name of the end tag token does not + match the tag name of the current node, this is a + parse error. */ + // XERROR: implement this + + /* Pop all the nodes from the current node up to + node, including node, then stop these steps. */ + // XSKETCHY + do { + $pop = array_pop($this->stack); + } while ($pop !== $node); + break; + } else { + $category = $this->getElementCategory($node); + + if ($category !== self::FORMATTING && $category !== self::PHRASING) { + /* Otherwise, if node is in neither the formatting + category nor the phrasing category, then this is a + parse error. Stop this algorithm. The end tag token + is ignored. */ + $this->ignored = true; + break; + // parse error + } + } + /* Set node to the previous entry in the stack of open elements. Loop. */ + } + break; + } + break; + } + break; + + case self::IN_CDATA_RCDATA: + if ( + $token['type'] === HTML5_Tokenizer::CHARACTER || + $token['type'] === HTML5_Tokenizer::SPACECHARACTER + ) { + $this->insertText($token['data']); + } elseif ($token['type'] === HTML5_Tokenizer::EOF) { + // parse error + /* If the current node is a script element, mark the script + * element as "already executed". */ + // probably not necessary + array_pop($this->stack); + $this->mode = $this->original_mode; + $this->emitToken($token); + } elseif ($token['type'] === HTML5_Tokenizer::ENDTAG && $token['name'] === 'script') { + array_pop($this->stack); + $this->mode = $this->original_mode; + // we're ignoring all of the execution stuff + } elseif ($token['type'] === HTML5_Tokenizer::ENDTAG) { + array_pop($this->stack); + $this->mode = $this->original_mode; + } + break; + + case self::IN_TABLE: + $clear = array('html', 'table'); + + /* A character token */ + if ($token['type'] === HTML5_Tokenizer::CHARACTER || + $token['type'] === HTML5_Tokenizer::SPACECHARACTER) { + /* Let the pending table character tokens + * be an empty list of tokens. */ + $this->pendingTableCharacters = ""; + $this->pendingTableCharactersDirty = false; + /* Let the original insertion mode be the current + * insertion mode. */ + $this->original_mode = $this->mode; + /* Switch the insertion mode to + * "in table text" and + * reprocess the token. */ + $this->mode = self::IN_TABLE_TEXT; + $this->emitToken($token); + + /* A comment token */ + } elseif ($token['type'] === HTML5_Tokenizer::COMMENT) { + /* Append a Comment node to the current node with the data + attribute set to the data given in the comment token. */ + $this->insertComment($token['data']); + + } elseif ($token['type'] === HTML5_Tokenizer::DOCTYPE) { + // parse error + + /* A start tag whose tag name is "caption" */ + } elseif ($token['type'] === HTML5_Tokenizer::STARTTAG && + $token['name'] === 'caption') { + /* Clear the stack back to a table context. */ + $this->clearStackToTableContext($clear); + + /* Insert a marker at the end of the list of active + formatting elements. */ + $this->a_formatting[] = self::MARKER; + + /* Insert an HTML element for the token, then switch the + insertion mode to "in caption". */ + $this->insertElement($token); + $this->mode = self::IN_CAPTION; + + /* A start tag whose tag name is "colgroup" */ + } elseif ($token['type'] === HTML5_Tokenizer::STARTTAG && + $token['name'] === 'colgroup') { + /* Clear the stack back to a table context. */ + $this->clearStackToTableContext($clear); + + /* Insert an HTML element for the token, then switch the + insertion mode to "in column group". */ + $this->insertElement($token); + $this->mode = self::IN_COLUMN_GROUP; + + /* A start tag whose tag name is "col" */ + } elseif ($token['type'] === HTML5_Tokenizer::STARTTAG && + $token['name'] === 'col') { + $this->emitToken(array( + 'name' => 'colgroup', + 'type' => HTML5_Tokenizer::STARTTAG, + 'attr' => array() + )); + + $this->emitToken($token); + + /* A start tag whose tag name is one of: "tbody", "tfoot", "thead" */ + } elseif ($token['type'] === HTML5_Tokenizer::STARTTAG && in_array($token['name'], + array('tbody', 'tfoot', 'thead'))) { + /* Clear the stack back to a table context. */ + $this->clearStackToTableContext($clear); + + /* Insert an HTML element for the token, then switch the insertion + mode to "in table body". */ + $this->insertElement($token); + $this->mode = self::IN_TABLE_BODY; + + /* A start tag whose tag name is one of: "td", "th", "tr" */ + } elseif ($token['type'] === HTML5_Tokenizer::STARTTAG && + in_array($token['name'], array('td', 'th', 'tr'))) { + /* Act as if a start tag token with the tag name "tbody" had been + seen, then reprocess the current token. */ + $this->emitToken(array( + 'name' => 'tbody', + 'type' => HTML5_Tokenizer::STARTTAG, + 'attr' => array() + )); + + $this->emitToken($token); + + /* A start tag whose tag name is "table" */ + } elseif ($token['type'] === HTML5_Tokenizer::STARTTAG && + $token['name'] === 'table') { + /* Parse error. Act as if an end tag token with the tag name "table" + had been seen, then, if that token wasn't ignored, reprocess the + current token. */ + $this->emitToken(array( + 'name' => 'table', + 'type' => HTML5_Tokenizer::ENDTAG + )); + + if (!$this->ignored) $this->emitToken($token); + + /* An end tag whose tag name is "table" */ + } elseif ($token['type'] === HTML5_Tokenizer::ENDTAG && + $token['name'] === 'table') { + /* If the stack of open elements does not have an element in table + scope with the same tag name as the token, this is a parse error. + Ignore the token. (fragment case) */ + if (!$this->elementInScope($token['name'], self::SCOPE_TABLE)) { + $this->ignored = true; + } else { + do { + $node = array_pop($this->stack); + } while ($node->tagName !== 'table'); + + /* Reset the insertion mode appropriately. */ + $this->resetInsertionMode(); + } + + /* An end tag whose tag name is one of: "body", "caption", "col", + "colgroup", "html", "tbody", "td", "tfoot", "th", "thead", "tr" */ + } elseif ($token['type'] === HTML5_Tokenizer::ENDTAG && in_array($token['name'], + array('body', 'caption', 'col', 'colgroup', 'html', 'tbody', 'td', + 'tfoot', 'th', 'thead', 'tr'))) { + // Parse error. Ignore the token. + + } elseif ($token['type'] === HTML5_Tokenizer::STARTTAG && + ($token['name'] === 'style' || $token['name'] === 'script')) { + $this->processWithRulesFor($token, self::IN_HEAD); + + } elseif ($token['type'] === HTML5_Tokenizer::STARTTAG && $token['name'] === 'input' && + // assignment is intentional + /* If the token does not have an attribute with the name "type", or + * if it does, but that attribute's value is not an ASCII + * case-insensitive match for the string "hidden", then: act as + * described in the "anything else" entry below. */ + ($type = $this->getAttr($token, 'type')) && strtolower($type) === 'hidden') { + // I.e., if its an input with the type attribute == 'hidden' + /* Otherwise */ + // parse error + $this->insertElement($token); + array_pop($this->stack); + } elseif ($token['type'] === HTML5_Tokenizer::EOF) { + /* If the current node is not the root html element, then this is a parse error. */ + if (end($this->stack)->tagName !== 'html') { + // Note: It can only be the current node in the fragment case. + // parse error + } + /* Stop parsing. */ + /* Anything else */ + } else { + /* Parse error. Process the token as if the insertion mode was "in + body", with the following exception: */ + + $old = $this->foster_parent; + $this->foster_parent = true; + $this->processWithRulesFor($token, self::IN_BODY); + $this->foster_parent = $old; + } + break; + + case self::IN_TABLE_TEXT: + /* A character token */ + if ($token['type'] === HTML5_Tokenizer::CHARACTER) { + /* Append the character token to the pending table + * character tokens list. */ + $this->pendingTableCharacters .= $token['data']; + $this->pendingTableCharactersDirty = true; + } elseif ($token['type'] === HTML5_Tokenizer::SPACECHARACTER) { + $this->pendingTableCharacters .= $token['data']; + /* Anything else */ + } else { + if ($this->pendingTableCharacters !== '' && is_string($this->pendingTableCharacters)) { + /* If any of the tokens in the pending table character tokens list + * are character tokens that are not one of U+0009 CHARACTER + * TABULATION, U+000A LINE FEED (LF), U+000C FORM FEED (FF), or + * U+0020 SPACE, then reprocess those character tokens using the + * rules given in the "anything else" entry in the in table" + * insertion mode.*/ + if ($this->pendingTableCharactersDirty) { + /* Parse error. Process the token using the rules for the + * "in body" insertion mode, except that if the current + * node is a table, tbody, tfoot, thead, or tr element, + * then, whenever a node would be inserted into the current + * node, it must instead be foster parented. */ + // XERROR + $old = $this->foster_parent; + $this->foster_parent = true; + $text_token = array( + 'type' => HTML5_Tokenizer::CHARACTER, + 'data' => $this->pendingTableCharacters, + ); + $this->processWithRulesFor($text_token, self::IN_BODY); + $this->foster_parent = $old; + + /* Otherwise, insert the characters given by the pending table + * character tokens list into the current node. */ + } else { + $this->insertText($this->pendingTableCharacters); + } + $this->pendingTableCharacters = null; + $this->pendingTableCharactersNull = null; + } + + /* Switch the insertion mode to the original insertion mode and + * reprocess the token. + */ + $this->mode = $this->original_mode; + $this->emitToken($token); + } + break; + + case self::IN_CAPTION: + /* An end tag whose tag name is "caption" */ + if ($token['type'] === HTML5_Tokenizer::ENDTAG && $token['name'] === 'caption') { + /* If the stack of open elements does not have an element in table + scope with the same tag name as the token, this is a parse error. + Ignore the token. (fragment case) */ + if (!$this->elementInScope($token['name'], self::SCOPE_TABLE)) { + $this->ignored = true; + // Ignore + + /* Otherwise: */ + } else { + /* Generate implied end tags. */ + $this->generateImpliedEndTags(); + + /* Now, if the current node is not a caption element, then this + is a parse error. */ + // XERROR: implement + + /* Pop elements from this stack until a caption element has + been popped from the stack. */ + do { + $node = array_pop($this->stack); + } while ($node->tagName !== 'caption'); + + /* Clear the list of active formatting elements up to the last + marker. */ + $this->clearTheActiveFormattingElementsUpToTheLastMarker(); + + /* Switch the insertion mode to "in table". */ + $this->mode = self::IN_TABLE; + } + + /* A start tag whose tag name is one of: "caption", "col", "colgroup", + "tbody", "td", "tfoot", "th", "thead", "tr", or an end tag whose tag + name is "table" */ + } elseif (($token['type'] === HTML5_Tokenizer::STARTTAG && in_array($token['name'], + array('caption', 'col', 'colgroup', 'tbody', 'td', 'tfoot', 'th', + 'thead', 'tr'))) || ($token['type'] === HTML5_Tokenizer::ENDTAG && + $token['name'] === 'table')) { + /* Parse error. Act as if an end tag with the tag name "caption" + had been seen, then, if that token wasn't ignored, reprocess the + current token. */ + $this->emitToken(array( + 'name' => 'caption', + 'type' => HTML5_Tokenizer::ENDTAG + )); + + if (!$this->ignored) { + $this->emitToken($token); + } + + /* An end tag whose tag name is one of: "body", "col", "colgroup", + "html", "tbody", "td", "tfoot", "th", "thead", "tr" */ + } elseif ($token['type'] === HTML5_Tokenizer::ENDTAG && in_array($token['name'], + array('body', 'col', 'colgroup', 'html', 'tbody', 'tfoot', 'th', + 'thead', 'tr'))) { + // Parse error. Ignore the token. + $this->ignored = true; + } else { + /* Process the token as if the insertion mode was "in body". */ + $this->processWithRulesFor($token, self::IN_BODY); + } + break; + + case self::IN_COLUMN_GROUP: + /* A character token that is one of one of U+0009 CHARACTER TABULATION, + U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), + or U+0020 SPACE */ + if ($token['type'] === HTML5_Tokenizer::SPACECHARACTER) { + /* Append the character to the current node. */ + $this->insertText($token['data']); + + /* A comment token */ + } elseif ($token['type'] === HTML5_Tokenizer::COMMENT) { + /* Append a Comment node to the current node with the data + attribute set to the data given in the comment token. */ + $this->insertComment($token['data']); + } elseif ($token['type'] === HTML5_Tokenizer::DOCTYPE) { + // parse error + } elseif ($token['type'] === HTML5_Tokenizer::STARTTAG && $token['name'] === 'html') { + $this->processWithRulesFor($token, self::IN_BODY); + + /* A start tag whose tag name is "col" */ + } elseif ($token['type'] === HTML5_Tokenizer::STARTTAG && $token['name'] === 'col') { + /* Insert a col element for the token. Immediately pop the current + node off the stack of open elements. */ + $this->insertElement($token); + array_pop($this->stack); + // XERROR: Acknowledge the token's self-closing flag, if it is set. + + /* An end tag whose tag name is "colgroup" */ + } elseif ($token['type'] === HTML5_Tokenizer::ENDTAG && + $token['name'] === 'colgroup') { + /* If the current node is the root html element, then this is a + parse error, ignore the token. (fragment case) */ + if (end($this->stack)->tagName === 'html') { + $this->ignored = true; + + /* Otherwise, pop the current node (which will be a colgroup + element) from the stack of open elements. Switch the insertion + mode to "in table". */ + } else { + array_pop($this->stack); + $this->mode = self::IN_TABLE; + } + + /* An end tag whose tag name is "col" */ + } elseif ($token['type'] === HTML5_Tokenizer::ENDTAG && $token['name'] === 'col') { + /* Parse error. Ignore the token. */ + $this->ignored = true; + + /* An end-of-file token */ + /* If the current node is the root html element */ + } elseif ($token['type'] === HTML5_Tokenizer::EOF && end($this->stack)->tagName === 'html') { + /* Stop parsing */ + + /* Anything else */ + } else { + /* Act as if an end tag with the tag name "colgroup" had been seen, + and then, if that token wasn't ignored, reprocess the current token. */ + $this->emitToken(array( + 'name' => 'colgroup', + 'type' => HTML5_Tokenizer::ENDTAG + )); + + if (!$this->ignored) $this->emitToken($token); + } + break; + + case self::IN_TABLE_BODY: + $clear = array('tbody', 'tfoot', 'thead', 'html'); + + /* A start tag whose tag name is "tr" */ + if ($token['type'] === HTML5_Tokenizer::STARTTAG && $token['name'] === 'tr') { + /* Clear the stack back to a table body context. */ + $this->clearStackToTableContext($clear); + + /* Insert a tr element for the token, then switch the insertion + mode to "in row". */ + $this->insertElement($token); + $this->mode = self::IN_ROW; + + /* A start tag whose tag name is one of: "th", "td" */ + } elseif ($token['type'] === HTML5_Tokenizer::STARTTAG && + ($token['name'] === 'th' || $token['name'] === 'td')) { + /* Parse error. Act as if a start tag with the tag name "tr" had + been seen, then reprocess the current token. */ + $this->emitToken(array( + 'name' => 'tr', + 'type' => HTML5_Tokenizer::STARTTAG, + 'attr' => array() + )); + + $this->emitToken($token); + + /* An end tag whose tag name is one of: "tbody", "tfoot", "thead" */ + } elseif ($token['type'] === HTML5_Tokenizer::ENDTAG && + in_array($token['name'], array('tbody', 'tfoot', 'thead'))) { + /* If the stack of open elements does not have an element in table + scope with the same tag name as the token, this is a parse error. + Ignore the token. */ + if (!$this->elementInScope($token['name'], self::SCOPE_TABLE)) { + // Parse error + $this->ignored = true; + + /* Otherwise: */ + } else { + /* Clear the stack back to a table body context. */ + $this->clearStackToTableContext($clear); + + /* Pop the current node from the stack of open elements. Switch + the insertion mode to "in table". */ + array_pop($this->stack); + $this->mode = self::IN_TABLE; + } + + /* A start tag whose tag name is one of: "caption", "col", "colgroup", + "tbody", "tfoot", "thead", or an end tag whose tag name is "table" */ + } elseif (($token['type'] === HTML5_Tokenizer::STARTTAG && in_array($token['name'], + array('caption', 'col', 'colgroup', 'tbody', 'tfoot', 'thead'))) || + ($token['type'] === HTML5_Tokenizer::ENDTAG && $token['name'] === 'table')) { + /* If the stack of open elements does not have a tbody, thead, or + tfoot element in table scope, this is a parse error. Ignore the + token. (fragment case) */ + if (!$this->elementInScope(array('tbody', 'thead', 'tfoot'), self::SCOPE_TABLE)) { + // parse error + $this->ignored = true; + + /* Otherwise: */ + } else { + /* Clear the stack back to a table body context. */ + $this->clearStackToTableContext($clear); + + /* Act as if an end tag with the same tag name as the current + node ("tbody", "tfoot", or "thead") had been seen, then + reprocess the current token. */ + $this->emitToken(array( + 'name' => end($this->stack)->tagName, + 'type' => HTML5_Tokenizer::ENDTAG + )); + + $this->emitToken($token); + } + + /* An end tag whose tag name is one of: "body", "caption", "col", + "colgroup", "html", "td", "th", "tr" */ + } elseif ($token['type'] === HTML5_Tokenizer::ENDTAG && in_array($token['name'], + array('body', 'caption', 'col', 'colgroup', 'html', 'td', 'th', 'tr'))) { + /* Parse error. Ignore the token. */ + $this->ignored = true; + + /* Anything else */ + } else { + /* Process the token as if the insertion mode was "in table". */ + $this->processWithRulesFor($token, self::IN_TABLE); + } + break; + + case self::IN_ROW: + $clear = array('tr', 'html'); + + /* A start tag whose tag name is one of: "th", "td" */ + if ($token['type'] === HTML5_Tokenizer::STARTTAG && + ($token['name'] === 'th' || $token['name'] === 'td')) { + /* Clear the stack back to a table row context. */ + $this->clearStackToTableContext($clear); + + /* Insert an HTML element for the token, then switch the insertion + mode to "in cell". */ + $this->insertElement($token); + $this->mode = self::IN_CELL; + + /* Insert a marker at the end of the list of active formatting + elements. */ + $this->a_formatting[] = self::MARKER; + + /* An end tag whose tag name is "tr" */ + } elseif ($token['type'] === HTML5_Tokenizer::ENDTAG && $token['name'] === 'tr') { + /* If the stack of open elements does not have an element in table + scope with the same tag name as the token, this is a parse error. + Ignore the token. (fragment case) */ + if (!$this->elementInScope($token['name'], self::SCOPE_TABLE)) { + // Ignore. + $this->ignored = true; + } else { + /* Clear the stack back to a table row context. */ + $this->clearStackToTableContext($clear); + + /* Pop the current node (which will be a tr element) from the + stack of open elements. Switch the insertion mode to "in table + body". */ + array_pop($this->stack); + $this->mode = self::IN_TABLE_BODY; + } + + /* A start tag whose tag name is one of: "caption", "col", "colgroup", + "tbody", "tfoot", "thead", "tr" or an end tag whose tag name is "table" */ + } elseif (($token['type'] === HTML5_Tokenizer::STARTTAG && in_array($token['name'], + array('caption', 'col', 'colgroup', 'tbody', 'tfoot', 'thead', 'tr'))) || + ($token['type'] === HTML5_Tokenizer::ENDTAG && $token['name'] === 'table')) { + /* Act as if an end tag with the tag name "tr" had been seen, then, + if that token wasn't ignored, reprocess the current token. */ + $this->emitToken(array( + 'name' => 'tr', + 'type' => HTML5_Tokenizer::ENDTAG + )); + if (!$this->ignored) $this->emitToken($token); + + /* An end tag whose tag name is one of: "tbody", "tfoot", "thead" */ + } elseif ($token['type'] === HTML5_Tokenizer::ENDTAG && + in_array($token['name'], array('tbody', 'tfoot', 'thead'))) { + /* If the stack of open elements does not have an element in table + scope with the same tag name as the token, this is a parse error. + Ignore the token. */ + if (!$this->elementInScope($token['name'], self::SCOPE_TABLE)) { + $this->ignored = true; + + /* Otherwise: */ + } else { + /* Otherwise, act as if an end tag with the tag name "tr" had + been seen, then reprocess the current token. */ + $this->emitToken(array( + 'name' => 'tr', + 'type' => HTML5_Tokenizer::ENDTAG + )); + + $this->emitToken($token); + } + + /* An end tag whose tag name is one of: "body", "caption", "col", + "colgroup", "html", "td", "th" */ + } elseif ($token['type'] === HTML5_Tokenizer::ENDTAG && in_array($token['name'], + array('body', 'caption', 'col', 'colgroup', 'html', 'td', 'th'))) { + /* Parse error. Ignore the token. */ + $this->ignored = true; + + /* Anything else */ + } else { + /* Process the token as if the insertion mode was "in table". */ + $this->processWithRulesFor($token, self::IN_TABLE); + } + break; + + case self::IN_CELL: + /* An end tag whose tag name is one of: "td", "th" */ + if ($token['type'] === HTML5_Tokenizer::ENDTAG && + ($token['name'] === 'td' || $token['name'] === 'th')) { + /* If the stack of open elements does not have an element in table + scope with the same tag name as that of the token, then this is a + parse error and the token must be ignored. */ + if (!$this->elementInScope($token['name'], self::SCOPE_TABLE)) { + $this->ignored = true; + + /* Otherwise: */ + } else { + /* Generate implied end tags, except for elements with the same + tag name as the token. */ + $this->generateImpliedEndTags(array($token['name'])); + + /* Now, if the current node is not an element with the same tag + name as the token, then this is a parse error. */ + // XERROR: Implement parse error code + + /* Pop elements from this stack until an element with the same + tag name as the token has been popped from the stack. */ + do { + $node = array_pop($this->stack); + } while ($node->tagName !== $token['name']); + + /* Clear the list of active formatting elements up to the last + marker. */ + $this->clearTheActiveFormattingElementsUpToTheLastMarker(); + + /* Switch the insertion mode to "in row". (The current node + will be a tr element at this point.) */ + $this->mode = self::IN_ROW; + } + + /* A start tag whose tag name is one of: "caption", "col", "colgroup", + "tbody", "td", "tfoot", "th", "thead", "tr" */ + } elseif ($token['type'] === HTML5_Tokenizer::STARTTAG && in_array($token['name'], + array('caption', 'col', 'colgroup', 'tbody', 'td', 'tfoot', 'th', + 'thead', 'tr'))) { + /* If the stack of open elements does not have a td or th element + in table scope, then this is a parse error; ignore the token. + (fragment case) */ + if (!$this->elementInScope(array('td', 'th'), self::SCOPE_TABLE)) { + // parse error + $this->ignored = true; + + /* Otherwise, close the cell (see below) and reprocess the current + token. */ + } else { + $this->closeCell(); + $this->emitToken($token); + } + + /* An end tag whose tag name is one of: "body", "caption", "col", + "colgroup", "html" */ + } elseif ($token['type'] === HTML5_Tokenizer::ENDTAG && in_array($token['name'], + array('body', 'caption', 'col', 'colgroup', 'html'))) { + /* Parse error. Ignore the token. */ + $this->ignored = true; + + /* An end tag whose tag name is one of: "table", "tbody", "tfoot", + "thead", "tr" */ + } elseif ($token['type'] === HTML5_Tokenizer::ENDTAG && in_array($token['name'], + array('table', 'tbody', 'tfoot', 'thead', 'tr'))) { + /* If the stack of open elements does not have a td or th element + in table scope, then this is a parse error; ignore the token. + (innerHTML case) */ + if (!$this->elementInScope(array('td', 'th'), self::SCOPE_TABLE)) { + // Parse error + $this->ignored = true; + + /* Otherwise, close the cell (see below) and reprocess the current + token. */ + } else { + $this->closeCell(); + $this->emitToken($token); + } + + /* Anything else */ + } else { + /* Process the token as if the insertion mode was "in body". */ + $this->processWithRulesFor($token, self::IN_BODY); + } + break; + + case self::IN_SELECT: + /* Handle the token as follows: */ + + /* A character token */ + if ( + $token['type'] === HTML5_Tokenizer::CHARACTER || + $token['type'] === HTML5_Tokenizer::SPACECHARACTER + ) { + /* Append the token's character to the current node. */ + $this->insertText($token['data']); + + /* A comment token */ + } elseif ($token['type'] === HTML5_Tokenizer::COMMENT) { + /* Append a Comment node to the current node with the data + attribute set to the data given in the comment token. */ + $this->insertComment($token['data']); + + } elseif ($token['type'] === HTML5_Tokenizer::DOCTYPE) { + // parse error + + } elseif ($token['type'] === HTML5_Tokenizer::STARTTAG && $token['name'] === 'html') { + $this->processWithRulesFor($token, self::IN_BODY); + + /* A start tag token whose tag name is "option" */ + } elseif ($token['type'] === HTML5_Tokenizer::STARTTAG && + $token['name'] === 'option') { + /* If the current node is an option element, act as if an end tag + with the tag name "option" had been seen. */ + if (end($this->stack)->tagName === 'option') { + $this->emitToken(array( + 'name' => 'option', + 'type' => HTML5_Tokenizer::ENDTAG + )); + } + + /* Insert an HTML element for the token. */ + $this->insertElement($token); + + /* A start tag token whose tag name is "optgroup" */ + } elseif ($token['type'] === HTML5_Tokenizer::STARTTAG && + $token['name'] === 'optgroup') { + /* If the current node is an option element, act as if an end tag + with the tag name "option" had been seen. */ + if (end($this->stack)->tagName === 'option') { + $this->emitToken(array( + 'name' => 'option', + 'type' => HTML5_Tokenizer::ENDTAG + )); + } + + /* If the current node is an optgroup element, act as if an end tag + with the tag name "optgroup" had been seen. */ + if (end($this->stack)->tagName === 'optgroup') { + $this->emitToken(array( + 'name' => 'optgroup', + 'type' => HTML5_Tokenizer::ENDTAG + )); + } + + /* Insert an HTML element for the token. */ + $this->insertElement($token); + + /* An end tag token whose tag name is "optgroup" */ + } elseif ($token['type'] === HTML5_Tokenizer::ENDTAG && + $token['name'] === 'optgroup') { + /* First, if the current node is an option element, and the node + immediately before it in the stack of open elements is an optgroup + element, then act as if an end tag with the tag name "option" had + been seen. */ + $elements_in_stack = count($this->stack); + + if ($this->stack[$elements_in_stack - 1]->tagName === 'option' && + $this->stack[$elements_in_stack - 2]->tagName === 'optgroup') { + $this->emitToken(array( + 'name' => 'option', + 'type' => HTML5_Tokenizer::ENDTAG + )); + } + + /* If the current node is an optgroup element, then pop that node + from the stack of open elements. Otherwise, this is a parse error, + ignore the token. */ + if (end($this->stack)->tagName === 'optgroup') { + array_pop($this->stack); + } else { + // parse error + $this->ignored = true; + } + + /* An end tag token whose tag name is "option" */ + } elseif ($token['type'] === HTML5_Tokenizer::ENDTAG && + $token['name'] === 'option') { + /* If the current node is an option element, then pop that node + from the stack of open elements. Otherwise, this is a parse error, + ignore the token. */ + if (end($this->stack)->tagName === 'option') { + array_pop($this->stack); + } else { + // parse error + $this->ignored = true; + } + + /* An end tag whose tag name is "select" */ + } elseif ($token['type'] === HTML5_Tokenizer::ENDTAG && + $token['name'] === 'select') { + /* If the stack of open elements does not have an element in table + scope with the same tag name as the token, this is a parse error. + Ignore the token. (fragment case) */ + if (!$this->elementInScope($token['name'], self::SCOPE_TABLE)) { + $this->ignored = true; + // parse error + + /* Otherwise: */ + } else { + /* Pop elements from the stack of open elements until a select + element has been popped from the stack. */ + do { + $node = array_pop($this->stack); + } while ($node->tagName !== 'select'); + + /* Reset the insertion mode appropriately. */ + $this->resetInsertionMode(); + } + + /* A start tag whose tag name is "select" */ + } elseif ($token['type'] === HTML5_Tokenizer::STARTTAG && $token['name'] === 'select') { + /* Parse error. Act as if the token had been an end tag with the + tag name "select" instead. */ + $this->emitToken(array( + 'name' => 'select', + 'type' => HTML5_Tokenizer::ENDTAG + )); + + } elseif ($token['type'] === HTML5_Tokenizer::STARTTAG && + ($token['name'] === 'input' || $token['name'] === 'keygen' || $token['name'] === 'textarea')) { + // parse error + $this->emitToken(array( + 'name' => 'select', + 'type' => HTML5_Tokenizer::ENDTAG + )); + $this->emitToken($token); + + } elseif ($token['type'] === HTML5_Tokenizer::STARTTAG && $token['name'] === 'script') { + $this->processWithRulesFor($token, self::IN_HEAD); + + } elseif ($token['type'] === HTML5_Tokenizer::EOF) { + // XERROR: If the current node is not the root html element, then this is a parse error. + /* Stop parsing */ + + /* Anything else */ + } else { + /* Parse error. Ignore the token. */ + $this->ignored = true; + } + break; + + case self::IN_SELECT_IN_TABLE: + + if ($token['type'] === HTML5_Tokenizer::STARTTAG && + in_array($token['name'], array('caption', 'table', 'tbody', + 'tfoot', 'thead', 'tr', 'td', 'th'))) { + // parse error + $this->emitToken(array( + 'name' => 'select', + 'type' => HTML5_Tokenizer::ENDTAG, + )); + $this->emitToken($token); + + /* An end tag whose tag name is one of: "caption", "table", "tbody", + "tfoot", "thead", "tr", "td", "th" */ + } elseif ($token['type'] === HTML5_Tokenizer::ENDTAG && + in_array($token['name'], array('caption', 'table', 'tbody', 'tfoot', 'thead', 'tr', 'td', 'th'))) { + /* Parse error. */ + // parse error + + /* If the stack of open elements has an element in table scope with + the same tag name as that of the token, then act as if an end tag + with the tag name "select" had been seen, and reprocess the token. + Otherwise, ignore the token. */ + if ($this->elementInScope($token['name'], self::SCOPE_TABLE)) { + $this->emitToken(array( + 'name' => 'select', + 'type' => HTML5_Tokenizer::ENDTAG + )); + + $this->emitToken($token); + } else { + $this->ignored = true; + } + } else { + $this->processWithRulesFor($token, self::IN_SELECT); + } + break; + + case self::IN_FOREIGN_CONTENT: + if ($token['type'] === HTML5_Tokenizer::CHARACTER || + $token['type'] === HTML5_Tokenizer::SPACECHARACTER) { + $this->insertText($token['data']); + } elseif ($token['type'] === HTML5_Tokenizer::COMMENT) { + $this->insertComment($token['data']); + } elseif ($token['type'] === HTML5_Tokenizer::DOCTYPE) { + // XERROR: parse error + } elseif ($token['type'] === HTML5_Tokenizer::ENDTAG && + $token['name'] === 'script' && end($this->stack)->tagName === 'script' && + // XDOM + end($this->stack)->namespaceURI === self::NS_SVG) { + array_pop($this->stack); + // a bunch of script running mumbo jumbo + } elseif ( + ($token['type'] === HTML5_Tokenizer::STARTTAG && + (( + $token['name'] !== 'mglyph' && + $token['name'] !== 'malignmark' && + // XDOM + end($this->stack)->namespaceURI === self::NS_MATHML && + in_array(end($this->stack)->tagName, array('mi', 'mo', 'mn', 'ms', 'mtext')) + ) || + ( + $token['name'] === 'svg' && + // XDOM + end($this->stack)->namespaceURI === self::NS_MATHML && + end($this->stack)->tagName === 'annotation-xml' + ) || + ( + // XDOM + end($this->stack)->namespaceURI === self::NS_SVG && + in_array(end($this->stack)->tagName, array('foreignObject', 'desc', 'title')) + ) || + ( + // XSKETCHY && XDOM + end($this->stack)->namespaceURI === self::NS_HTML + )) + ) || $token['type'] === HTML5_Tokenizer::ENDTAG + ) { + $this->processWithRulesFor($token, $this->secondary_mode); + /* If, after doing so, the insertion mode is still "in foreign + * content", but there is no element in scope that has a namespace + * other than the HTML namespace, switch the insertion mode to the + * secondary insertion mode. */ + if ($this->mode === self::IN_FOREIGN_CONTENT) { + $found = false; + // this basically duplicates elementInScope() + for ($i = count($this->stack) - 1; $i >= 0; $i--) { + // XDOM + $node = $this->stack[$i]; + if ($node->namespaceURI !== self::NS_HTML) { + $found = true; + break; + } elseif (in_array($node->tagName, array('table', 'html', + 'applet', 'caption', 'td', 'th', 'button', 'marquee', + 'object')) || ($node->tagName === 'foreignObject' && + $node->namespaceURI === self::NS_SVG)) { + break; + } + } + if (!$found) { + $this->mode = $this->secondary_mode; + } + } + } elseif ($token['type'] === HTML5_Tokenizer::EOF || ( + $token['type'] === HTML5_Tokenizer::STARTTAG && + (in_array($token['name'], array('b', "big", "blockquote", "body", "br", + "center", "code", "dc", "dd", "div", "dl", "ds", "dt", "em", "embed", "h1", "h2", + "h3", "h4", "h5", "h6", "head", "hr", "i", "img", "li", "listing", + "menu", "meta", "nobr", "ol", "p", "pre", "ruby", "s", "small", + "span", "strong", "strike", "sub", "sup", "table", "tt", "u", "ul", + "var")) || ($token['name'] === 'font' && ($this->getAttr($token, 'color') || + $this->getAttr($token, 'face') || $this->getAttr($token, 'size')))))) { + // XERROR: parse error + do { + $node = array_pop($this->stack); + // XDOM + } while ($node->namespaceURI !== self::NS_HTML); + $this->stack[] = $node; + $this->mode = $this->secondary_mode; + $this->emitToken($token); + } elseif ($token['type'] === HTML5_Tokenizer::STARTTAG) { + static $svg_lookup = array( + 'altglyph' => 'altGlyph', + 'altglyphdef' => 'altGlyphDef', + 'altglyphitem' => 'altGlyphItem', + 'animatecolor' => 'animateColor', + 'animatemotion' => 'animateMotion', + 'animatetransform' => 'animateTransform', + 'clippath' => 'clipPath', + 'feblend' => 'feBlend', + 'fecolormatrix' => 'feColorMatrix', + 'fecomponenttransfer' => 'feComponentTransfer', + 'fecomposite' => 'feComposite', + 'feconvolvematrix' => 'feConvolveMatrix', + 'fediffuselighting' => 'feDiffuseLighting', + 'fedisplacementmap' => 'feDisplacementMap', + 'fedistantlight' => 'feDistantLight', + 'feflood' => 'feFlood', + 'fefunca' => 'feFuncA', + 'fefuncb' => 'feFuncB', + 'fefuncg' => 'feFuncG', + 'fefuncr' => 'feFuncR', + 'fegaussianblur' => 'feGaussianBlur', + 'feimage' => 'feImage', + 'femerge' => 'feMerge', + 'femergenode' => 'feMergeNode', + 'femorphology' => 'feMorphology', + 'feoffset' => 'feOffset', + 'fepointlight' => 'fePointLight', + 'fespecularlighting' => 'feSpecularLighting', + 'fespotlight' => 'feSpotLight', + 'fetile' => 'feTile', + 'feturbulence' => 'feTurbulence', + 'foreignobject' => 'foreignObject', + 'glyphref' => 'glyphRef', + 'lineargradient' => 'linearGradient', + 'radialgradient' => 'radialGradient', + 'textpath' => 'textPath', + ); + // XDOM + $current = end($this->stack); + if ($current->namespaceURI === self::NS_MATHML) { + $token = $this->adjustMathMLAttributes($token); + } + if ($current->namespaceURI === self::NS_SVG && + isset($svg_lookup[$token['name']])) { + $token['name'] = $svg_lookup[$token['name']]; + } + if ($current->namespaceURI === self::NS_SVG) { + $token = $this->adjustSVGAttributes($token); + } + $token = $this->adjustForeignAttributes($token); + $this->insertForeignElement($token, $current->namespaceURI); + if (isset($token['self-closing'])) { + array_pop($this->stack); + // XERROR: acknowledge self-closing flag + } + } + break; + + case self::AFTER_BODY: + /* Handle the token as follows: */ + + /* A character token that is one of one of U+0009 CHARACTER TABULATION, + U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), + or U+0020 SPACE */ + if ($token['type'] === HTML5_Tokenizer::SPACECHARACTER) { + /* Process the token as it would be processed if the insertion mode + was "in body". */ + $this->processWithRulesFor($token, self::IN_BODY); + + /* A comment token */ + } elseif ($token['type'] === HTML5_Tokenizer::COMMENT) { + /* Append a Comment node to the first element in the stack of open + elements (the html element), with the data attribute set to the + data given in the comment token. */ + // XDOM + $comment = $this->dom->createComment($token['data']); + $this->stack[0]->appendChild($comment); + + } elseif ($token['type'] === HTML5_Tokenizer::DOCTYPE) { + // parse error + + } elseif ($token['type'] === HTML5_Tokenizer::STARTTAG && $token['name'] === 'html') { + $this->processWithRulesFor($token, self::IN_BODY); + + /* An end tag with the tag name "html" */ + } elseif ($token['type'] === HTML5_Tokenizer::ENDTAG && $token['name'] === 'html') { + /* If the parser was originally created as part of the HTML + * fragment parsing algorithm, this is a parse error; ignore + * the token. (fragment case) */ + $this->ignored = true; + // XERROR: implement this + + $this->mode = self::AFTER_AFTER_BODY; + + } elseif ($token['type'] === HTML5_Tokenizer::EOF) { + /* Stop parsing */ + + /* Anything else */ + } else { + /* Parse error. Set the insertion mode to "in body" and reprocess + the token. */ + $this->mode = self::IN_BODY; + $this->emitToken($token); + } + break; + + case self::IN_FRAMESET: + /* Handle the token as follows: */ + + /* A character token that is one of one of U+0009 CHARACTER TABULATION, + U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), + U+000D CARRIAGE RETURN (CR), or U+0020 SPACE */ + if ($token['type'] === HTML5_Tokenizer::SPACECHARACTER) { + /* Append the character to the current node. */ + $this->insertText($token['data']); + + /* A comment token */ + } elseif ($token['type'] === HTML5_Tokenizer::COMMENT) { + /* Append a Comment node to the current node with the data + attribute set to the data given in the comment token. */ + $this->insertComment($token['data']); + + } elseif ($token['type'] === HTML5_Tokenizer::DOCTYPE) { + // parse error + + /* A start tag with the tag name "frameset" */ + } elseif ($token['type'] === HTML5_Tokenizer::STARTTAG && + $token['name'] === 'frameset') { + $this->insertElement($token); + + /* An end tag with the tag name "frameset" */ + } elseif ($token['type'] === HTML5_Tokenizer::ENDTAG && + $token['name'] === 'frameset') { + /* If the current node is the root html element, then this is a + parse error; ignore the token. (fragment case) */ + if (end($this->stack)->tagName === 'html') { + $this->ignored = true; + // Parse error + + } else { + /* Otherwise, pop the current node from the stack of open + elements. */ + array_pop($this->stack); + + /* If the parser was not originally created as part of the HTML + * fragment parsing algorithm (fragment case), and the current + * node is no longer a frameset element, then switch the + * insertion mode to "after frameset". */ + $this->mode = self::AFTER_FRAMESET; + } + + /* A start tag with the tag name "frame" */ + } elseif ($token['type'] === HTML5_Tokenizer::STARTTAG && + $token['name'] === 'frame') { + /* Insert an HTML element for the token. */ + $this->insertElement($token); + + /* Immediately pop the current node off the stack of open elements. */ + array_pop($this->stack); + + // XERROR: Acknowledge the token's self-closing flag, if it is set. + + /* A start tag with the tag name "noframes" */ + } elseif ($token['type'] === HTML5_Tokenizer::STARTTAG && + $token['name'] === 'noframes') { + /* Process the token using the rules for the "in head" insertion mode. */ + $this->processwithRulesFor($token, self::IN_HEAD); + + } elseif ($token['type'] === HTML5_Tokenizer::EOF) { + // XERROR: If the current node is not the root html element, then this is a parse error. + /* Stop parsing */ + /* Anything else */ + } else { + /* Parse error. Ignore the token. */ + $this->ignored = true; + } + break; + + case self::AFTER_FRAMESET: + /* Handle the token as follows: */ + + /* A character token that is one of one of U+0009 CHARACTER TABULATION, + U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), + U+000D CARRIAGE RETURN (CR), or U+0020 SPACE */ + if ($token['type'] === HTML5_Tokenizer::SPACECHARACTER) { + /* Append the character to the current node. */ + $this->insertText($token['data']); + + /* A comment token */ + } elseif ($token['type'] === HTML5_Tokenizer::COMMENT) { + /* Append a Comment node to the current node with the data + attribute set to the data given in the comment token. */ + $this->insertComment($token['data']); + + } elseif ($token['type'] === HTML5_Tokenizer::DOCTYPE) { + // parse error + + } elseif ($token['type'] === HTML5_Tokenizer::STARTTAG && $token['name'] === 'html') { + $this->processWithRulesFor($token, self::IN_BODY); + + /* An end tag with the tag name "html" */ + } elseif ($token['type'] === HTML5_Tokenizer::ENDTAG && + $token['name'] === 'html') { + $this->mode = self::AFTER_AFTER_FRAMESET; + + /* A start tag with the tag name "noframes" */ + } elseif ($token['type'] === HTML5_Tokenizer::STARTTAG && + $token['name'] === 'noframes') { + $this->processWithRulesFor($token, self::IN_HEAD); + + } elseif ($token['type'] === HTML5_Tokenizer::EOF) { + /* Stop parsing */ + + /* Anything else */ + } else { + /* Parse error. Ignore the token. */ + $this->ignored = true; + } + break; + + case self::AFTER_AFTER_BODY: + /* A comment token */ + if ($token['type'] === HTML5_Tokenizer::COMMENT) { + /* Append a Comment node to the Document object with the data + attribute set to the data given in the comment token. */ + // XDOM + $comment = $this->dom->createComment($token['data']); + $this->dom->appendChild($comment); + + } elseif ($token['type'] === HTML5_Tokenizer::DOCTYPE || + $token['type'] === HTML5_Tokenizer::SPACECHARACTER || + ($token['type'] === HTML5_Tokenizer::STARTTAG && $token['name'] === 'html')) { + $this->processWithRulesFor($token, self::IN_BODY); + + /* An end-of-file token */ + } elseif ($token['type'] === HTML5_Tokenizer::EOF) { + /* OMG DONE!! */ + } else { + // parse error + $this->mode = self::IN_BODY; + $this->emitToken($token); + } + break; + + case self::AFTER_AFTER_FRAMESET: + /* A comment token */ + if ($token['type'] === HTML5_Tokenizer::COMMENT) { + /* Append a Comment node to the Document object with the data + attribute set to the data given in the comment token. */ + // XDOM + $comment = $this->dom->createComment($token['data']); + $this->dom->appendChild($comment); + } elseif ($token['type'] === HTML5_Tokenizer::DOCTYPE || + $token['type'] === HTML5_Tokenizer::SPACECHARACTER || + ($token['type'] === HTML5_Tokenizer::STARTTAG && $token['name'] === 'html')) { + $this->processWithRulesFor($token, self::IN_BODY); + + /* An end-of-file token */ + } elseif ($token['type'] === HTML5_Tokenizer::EOF) { + /* OMG DONE!! */ + } elseif ($token['type'] === HTML5_Tokenizer::STARTTAG && $token['name'] === 'nofrmaes') { + $this->processWithRulesFor($token, self::IN_HEAD); + } else { + // parse error + } + break; + } + } + + private function insertElement($token, $append = true) { + $el = $this->dom->createElementNS(self::NS_HTML, $token['name']); + + if (!empty($token['attr'])) { + foreach ($token['attr'] as $attr) { + if (!$el->hasAttribute($attr['name']) && preg_match("/^[a-zA-Z_:]/", $attr['name'])) { + $el->setAttribute($attr['name'], $attr['value']); + } + } + } + if ($append) { + $this->appendToRealParent($el); + $this->stack[] = $el; + } + + return $el; + } + + /** + * @param $data + */ + private function insertText($data) { + if ($data === '') return; + if ($this->ignore_lf_token) { + if ($data[0] === "\n") { + $data = substr($data, 1); + if ($data === false) return; + } + } + $text = $this->dom->createTextNode($data); + $this->appendToRealParent($text); + } + + /** + * @param $data + */ + private function insertComment($data) { + $comment = $this->dom->createComment($data); + $this->appendToRealParent($comment); + } + + /** + * @param $node + */ + private function appendToRealParent($node) { + // this is only for the foster_parent case + /* If the current node is a table, tbody, tfoot, thead, or tr + element, then, whenever a node would be inserted into the current + node, it must instead be inserted into the foster parent element. */ + if (!$this->foster_parent || !in_array(end($this->stack)->tagName, + array('table', 'tbody', 'tfoot', 'thead', 'tr'))) { + end($this->stack)->appendChild($node); + } else { + $this->fosterParent($node); + } + } + + /** + * @param $el + * @param int $scope + * @return bool|null + */ + private function elementInScope($el, $scope = self::SCOPE) { + if (is_array($el)) { + foreach($el as $element) { + if ($this->elementInScope($element, $scope)) { + return true; + } + } + + return false; + } + + $leng = count($this->stack); + + for ($n = 0; $n < $leng; $n++) { + /* 1. Initialise node to be the current node (the bottommost node of + the stack). */ + $node = $this->stack[$leng - 1 - $n]; + + if ($node->tagName === $el) { + /* 2. If node is the target node, terminate in a match state. */ + return true; + + // We've expanded the logic for these states a little differently; + // Hixie's refactoring into "specific scope" is more general, but + // this "gets the job done" + + // these are the common states for all scopes + } elseif ($node->tagName === 'table' || $node->tagName === 'html') { + return false; + + // these are valid for "in scope" and "in list item scope" + } elseif ($scope !== self::SCOPE_TABLE && + (in_array($node->tagName, array('applet', 'caption', 'td', + 'th', 'button', 'marquee', 'object')) || + $node->tagName === 'foreignObject' && $node->namespaceURI === self::NS_SVG)) { + return false; + + + // these are valid for "in list item scope" + } elseif ($scope === self::SCOPE_LISTITEM && in_array($node->tagName, array('ol', 'ul'))) { + return false; + } + + /* Otherwise, set node to the previous entry in the stack of open + elements and return to step 2. (This will never fail, since the loop + will always terminate in the previous step if the top of the stack + is reached.) */ + } + + // To fix warning. This never happens or should return true/false + return null; + } + + /** + * @return bool + */ + private function reconstructActiveFormattingElements() { + /* 1. If there are no entries in the list of active formatting elements, + then there is nothing to reconstruct; stop this algorithm. */ + $formatting_elements = count($this->a_formatting); + + if ($formatting_elements === 0) { + return false; + } + + /* 3. Let entry be the last (most recently added) element in the list + of active formatting elements. */ + $entry = end($this->a_formatting); + + /* 2. If the last (most recently added) entry in the list of active + formatting elements is a marker, or if it is an element that is in the + stack of open elements, then there is nothing to reconstruct; stop this + algorithm. */ + if ($entry === self::MARKER || in_array($entry, $this->stack, true)) { + return false; + } + + for ($a = $formatting_elements - 1; $a >= 0; true) { + /* 4. If there are no entries before entry in the list of active + formatting elements, then jump to step 8. */ + if ($a === 0) { + $step_seven = false; + break; + } + + /* 5. Let entry be the entry one earlier than entry in the list of + active formatting elements. */ + $a--; + $entry = $this->a_formatting[$a]; + + /* 6. If entry is neither a marker nor an element that is also in + thetack of open elements, go to step 4. */ + if ($entry === self::MARKER || in_array($entry, $this->stack, true)) { + break; + } + } + + while (true) { + /* 7. Let entry be the element one later than entry in the list of + active formatting elements. */ + if (isset($step_seven) && $step_seven === true) { + $a++; + $entry = $this->a_formatting[$a]; + } + + /* 8. Perform a shallow clone of the element entry to obtain clone. */ + $clone = $entry->cloneNode(); + + /* 9. Append clone to the current node and push it onto the stack + of open elements so that it is the new current node. */ + $this->appendToRealParent($clone); + $this->stack[] = $clone; + + /* 10. Replace the entry for entry in the list with an entry for + clone. */ + $this->a_formatting[$a] = $clone; + + /* 11. If the entry for clone in the list of active formatting + elements is not the last entry in the list, return to step 7. */ + if (end($this->a_formatting) !== $clone) { + $step_seven = true; + } else { + break; + } + } + + // Return value not in use ATM. Would just make sense to also return true here. + return true; + } + + /** + * + */ + private function clearTheActiveFormattingElementsUpToTheLastMarker() { + /* When the steps below require the UA to clear the list of active + formatting elements up to the last marker, the UA must perform the + following steps: */ + + while (true) { + /* 1. Let entry be the last (most recently added) entry in the list + of active formatting elements. */ + $entry = end($this->a_formatting); + + /* 2. Remove entry from the list of active formatting elements. */ + array_pop($this->a_formatting); + + /* 3. If entry was a marker, then stop the algorithm at this point. + The list has been cleared up to the last marker. */ + if ($entry === self::MARKER) { + break; + } + } + } + + /** + * @param array $exclude + */ + private function generateImpliedEndTags($exclude = array()) { + /* When the steps below require the UA to generate implied end tags, + * then, while the current node is a dc element, a dd element, a ds + * element, a dt element, an li element, an option element, an optgroup + * element, a p element, an rp element, or an rt element, the UA must + * pop the current node off the stack of open elements. */ + $node = end($this->stack); + $elements = array_diff(array('dc', 'dd', 'ds', 'dt', 'li', 'p', 'td', 'th', 'tr'), $exclude); + + while (in_array(end($this->stack)->tagName, $elements)) { + array_pop($this->stack); + } + } + + /** + * @param $node + * @return int + */ + private function getElementCategory($node) { + if (!is_object($node)) { + debug_print_backtrace(); + } + $name = $node->tagName; + if (in_array($name, $this->special)) { + return self::SPECIAL; + } elseif (in_array($name, $this->scoping)) { + return self::SCOPING; + } elseif (in_array($name, $this->formatting)) { + return self::FORMATTING; + } else { + return self::PHRASING; + } + } + + /** + * @param $elements + */ + private function clearStackToTableContext($elements) { + /* When the steps above require the UA to clear the stack back to a + table context, it means that the UA must, while the current node is not + a table element or an html element, pop elements from the stack of open + elements. */ + while (true) { + $name = end($this->stack)->tagName; + + if (in_array($name, $elements)) { + break; + } else { + array_pop($this->stack); + } + } + } + + /** + * @param null $context + */ + private function resetInsertionMode($context = null) { + /* 1. Let last be false. */ + $last = false; + $leng = count($this->stack); + + for ($n = $leng - 1; $n >= 0; $n--) { + /* 2. Let node be the last node in the stack of open elements. */ + $node = $this->stack[$n]; + + /* 3. If node is the first node in the stack of open elements, then + * set last to true and set node to the context element. (fragment + * case) */ + if ($this->stack[0]->isSameNode($node)) { + $last = true; + $node = $context; + } + + /* 4. If node is a select element, then switch the insertion mode to + "in select" and abort these steps. (fragment case) */ + if ($node->tagName === 'select') { + $this->mode = self::IN_SELECT; + break; + + /* 5. If node is a td or th element, then switch the insertion mode + to "in cell" and abort these steps. */ + } elseif ($node->tagName === 'td' || $node->nodeName === 'th') { + $this->mode = self::IN_CELL; + break; + + /* 6. If node is a tr element, then switch the insertion mode to + "in row" and abort these steps. */ + } elseif ($node->tagName === 'tr') { + $this->mode = self::IN_ROW; + break; + + /* 7. If node is a tbody, thead, or tfoot element, then switch the + insertion mode to "in table body" and abort these steps. */ + } elseif (in_array($node->tagName, array('tbody', 'thead', 'tfoot'))) { + $this->mode = self::IN_TABLE_BODY; + break; + + /* 8. If node is a caption element, then switch the insertion mode + to "in caption" and abort these steps. */ + } elseif ($node->tagName === 'caption') { + $this->mode = self::IN_CAPTION; + break; + + /* 9. If node is a colgroup element, then switch the insertion mode + to "in column group" and abort these steps. (innerHTML case) */ + } elseif ($node->tagName === 'colgroup') { + $this->mode = self::IN_COLUMN_GROUP; + break; + + /* 10. If node is a table element, then switch the insertion mode + to "in table" and abort these steps. */ + } elseif ($node->tagName === 'table') { + $this->mode = self::IN_TABLE; + break; + + /* 11. If node is an element from the MathML namespace or the SVG + * namespace, then switch the insertion mode to "in foreign + * content", let the secondary insertion mode be "in body", and + * abort these steps. */ + } elseif ($node->namespaceURI === self::NS_SVG || + $node->namespaceURI === self::NS_MATHML) { + $this->mode = self::IN_FOREIGN_CONTENT; + $this->secondary_mode = self::IN_BODY; + break; + + /* 12. If node is a head element, then switch the insertion mode + to "in body" ("in body"! not "in head"!) and abort these steps. + (fragment case) */ + } elseif ($node->tagName === 'head') { + $this->mode = self::IN_BODY; + break; + + /* 13. If node is a body element, then switch the insertion mode to + "in body" and abort these steps. */ + } elseif ($node->tagName === 'body') { + $this->mode = self::IN_BODY; + break; + + /* 14. If node is a frameset element, then switch the insertion + mode to "in frameset" and abort these steps. (fragment case) */ + } elseif ($node->tagName === 'frameset') { + $this->mode = self::IN_FRAMESET; + break; + + /* 15. If node is an html element, then: if the head element + pointer is null, switch the insertion mode to "before head", + otherwise, switch the insertion mode to "after head". In either + case, abort these steps. (fragment case) */ + } elseif ($node->tagName === 'html') { + $this->mode = ($this->head_pointer === null) + ? self::BEFORE_HEAD + : self::AFTER_HEAD; + + break; + + /* 16. If last is true, then set the insertion mode to "in body" + and abort these steps. (fragment case) */ + } elseif ($last) { + $this->mode = self::IN_BODY; + break; + } + } + } + + /** + * + */ + private function closeCell() { + /* If the stack of open elements has a td or th element in table scope, + then act as if an end tag token with that tag name had been seen. */ + foreach (array('td', 'th') as $cell) { + if ($this->elementInScope($cell, self::SCOPE_TABLE)) { + $this->emitToken(array( + 'name' => $cell, + 'type' => HTML5_Tokenizer::ENDTAG + )); + + break; + } + } + } + + /** + * @param $token + * @param $mode + */ + private function processWithRulesFor($token, $mode) { + /* "using the rules for the m insertion mode", where m is one of these + * modes, the user agent must use the rules described under the m + * insertion mode's section, but must leave the insertion mode + * unchanged unless the rules in m themselves switch the insertion mode + * to a new value. */ + $this->emitToken($token, $mode); + } + + /** + * @param $token + */ + private function insertCDATAElement($token) { + $this->insertElement($token); + $this->original_mode = $this->mode; + $this->mode = self::IN_CDATA_RCDATA; + $this->content_model = HTML5_Tokenizer::CDATA; + } + + /** + * @param $token + */ + private function insertRCDATAElement($token) { + $this->insertElement($token); + $this->original_mode = $this->mode; + $this->mode = self::IN_CDATA_RCDATA; + $this->content_model = HTML5_Tokenizer::RCDATA; + } + + /** + * @param $token + * @param $key + * @return bool + */ + private function getAttr($token, $key) { + if (!isset($token['attr'])) return false; + $ret = false; + foreach ($token['attr'] as $keypair) { + if ($keypair['name'] === $key) $ret = $keypair['value']; + } + return $ret; + } + + /** + * @return mixed + */ + private function getCurrentTable() { + /* The current table is the last table element in the stack of open + * elements, if there is one. If there is no table element in the stack + * of open elements (fragment case), then the current table is the + * first element in the stack of open elements (the html element). */ + for ($i = count($this->stack) - 1; $i >= 0; $i--) { + if ($this->stack[$i]->tagName === 'table') { + return $this->stack[$i]; + } + } + return $this->stack[0]; + } + + /** + * @return mixed + */ + private function getFosterParent() { + /* The foster parent element is the parent element of the last + table element in the stack of open elements, if there is a + table element and it has such a parent element. If there is no + table element in the stack of open elements (innerHTML case), + then the foster parent element is the first element in the + stack of open elements (the html element). Otherwise, if there + is a table element in the stack of open elements, but the last + table element in the stack of open elements has no parent, or + its parent node is not an element, then the foster parent + element is the element before the last table element in the + stack of open elements. */ + for ($n = count($this->stack) - 1; $n >= 0; $n--) { + if ($this->stack[$n]->tagName === 'table') { + $table = $this->stack[$n]; + break; + } + } + + if (isset($table) && $table->parentNode !== null) { + return $table->parentNode; + + } elseif (!isset($table)) { + return $this->stack[0]; + + } elseif (isset($table) && ($table->parentNode === null || + $table->parentNode->nodeType !== XML_ELEMENT_NODE)) { + return $this->stack[$n - 1]; + } + + return null; + } + + /** + * @param $node + */ + public function fosterParent($node) { + $foster_parent = $this->getFosterParent(); + $table = $this->getCurrentTable(); // almost equivalent to last table element, except it can be html + /* When a node node is to be foster parented, the node node must be + * be inserted into the foster parent element. */ + /* If the foster parent element is the parent element of the last table + * element in the stack of open elements, then node must be inserted + * immediately before the last table element in the stack of open + * elements in the foster parent element; otherwise, node must be + * appended to the foster parent element. */ + if ($table->tagName === 'table' && $table->parentNode->isSameNode($foster_parent)) { + $foster_parent->insertBefore($node, $table); + } else { + $foster_parent->appendChild($node); + } + } + + /** + * For debugging, prints the stack + */ + private function printStack() { + $names = array(); + foreach ($this->stack as $i => $element) { + $names[] = $element->tagName; + } + echo " -> stack [" . implode(', ', $names) . "]\n"; + } + + /** + * For debugging, prints active formatting elements + */ + private function printActiveFormattingElements() { + if (!$this->a_formatting) return; + $names = array(); + foreach ($this->a_formatting as $node) { + if ($node === self::MARKER) $names[] = 'MARKER'; + else $names[] = $node->tagName; + } + echo " -> active formatting [" . implode(', ', $names) . "]\n"; + } + + /** + * @return bool + */ + public function currentTableIsTainted() { + return !empty($this->getCurrentTable()->tainted); + } + + /** + * Sets up the tree constructor for building a fragment. + * + * @param null $context + */ + public function setupContext($context = null) { + $this->fragment = true; + if ($context) { + $context = $this->dom->createElementNS(self::NS_HTML, $context); + /* 4.1. Set the HTML parser's tokenization stage's content model + * flag according to the context element, as follows: */ + switch ($context->tagName) { + case 'title': case 'textarea': + $this->content_model = HTML5_Tokenizer::RCDATA; + break; + case 'style': case 'script': case 'xmp': case 'iframe': + case 'noembed': case 'noframes': + $this->content_model = HTML5_Tokenizer::CDATA; + break; + case 'noscript': + // XSCRIPT: assuming scripting is enabled + $this->content_model = HTML5_Tokenizer::CDATA; + break; + case 'plaintext': + $this->content_model = HTML5_Tokenizer::PLAINTEXT; + break; + } + /* 4.2. Let root be a new html element with no attributes. */ + $root = $this->dom->createElementNS(self::NS_HTML, 'html'); + $this->root = $root; + /* 4.3 Append the element root to the Document node created above. */ + $this->dom->appendChild($root); + /* 4.4 Set up the parser's stack of open elements so that it + * contains just the single element root. */ + $this->stack = array($root); + /* 4.5 Reset the parser's insertion mode appropriately. */ + $this->resetInsertionMode($context); + /* 4.6 Set the parser's form element pointer to the nearest node + * to the context element that is a form element (going straight up + * the ancestor chain, and including the element itself, if it is a + * form element), or, if there is no such form element, to null. */ + $node = $context; + do { + if ($node->tagName === 'form') { + $this->form_pointer = $node; + break; + } + } while ($node = $node->parentNode); + } + } + + /** + * @param $token + * @return mixed + */ + public function adjustMathMLAttributes($token) { + foreach ($token['attr'] as &$kp) { + if ($kp['name'] === 'definitionurl') { + $kp['name'] = 'definitionURL'; + } + } + return $token; + } + + /** + * @param $token + * @return mixed + */ + public function adjustSVGAttributes($token) { + static $lookup = array( + 'attributename' => 'attributeName', + 'attributetype' => 'attributeType', + 'basefrequency' => 'baseFrequency', + 'baseprofile' => 'baseProfile', + 'calcmode' => 'calcMode', + 'clippathunits' => 'clipPathUnits', + 'contentscripttype' => 'contentScriptType', + 'contentstyletype' => 'contentStyleType', + 'diffuseconstant' => 'diffuseConstant', + 'edgemode' => 'edgeMode', + 'externalresourcesrequired' => 'externalResourcesRequired', + 'filterres' => 'filterRes', + 'filterunits' => 'filterUnits', + 'glyphref' => 'glyphRef', + 'gradienttransform' => 'gradientTransform', + 'gradientunits' => 'gradientUnits', + 'kernelmatrix' => 'kernelMatrix', + 'kernelunitlength' => 'kernelUnitLength', + 'keypoints' => 'keyPoints', + 'keysplines' => 'keySplines', + 'keytimes' => 'keyTimes', + 'lengthadjust' => 'lengthAdjust', + 'limitingconeangle' => 'limitingConeAngle', + 'markerheight' => 'markerHeight', + 'markerunits' => 'markerUnits', + 'markerwidth' => 'markerWidth', + 'maskcontentunits' => 'maskContentUnits', + 'maskunits' => 'maskUnits', + 'numoctaves' => 'numOctaves', + 'pathlength' => 'pathLength', + 'patterncontentunits' => 'patternContentUnits', + 'patterntransform' => 'patternTransform', + 'patternunits' => 'patternUnits', + 'pointsatx' => 'pointsAtX', + 'pointsaty' => 'pointsAtY', + 'pointsatz' => 'pointsAtZ', + 'preservealpha' => 'preserveAlpha', + 'preserveaspectratio' => 'preserveAspectRatio', + 'primitiveunits' => 'primitiveUnits', + 'refx' => 'refX', + 'refy' => 'refY', + 'repeatcount' => 'repeatCount', + 'repeatdur' => 'repeatDur', + 'requiredextensions' => 'requiredExtensions', + 'requiredfeatures' => 'requiredFeatures', + 'specularconstant' => 'specularConstant', + 'specularexponent' => 'specularExponent', + 'spreadmethod' => 'spreadMethod', + 'startoffset' => 'startOffset', + 'stddeviation' => 'stdDeviation', + 'stitchtiles' => 'stitchTiles', + 'surfacescale' => 'surfaceScale', + 'systemlanguage' => 'systemLanguage', + 'tablevalues' => 'tableValues', + 'targetx' => 'targetX', + 'targety' => 'targetY', + 'textlength' => 'textLength', + 'viewbox' => 'viewBox', + 'viewtarget' => 'viewTarget', + 'xchannelselector' => 'xChannelSelector', + 'ychannelselector' => 'yChannelSelector', + 'zoomandpan' => 'zoomAndPan', + ); + foreach ($token['attr'] as &$kp) { + if (isset($lookup[$kp['name']])) { + $kp['name'] = $lookup[$kp['name']]; + } + } + return $token; + } + + /** + * @param $token + * @return mixed + */ + public function adjustForeignAttributes($token) { + static $lookup = array( + 'xlink:actuate' => array('xlink', 'actuate', self::NS_XLINK), + 'xlink:arcrole' => array('xlink', 'arcrole', self::NS_XLINK), + 'xlink:href' => array('xlink', 'href', self::NS_XLINK), + 'xlink:role' => array('xlink', 'role', self::NS_XLINK), + 'xlink:show' => array('xlink', 'show', self::NS_XLINK), + 'xlink:title' => array('xlink', 'title', self::NS_XLINK), + 'xlink:type' => array('xlink', 'type', self::NS_XLINK), + 'xml:base' => array('xml', 'base', self::NS_XML), + 'xml:lang' => array('xml', 'lang', self::NS_XML), + 'xml:space' => array('xml', 'space', self::NS_XML), + 'xmlns' => array(null, 'xmlns', self::NS_XMLNS), + 'xmlns:xlink' => array('xmlns', 'xlink', self::NS_XMLNS), + ); + foreach ($token['attr'] as &$kp) { + if (isset($lookup[$kp['name']])) { + $kp['name'] = $lookup[$kp['name']]; + } + } + return $token; + } + + /** + * @param $token + * @param $namespaceURI + */ + public function insertForeignElement($token, $namespaceURI) { + $el = $this->dom->createElementNS($namespaceURI, $token['name']); + + if (!empty($token['attr'])) { + foreach ($token['attr'] as $kp) { + $attr = $kp['name']; + if (is_array($attr)) { + $ns = $attr[2]; + $attr = $attr[1]; + } else { + $ns = self::NS_HTML; + } + if (!$el->hasAttributeNS($ns, $attr)) { + // XSKETCHY: work around godawful libxml bug + if ($ns === self::NS_XLINK) { + $el->setAttribute('xlink:'.$attr, $kp['value']); + } elseif ($ns === self::NS_HTML) { + // Another godawful libxml bug + $el->setAttribute($attr, $kp['value']); + } else { + $el->setAttributeNS($ns, $attr, $kp['value']); + } + } + } + } + $this->appendToRealParent($el); + $this->stack[] = $el; + // XERROR: see below + /* If the newly created element has an xmlns attribute in the XMLNS + * namespace whose value is not exactly the same as the element's + * namespace, that is a parse error. Similarly, if the newly created + * element has an xmlns:xlink attribute in the XMLNS namespace whose + * value is not the XLink Namespace, that is a parse error. */ + } + + /** + * @return DOMDocument|DOMNodeList + */ + public function save() { + $this->dom->normalize(); + if (!$this->fragment) { + return $this->dom; + } else { + if ($this->root) { + return $this->root->childNodes; + } else { + return $this->dom->childNodes; + } + } + } +} + diff --git a/lib/dompdf/lib/html5lib/named-character-references.ser b/lib/dompdf/lib/html5lib/named-character-references.ser new file mode 100644 index 0000000..e3ae050 --- /dev/null +++ b/lib/dompdf/lib/html5lib/named-character-references.ser @@ -0,0 +1 @@ +a:52:{s:1:"A";a:16:{s:1:"E";a:1:{s:1:"l";a:1:{s:1:"i";a:1:{s:1:"g";a:2:{s:1:";";a:1:{s:9:"codepoint";i:198;}s:9:"codepoint";i:198;}}}}s:1:"M";a:1:{s:1:"P";a:2:{s:1:";";a:1:{s:9:"codepoint";i:38;}s:9:"codepoint";i:38;}}s:1:"a";a:1:{s:1:"c";a:1:{s:1:"u";a:1:{s:1:"t";a:1:{s:1:"e";a:2:{s:1:";";a:1:{s:9:"codepoint";i:193;}s:9:"codepoint";i:193;}}}}}s:1:"b";a:1:{s:1:"r";a:1:{s:1:"e";a:1:{s:1:"v";a:1:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:258;}}}}}}s:1:"c";a:2:{s:1:"i";a:1:{s:1:"r";a:1:{s:1:"c";a:2:{s:1:";";a:1:{s:9:"codepoint";i:194;}s:9:"codepoint";i:194;}}}s:1:"y";a:1:{s:1:";";a:1:{s:9:"codepoint";i:1040;}}}s:1:"f";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:120068;}}}s:1:"g";a:1:{s:1:"r";a:1:{s:1:"a";a:1:{s:1:"v";a:1:{s:1:"e";a:2:{s:1:";";a:1:{s:9:"codepoint";i:192;}s:9:"codepoint";i:192;}}}}}s:1:"l";a:1:{s:1:"p";a:1:{s:1:"h";a:1:{s:1:"a";a:1:{s:1:";";a:1:{s:9:"codepoint";i:913;}}}}}s:1:"m";a:1:{s:1:"a";a:1:{s:1:"c";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:256;}}}}}s:1:"n";a:1:{s:1:"d";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10835;}}}s:1:"o";a:2:{s:1:"g";a:1:{s:1:"o";a:1:{s:1:"n";a:1:{s:1:";";a:1:{s:9:"codepoint";i:260;}}}}s:1:"p";a:1:{s:1:"f";a:1:{s:1:";";a:1:{s:9:"codepoint";i:120120;}}}}s:1:"p";a:1:{s:1:"p";a:1:{s:1:"l";a:1:{s:1:"y";a:1:{s:1:"F";a:1:{s:1:"u";a:1:{s:1:"n";a:1:{s:1:"c";a:1:{s:1:"t";a:1:{s:1:"i";a:1:{s:1:"o";a:1:{s:1:"n";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8289;}}}}}}}}}}}}}s:1:"r";a:1:{s:1:"i";a:1:{s:1:"n";a:1:{s:1:"g";a:2:{s:1:";";a:1:{s:9:"codepoint";i:197;}s:9:"codepoint";i:197;}}}}s:1:"s";a:2:{s:1:"c";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:119964;}}}s:1:"s";a:1:{s:1:"i";a:1:{s:1:"g";a:1:{s:1:"n";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8788;}}}}}}s:1:"t";a:1:{s:1:"i";a:1:{s:1:"l";a:1:{s:1:"d";a:1:{s:1:"e";a:2:{s:1:";";a:1:{s:9:"codepoint";i:195;}s:9:"codepoint";i:195;}}}}}s:1:"u";a:1:{s:1:"m";a:1:{s:1:"l";a:2:{s:1:";";a:1:{s:9:"codepoint";i:196;}s:9:"codepoint";i:196;}}}}s:1:"B";a:8:{s:1:"a";a:2:{s:1:"c";a:1:{s:1:"k";a:1:{s:1:"s";a:1:{s:1:"l";a:1:{s:1:"a";a:1:{s:1:"s";a:1:{s:1:"h";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8726;}}}}}}}}s:1:"r";a:2:{s:1:"v";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10983;}}s:1:"w";a:1:{s:1:"e";a:1:{s:1:"d";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8966;}}}}}}s:1:"c";a:1:{s:1:"y";a:1:{s:1:";";a:1:{s:9:"codepoint";i:1041;}}}s:1:"e";a:3:{s:1:"c";a:1:{s:1:"a";a:1:{s:1:"u";a:1:{s:1:"s";a:1:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8757;}}}}}}s:1:"r";a:1:{s:1:"n";a:1:{s:1:"o";a:1:{s:1:"u";a:1:{s:1:"l";a:1:{s:1:"l";a:1:{s:1:"i";a:1:{s:1:"s";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8492;}}}}}}}}}s:1:"t";a:1:{s:1:"a";a:1:{s:1:";";a:1:{s:9:"codepoint";i:914;}}}}s:1:"f";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:120069;}}}s:1:"o";a:1:{s:1:"p";a:1:{s:1:"f";a:1:{s:1:";";a:1:{s:9:"codepoint";i:120121;}}}}s:1:"r";a:1:{s:1:"e";a:1:{s:1:"v";a:1:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:728;}}}}}s:1:"s";a:1:{s:1:"c";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8492;}}}}s:1:"u";a:1:{s:1:"m";a:1:{s:1:"p";a:1:{s:1:"e";a:1:{s:1:"q";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8782;}}}}}}}s:1:"C";a:14:{s:1:"H";a:1:{s:1:"c";a:1:{s:1:"y";a:1:{s:1:";";a:1:{s:9:"codepoint";i:1063;}}}}s:1:"O";a:1:{s:1:"P";a:1:{s:1:"Y";a:2:{s:1:";";a:1:{s:9:"codepoint";i:169;}s:9:"codepoint";i:169;}}}s:1:"a";a:3:{s:1:"c";a:1:{s:1:"u";a:1:{s:1:"t";a:1:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:262;}}}}}s:1:"p";a:2:{s:1:";";a:1:{s:9:"codepoint";i:8914;}s:1:"i";a:1:{s:1:"t";a:1:{s:1:"a";a:1:{s:1:"l";a:1:{s:1:"D";a:1:{s:1:"i";a:1:{s:1:"f";a:1:{s:1:"f";a:1:{s:1:"e";a:1:{s:1:"r";a:1:{s:1:"e";a:1:{s:1:"n";a:1:{s:1:"t";a:1:{s:1:"i";a:1:{s:1:"a";a:1:{s:1:"l";a:1:{s:1:"D";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8517;}}}}}}}}}}}}}}}}}}}s:1:"y";a:1:{s:1:"l";a:1:{s:1:"e";a:1:{s:1:"y";a:1:{s:1:"s";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8493;}}}}}}}s:1:"c";a:4:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:"o";a:1:{s:1:"n";a:1:{s:1:";";a:1:{s:9:"codepoint";i:268;}}}}}s:1:"e";a:1:{s:1:"d";a:1:{s:1:"i";a:1:{s:1:"l";a:2:{s:1:";";a:1:{s:9:"codepoint";i:199;}s:9:"codepoint";i:199;}}}}s:1:"i";a:1:{s:1:"r";a:1:{s:1:"c";a:1:{s:1:";";a:1:{s:9:"codepoint";i:264;}}}}s:1:"o";a:1:{s:1:"n";a:1:{s:1:"i";a:1:{s:1:"n";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8752;}}}}}}}s:1:"d";a:1:{s:1:"o";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:266;}}}}s:1:"e";a:2:{s:1:"d";a:1:{s:1:"i";a:1:{s:1:"l";a:1:{s:1:"l";a:1:{s:1:"a";a:1:{s:1:";";a:1:{s:9:"codepoint";i:184;}}}}}}s:1:"n";a:1:{s:1:"t";a:1:{s:1:"e";a:1:{s:1:"r";a:1:{s:1:"D";a:1:{s:1:"o";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:183;}}}}}}}}}s:1:"f";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8493;}}}s:1:"h";a:1:{s:1:"i";a:1:{s:1:";";a:1:{s:9:"codepoint";i:935;}}}s:1:"i";a:1:{s:1:"r";a:1:{s:1:"c";a:1:{s:1:"l";a:1:{s:1:"e";a:4:{s:1:"D";a:1:{s:1:"o";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8857;}}}}s:1:"M";a:1:{s:1:"i";a:1:{s:1:"n";a:1:{s:1:"u";a:1:{s:1:"s";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8854;}}}}}}s:1:"P";a:1:{s:1:"l";a:1:{s:1:"u";a:1:{s:1:"s";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8853;}}}}}s:1:"T";a:1:{s:1:"i";a:1:{s:1:"m";a:1:{s:1:"e";a:1:{s:1:"s";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8855;}}}}}}}}}}}s:1:"l";a:1:{s:1:"o";a:2:{s:1:"c";a:1:{s:1:"k";a:1:{s:1:"w";a:1:{s:1:"i";a:1:{s:1:"s";a:1:{s:1:"e";a:1:{s:1:"C";a:1:{s:1:"o";a:1:{s:1:"n";a:1:{s:1:"t";a:1:{s:1:"o";a:1:{s:1:"u";a:1:{s:1:"r";a:1:{s:1:"I";a:1:{s:1:"n";a:1:{s:1:"t";a:1:{s:1:"e";a:1:{s:1:"g";a:1:{s:1:"r";a:1:{s:1:"a";a:1:{s:1:"l";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8754;}}}}}}}}}}}}}}}}}}}}}}s:1:"s";a:1:{s:1:"e";a:1:{s:1:"C";a:1:{s:1:"u";a:1:{s:1:"r";a:1:{s:1:"l";a:1:{s:1:"y";a:2:{s:1:"D";a:1:{s:1:"o";a:1:{s:1:"u";a:1:{s:1:"b";a:1:{s:1:"l";a:1:{s:1:"e";a:1:{s:1:"Q";a:1:{s:1:"u";a:1:{s:1:"o";a:1:{s:1:"t";a:1:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8221;}}}}}}}}}}}}s:1:"Q";a:1:{s:1:"u";a:1:{s:1:"o";a:1:{s:1:"t";a:1:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8217;}}}}}}}}}}}}}}}s:1:"o";a:4:{s:1:"l";a:1:{s:1:"o";a:1:{s:1:"n";a:2:{s:1:";";a:1:{s:9:"codepoint";i:8759;}s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10868;}}}}}s:1:"n";a:3:{s:1:"g";a:1:{s:1:"r";a:1:{s:1:"u";a:1:{s:1:"e";a:1:{s:1:"n";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8801;}}}}}}}s:1:"i";a:1:{s:1:"n";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8751;}}}}s:1:"t";a:1:{s:1:"o";a:1:{s:1:"u";a:1:{s:1:"r";a:1:{s:1:"I";a:1:{s:1:"n";a:1:{s:1:"t";a:1:{s:1:"e";a:1:{s:1:"g";a:1:{s:1:"r";a:1:{s:1:"a";a:1:{s:1:"l";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8750;}}}}}}}}}}}}}}s:1:"p";a:2:{s:1:"f";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8450;}}s:1:"r";a:1:{s:1:"o";a:1:{s:1:"d";a:1:{s:1:"u";a:1:{s:1:"c";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8720;}}}}}}}}s:1:"u";a:1:{s:1:"n";a:1:{s:1:"t";a:1:{s:1:"e";a:1:{s:1:"r";a:1:{s:1:"C";a:1:{s:1:"l";a:1:{s:1:"o";a:1:{s:1:"c";a:1:{s:1:"k";a:1:{s:1:"w";a:1:{s:1:"i";a:1:{s:1:"s";a:1:{s:1:"e";a:1:{s:1:"C";a:1:{s:1:"o";a:1:{s:1:"n";a:1:{s:1:"t";a:1:{s:1:"o";a:1:{s:1:"u";a:1:{s:1:"r";a:1:{s:1:"I";a:1:{s:1:"n";a:1:{s:1:"t";a:1:{s:1:"e";a:1:{s:1:"g";a:1:{s:1:"r";a:1:{s:1:"a";a:1:{s:1:"l";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8755;}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}s:1:"r";a:1:{s:1:"o";a:1:{s:1:"s";a:1:{s:1:"s";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10799;}}}}}s:1:"s";a:1:{s:1:"c";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:119966;}}}}s:1:"u";a:1:{s:1:"p";a:2:{s:1:";";a:1:{s:9:"codepoint";i:8915;}s:1:"C";a:1:{s:1:"a";a:1:{s:1:"p";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8781;}}}}}}}s:1:"D";a:11:{s:1:"D";a:2:{s:1:";";a:1:{s:9:"codepoint";i:8517;}s:1:"o";a:1:{s:1:"t";a:1:{s:1:"r";a:1:{s:1:"a";a:1:{s:1:"h";a:1:{s:1:"d";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10513;}}}}}}}}s:1:"J";a:1:{s:1:"c";a:1:{s:1:"y";a:1:{s:1:";";a:1:{s:9:"codepoint";i:1026;}}}}s:1:"S";a:1:{s:1:"c";a:1:{s:1:"y";a:1:{s:1:";";a:1:{s:9:"codepoint";i:1029;}}}}s:1:"Z";a:1:{s:1:"c";a:1:{s:1:"y";a:1:{s:1:";";a:1:{s:9:"codepoint";i:1039;}}}}s:1:"a";a:3:{s:1:"g";a:1:{s:1:"g";a:1:{s:1:"e";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8225;}}}}}s:1:"r";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8609;}}}s:1:"s";a:1:{s:1:"h";a:1:{s:1:"v";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10980;}}}}}s:1:"c";a:2:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:"o";a:1:{s:1:"n";a:1:{s:1:";";a:1:{s:9:"codepoint";i:270;}}}}}s:1:"y";a:1:{s:1:";";a:1:{s:9:"codepoint";i:1044;}}}s:1:"e";a:1:{s:1:"l";a:2:{s:1:";";a:1:{s:9:"codepoint";i:8711;}s:1:"t";a:1:{s:1:"a";a:1:{s:1:";";a:1:{s:9:"codepoint";i:916;}}}}}s:1:"f";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:120071;}}}s:1:"i";a:2:{s:1:"a";a:2:{s:1:"c";a:1:{s:1:"r";a:1:{s:1:"i";a:1:{s:1:"t";a:1:{s:1:"i";a:1:{s:1:"c";a:1:{s:1:"a";a:1:{s:1:"l";a:4:{s:1:"A";a:1:{s:1:"c";a:1:{s:1:"u";a:1:{s:1:"t";a:1:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:180;}}}}}}s:1:"D";a:1:{s:1:"o";a:2:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:729;}}s:1:"u";a:1:{s:1:"b";a:1:{s:1:"l";a:1:{s:1:"e";a:1:{s:1:"A";a:1:{s:1:"c";a:1:{s:1:"u";a:1:{s:1:"t";a:1:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:733;}}}}}}}}}}}}s:1:"G";a:1:{s:1:"r";a:1:{s:1:"a";a:1:{s:1:"v";a:1:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:96;}}}}}}s:1:"T";a:1:{s:1:"i";a:1:{s:1:"l";a:1:{s:1:"d";a:1:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:732;}}}}}}}}}}}}}}s:1:"m";a:1:{s:1:"o";a:1:{s:1:"n";a:1:{s:1:"d";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8900;}}}}}}s:1:"f";a:1:{s:1:"f";a:1:{s:1:"e";a:1:{s:1:"r";a:1:{s:1:"e";a:1:{s:1:"n";a:1:{s:1:"t";a:1:{s:1:"i";a:1:{s:1:"a";a:1:{s:1:"l";a:1:{s:1:"D";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8518;}}}}}}}}}}}}}s:1:"o";a:4:{s:1:"p";a:1:{s:1:"f";a:1:{s:1:";";a:1:{s:9:"codepoint";i:120123;}}}s:1:"t";a:3:{s:1:";";a:1:{s:9:"codepoint";i:168;}s:1:"D";a:1:{s:1:"o";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8412;}}}}s:1:"E";a:1:{s:1:"q";a:1:{s:1:"u";a:1:{s:1:"a";a:1:{s:1:"l";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8784;}}}}}}}s:1:"u";a:1:{s:1:"b";a:1:{s:1:"l";a:1:{s:1:"e";a:6:{s:1:"C";a:1:{s:1:"o";a:1:{s:1:"n";a:1:{s:1:"t";a:1:{s:1:"o";a:1:{s:1:"u";a:1:{s:1:"r";a:1:{s:1:"I";a:1:{s:1:"n";a:1:{s:1:"t";a:1:{s:1:"e";a:1:{s:1:"g";a:1:{s:1:"r";a:1:{s:1:"a";a:1:{s:1:"l";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8751;}}}}}}}}}}}}}}}}s:1:"D";a:1:{s:1:"o";a:2:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:168;}}s:1:"w";a:1:{s:1:"n";a:1:{s:1:"A";a:1:{s:1:"r";a:1:{s:1:"r";a:1:{s:1:"o";a:1:{s:1:"w";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8659;}}}}}}}}}}s:1:"L";a:2:{s:1:"e";a:1:{s:1:"f";a:1:{s:1:"t";a:3:{s:1:"A";a:1:{s:1:"r";a:1:{s:1:"r";a:1:{s:1:"o";a:1:{s:1:"w";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8656;}}}}}}s:1:"R";a:1:{s:1:"i";a:1:{s:1:"g";a:1:{s:1:"h";a:1:{s:1:"t";a:1:{s:1:"A";a:1:{s:1:"r";a:1:{s:1:"r";a:1:{s:1:"o";a:1:{s:1:"w";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8660;}}}}}}}}}}}s:1:"T";a:1:{s:1:"e";a:1:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10980;}}}}}}}s:1:"o";a:1:{s:1:"n";a:1:{s:1:"g";a:2:{s:1:"L";a:1:{s:1:"e";a:1:{s:1:"f";a:1:{s:1:"t";a:2:{s:1:"A";a:1:{s:1:"r";a:1:{s:1:"r";a:1:{s:1:"o";a:1:{s:1:"w";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10232;}}}}}}s:1:"R";a:1:{s:1:"i";a:1:{s:1:"g";a:1:{s:1:"h";a:1:{s:1:"t";a:1:{s:1:"A";a:1:{s:1:"r";a:1:{s:1:"r";a:1:{s:1:"o";a:1:{s:1:"w";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10234;}}}}}}}}}}}}}}}s:1:"R";a:1:{s:1:"i";a:1:{s:1:"g";a:1:{s:1:"h";a:1:{s:1:"t";a:1:{s:1:"A";a:1:{s:1:"r";a:1:{s:1:"r";a:1:{s:1:"o";a:1:{s:1:"w";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10233;}}}}}}}}}}}}}}}s:1:"R";a:1:{s:1:"i";a:1:{s:1:"g";a:1:{s:1:"h";a:1:{s:1:"t";a:2:{s:1:"A";a:1:{s:1:"r";a:1:{s:1:"r";a:1:{s:1:"o";a:1:{s:1:"w";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8658;}}}}}}s:1:"T";a:1:{s:1:"e";a:1:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8872;}}}}}}}}}s:1:"U";a:1:{s:1:"p";a:2:{s:1:"A";a:1:{s:1:"r";a:1:{s:1:"r";a:1:{s:1:"o";a:1:{s:1:"w";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8657;}}}}}}s:1:"D";a:1:{s:1:"o";a:1:{s:1:"w";a:1:{s:1:"n";a:1:{s:1:"A";a:1:{s:1:"r";a:1:{s:1:"r";a:1:{s:1:"o";a:1:{s:1:"w";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8661;}}}}}}}}}}}}s:1:"V";a:1:{s:1:"e";a:1:{s:1:"r";a:1:{s:1:"t";a:1:{s:1:"i";a:1:{s:1:"c";a:1:{s:1:"a";a:1:{s:1:"l";a:1:{s:1:"B";a:1:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8741;}}}}}}}}}}}}}}}}s:1:"w";a:1:{s:1:"n";a:6:{s:1:"A";a:1:{s:1:"r";a:1:{s:1:"r";a:1:{s:1:"o";a:1:{s:1:"w";a:3:{s:1:";";a:1:{s:9:"codepoint";i:8595;}s:1:"B";a:1:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10515;}}}}s:1:"U";a:1:{s:1:"p";a:1:{s:1:"A";a:1:{s:1:"r";a:1:{s:1:"r";a:1:{s:1:"o";a:1:{s:1:"w";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8693;}}}}}}}}}}}}}s:1:"B";a:1:{s:1:"r";a:1:{s:1:"e";a:1:{s:1:"v";a:1:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:785;}}}}}}s:1:"L";a:1:{s:1:"e";a:1:{s:1:"f";a:1:{s:1:"t";a:3:{s:1:"R";a:1:{s:1:"i";a:1:{s:1:"g";a:1:{s:1:"h";a:1:{s:1:"t";a:1:{s:1:"V";a:1:{s:1:"e";a:1:{s:1:"c";a:1:{s:1:"t";a:1:{s:1:"o";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10576;}}}}}}}}}}}}s:1:"T";a:1:{s:1:"e";a:1:{s:1:"e";a:1:{s:1:"V";a:1:{s:1:"e";a:1:{s:1:"c";a:1:{s:1:"t";a:1:{s:1:"o";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10590;}}}}}}}}}}s:1:"V";a:1:{s:1:"e";a:1:{s:1:"c";a:1:{s:1:"t";a:1:{s:1:"o";a:1:{s:1:"r";a:2:{s:1:";";a:1:{s:9:"codepoint";i:8637;}s:1:"B";a:1:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10582;}}}}}}}}}}}}}}s:1:"R";a:1:{s:1:"i";a:1:{s:1:"g";a:1:{s:1:"h";a:1:{s:1:"t";a:2:{s:1:"T";a:1:{s:1:"e";a:1:{s:1:"e";a:1:{s:1:"V";a:1:{s:1:"e";a:1:{s:1:"c";a:1:{s:1:"t";a:1:{s:1:"o";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10591;}}}}}}}}}}s:1:"V";a:1:{s:1:"e";a:1:{s:1:"c";a:1:{s:1:"t";a:1:{s:1:"o";a:1:{s:1:"r";a:2:{s:1:";";a:1:{s:9:"codepoint";i:8641;}s:1:"B";a:1:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10583;}}}}}}}}}}}}}}}s:1:"T";a:1:{s:1:"e";a:1:{s:1:"e";a:2:{s:1:";";a:1:{s:9:"codepoint";i:8868;}s:1:"A";a:1:{s:1:"r";a:1:{s:1:"r";a:1:{s:1:"o";a:1:{s:1:"w";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8615;}}}}}}}}}s:1:"a";a:1:{s:1:"r";a:1:{s:1:"r";a:1:{s:1:"o";a:1:{s:1:"w";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8659;}}}}}}}}}s:1:"s";a:2:{s:1:"c";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:119967;}}}s:1:"t";a:1:{s:1:"r";a:1:{s:1:"o";a:1:{s:1:"k";a:1:{s:1:";";a:1:{s:9:"codepoint";i:272;}}}}}}}s:1:"E";a:16:{s:1:"N";a:1:{s:1:"G";a:1:{s:1:";";a:1:{s:9:"codepoint";i:330;}}}s:1:"T";a:1:{s:1:"H";a:2:{s:1:";";a:1:{s:9:"codepoint";i:208;}s:9:"codepoint";i:208;}}s:1:"a";a:1:{s:1:"c";a:1:{s:1:"u";a:1:{s:1:"t";a:1:{s:1:"e";a:2:{s:1:";";a:1:{s:9:"codepoint";i:201;}s:9:"codepoint";i:201;}}}}}s:1:"c";a:3:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:"o";a:1:{s:1:"n";a:1:{s:1:";";a:1:{s:9:"codepoint";i:282;}}}}}s:1:"i";a:1:{s:1:"r";a:1:{s:1:"c";a:2:{s:1:";";a:1:{s:9:"codepoint";i:202;}s:9:"codepoint";i:202;}}}s:1:"y";a:1:{s:1:";";a:1:{s:9:"codepoint";i:1069;}}}s:1:"d";a:1:{s:1:"o";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:278;}}}}s:1:"f";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:120072;}}}s:1:"g";a:1:{s:1:"r";a:1:{s:1:"a";a:1:{s:1:"v";a:1:{s:1:"e";a:2:{s:1:";";a:1:{s:9:"codepoint";i:200;}s:9:"codepoint";i:200;}}}}}s:1:"l";a:1:{s:1:"e";a:1:{s:1:"m";a:1:{s:1:"e";a:1:{s:1:"n";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8712;}}}}}}}s:1:"m";a:2:{s:1:"a";a:1:{s:1:"c";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:274;}}}}s:1:"p";a:1:{s:1:"t";a:1:{s:1:"y";a:2:{s:1:"S";a:1:{s:1:"m";a:1:{s:1:"a";a:1:{s:1:"l";a:1:{s:1:"l";a:1:{s:1:"S";a:1:{s:1:"q";a:1:{s:1:"u";a:1:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:9723;}}}}}}}}}}}}s:1:"V";a:1:{s:1:"e";a:1:{s:1:"r";a:1:{s:1:"y";a:1:{s:1:"S";a:1:{s:1:"m";a:1:{s:1:"a";a:1:{s:1:"l";a:1:{s:1:"l";a:1:{s:1:"S";a:1:{s:1:"q";a:1:{s:1:"u";a:1:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:9643;}}}}}}}}}}}}}}}}}}}}s:1:"o";a:2:{s:1:"g";a:1:{s:1:"o";a:1:{s:1:"n";a:1:{s:1:";";a:1:{s:9:"codepoint";i:280;}}}}s:1:"p";a:1:{s:1:"f";a:1:{s:1:";";a:1:{s:9:"codepoint";i:120124;}}}}s:1:"p";a:1:{s:1:"s";a:1:{s:1:"i";a:1:{s:1:"l";a:1:{s:1:"o";a:1:{s:1:"n";a:1:{s:1:";";a:1:{s:9:"codepoint";i:917;}}}}}}}s:1:"q";a:1:{s:1:"u";a:2:{s:1:"a";a:1:{s:1:"l";a:2:{s:1:";";a:1:{s:9:"codepoint";i:10869;}s:1:"T";a:1:{s:1:"i";a:1:{s:1:"l";a:1:{s:1:"d";a:1:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8770;}}}}}}}}s:1:"i";a:1:{s:1:"l";a:1:{s:1:"i";a:1:{s:1:"b";a:1:{s:1:"r";a:1:{s:1:"i";a:1:{s:1:"u";a:1:{s:1:"m";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8652;}}}}}}}}}}}s:1:"s";a:2:{s:1:"c";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8496;}}}s:1:"i";a:1:{s:1:"m";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10867;}}}}s:1:"t";a:1:{s:1:"a";a:1:{s:1:";";a:1:{s:9:"codepoint";i:919;}}}s:1:"u";a:1:{s:1:"m";a:1:{s:1:"l";a:2:{s:1:";";a:1:{s:9:"codepoint";i:203;}s:9:"codepoint";i:203;}}}s:1:"x";a:2:{s:1:"i";a:1:{s:1:"s";a:1:{s:1:"t";a:1:{s:1:"s";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8707;}}}}}s:1:"p";a:1:{s:1:"o";a:1:{s:1:"n";a:1:{s:1:"e";a:1:{s:1:"n";a:1:{s:1:"t";a:1:{s:1:"i";a:1:{s:1:"a";a:1:{s:1:"l";a:1:{s:1:"E";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8519;}}}}}}}}}}}}}s:1:"F";a:5:{s:1:"c";a:1:{s:1:"y";a:1:{s:1:";";a:1:{s:9:"codepoint";i:1060;}}}s:1:"f";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:120073;}}}s:1:"i";a:1:{s:1:"l";a:1:{s:1:"l";a:1:{s:1:"e";a:1:{s:1:"d";a:2:{s:1:"S";a:1:{s:1:"m";a:1:{s:1:"a";a:1:{s:1:"l";a:1:{s:1:"l";a:1:{s:1:"S";a:1:{s:1:"q";a:1:{s:1:"u";a:1:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:9724;}}}}}}}}}}}}s:1:"V";a:1:{s:1:"e";a:1:{s:1:"r";a:1:{s:1:"y";a:1:{s:1:"S";a:1:{s:1:"m";a:1:{s:1:"a";a:1:{s:1:"l";a:1:{s:1:"l";a:1:{s:1:"S";a:1:{s:1:"q";a:1:{s:1:"u";a:1:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:9642;}}}}}}}}}}}}}}}}}}}}}s:1:"o";a:3:{s:1:"p";a:1:{s:1:"f";a:1:{s:1:";";a:1:{s:9:"codepoint";i:120125;}}}s:1:"r";a:1:{s:1:"A";a:1:{s:1:"l";a:1:{s:1:"l";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8704;}}}}}s:1:"u";a:1:{s:1:"r";a:1:{s:1:"i";a:1:{s:1:"e";a:1:{s:1:"r";a:1:{s:1:"t";a:1:{s:1:"r";a:1:{s:1:"f";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8497;}}}}}}}}}}s:1:"s";a:1:{s:1:"c";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8497;}}}}}s:1:"G";a:12:{s:1:"J";a:1:{s:1:"c";a:1:{s:1:"y";a:1:{s:1:";";a:1:{s:9:"codepoint";i:1027;}}}}s:1:"T";a:2:{s:1:";";a:1:{s:9:"codepoint";i:62;}s:9:"codepoint";i:62;}s:1:"a";a:1:{s:1:"m";a:1:{s:1:"m";a:1:{s:1:"a";a:2:{s:1:";";a:1:{s:9:"codepoint";i:915;}s:1:"d";a:1:{s:1:";";a:1:{s:9:"codepoint";i:988;}}}}}}s:1:"b";a:1:{s:1:"r";a:1:{s:1:"e";a:1:{s:1:"v";a:1:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:286;}}}}}}s:1:"c";a:3:{s:1:"e";a:1:{s:1:"d";a:1:{s:1:"i";a:1:{s:1:"l";a:1:{s:1:";";a:1:{s:9:"codepoint";i:290;}}}}}s:1:"i";a:1:{s:1:"r";a:1:{s:1:"c";a:1:{s:1:";";a:1:{s:9:"codepoint";i:284;}}}}s:1:"y";a:1:{s:1:";";a:1:{s:9:"codepoint";i:1043;}}}s:1:"d";a:1:{s:1:"o";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:288;}}}}s:1:"f";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:120074;}}}s:1:"g";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8921;}}s:1:"o";a:1:{s:1:"p";a:1:{s:1:"f";a:1:{s:1:";";a:1:{s:9:"codepoint";i:120126;}}}}s:1:"r";a:1:{s:1:"e";a:1:{s:1:"a";a:1:{s:1:"t";a:1:{s:1:"e";a:1:{s:1:"r";a:6:{s:1:"E";a:1:{s:1:"q";a:1:{s:1:"u";a:1:{s:1:"a";a:1:{s:1:"l";a:2:{s:1:";";a:1:{s:9:"codepoint";i:8805;}s:1:"L";a:1:{s:1:"e";a:1:{s:1:"s";a:1:{s:1:"s";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8923;}}}}}}}}}}s:1:"F";a:1:{s:1:"u";a:1:{s:1:"l";a:1:{s:1:"l";a:1:{s:1:"E";a:1:{s:1:"q";a:1:{s:1:"u";a:1:{s:1:"a";a:1:{s:1:"l";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8807;}}}}}}}}}}s:1:"G";a:1:{s:1:"r";a:1:{s:1:"e";a:1:{s:1:"a";a:1:{s:1:"t";a:1:{s:1:"e";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10914;}}}}}}}}s:1:"L";a:1:{s:1:"e";a:1:{s:1:"s";a:1:{s:1:"s";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8823;}}}}}s:1:"S";a:1:{s:1:"l";a:1:{s:1:"a";a:1:{s:1:"n";a:1:{s:1:"t";a:1:{s:1:"E";a:1:{s:1:"q";a:1:{s:1:"u";a:1:{s:1:"a";a:1:{s:1:"l";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10878;}}}}}}}}}}}s:1:"T";a:1:{s:1:"i";a:1:{s:1:"l";a:1:{s:1:"d";a:1:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8819;}}}}}}}}}}}}s:1:"s";a:1:{s:1:"c";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:119970;}}}}s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8811;}}}s:1:"H";a:8:{s:1:"A";a:1:{s:1:"R";a:1:{s:1:"D";a:1:{s:1:"c";a:1:{s:1:"y";a:1:{s:1:";";a:1:{s:9:"codepoint";i:1066;}}}}}}s:1:"a";a:2:{s:1:"c";a:1:{s:1:"e";a:1:{s:1:"k";a:1:{s:1:";";a:1:{s:9:"codepoint";i:711;}}}}s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:94;}}}s:1:"c";a:1:{s:1:"i";a:1:{s:1:"r";a:1:{s:1:"c";a:1:{s:1:";";a:1:{s:9:"codepoint";i:292;}}}}}s:1:"f";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8460;}}}s:1:"i";a:1:{s:1:"l";a:1:{s:1:"b";a:1:{s:1:"e";a:1:{s:1:"r";a:1:{s:1:"t";a:1:{s:1:"S";a:1:{s:1:"p";a:1:{s:1:"a";a:1:{s:1:"c";a:1:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8459;}}}}}}}}}}}}s:1:"o";a:2:{s:1:"p";a:1:{s:1:"f";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8461;}}}s:1:"r";a:1:{s:1:"i";a:1:{s:1:"z";a:1:{s:1:"o";a:1:{s:1:"n";a:1:{s:1:"t";a:1:{s:1:"a";a:1:{s:1:"l";a:1:{s:1:"L";a:1:{s:1:"i";a:1:{s:1:"n";a:1:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:9472;}}}}}}}}}}}}}}s:1:"s";a:2:{s:1:"c";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8459;}}}s:1:"t";a:1:{s:1:"r";a:1:{s:1:"o";a:1:{s:1:"k";a:1:{s:1:";";a:1:{s:9:"codepoint";i:294;}}}}}}s:1:"u";a:1:{s:1:"m";a:1:{s:1:"p";a:2:{s:1:"D";a:1:{s:1:"o";a:1:{s:1:"w";a:1:{s:1:"n";a:1:{s:1:"H";a:1:{s:1:"u";a:1:{s:1:"m";a:1:{s:1:"p";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8782;}}}}}}}}}s:1:"E";a:1:{s:1:"q";a:1:{s:1:"u";a:1:{s:1:"a";a:1:{s:1:"l";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8783;}}}}}}}}}}s:1:"I";a:14:{s:1:"E";a:1:{s:1:"c";a:1:{s:1:"y";a:1:{s:1:";";a:1:{s:9:"codepoint";i:1045;}}}}s:1:"J";a:1:{s:1:"l";a:1:{s:1:"i";a:1:{s:1:"g";a:1:{s:1:";";a:1:{s:9:"codepoint";i:306;}}}}}s:1:"O";a:1:{s:1:"c";a:1:{s:1:"y";a:1:{s:1:";";a:1:{s:9:"codepoint";i:1025;}}}}s:1:"a";a:1:{s:1:"c";a:1:{s:1:"u";a:1:{s:1:"t";a:1:{s:1:"e";a:2:{s:1:";";a:1:{s:9:"codepoint";i:205;}s:9:"codepoint";i:205;}}}}}s:1:"c";a:2:{s:1:"i";a:1:{s:1:"r";a:1:{s:1:"c";a:2:{s:1:";";a:1:{s:9:"codepoint";i:206;}s:9:"codepoint";i:206;}}}s:1:"y";a:1:{s:1:";";a:1:{s:9:"codepoint";i:1048;}}}s:1:"d";a:1:{s:1:"o";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:304;}}}}s:1:"f";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8465;}}}s:1:"g";a:1:{s:1:"r";a:1:{s:1:"a";a:1:{s:1:"v";a:1:{s:1:"e";a:2:{s:1:";";a:1:{s:9:"codepoint";i:204;}s:9:"codepoint";i:204;}}}}}s:1:"m";a:3:{s:1:";";a:1:{s:9:"codepoint";i:8465;}s:1:"a";a:2:{s:1:"c";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:298;}}}s:1:"g";a:1:{s:1:"i";a:1:{s:1:"n";a:1:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:"y";a:1:{s:1:"I";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8520;}}}}}}}}}s:1:"p";a:1:{s:1:"l";a:1:{s:1:"i";a:1:{s:1:"e";a:1:{s:1:"s";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8658;}}}}}}}s:1:"n";a:2:{s:1:"t";a:2:{s:1:";";a:1:{s:9:"codepoint";i:8748;}s:1:"e";a:2:{s:1:"g";a:1:{s:1:"r";a:1:{s:1:"a";a:1:{s:1:"l";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8747;}}}}}s:1:"r";a:1:{s:1:"s";a:1:{s:1:"e";a:1:{s:1:"c";a:1:{s:1:"t";a:1:{s:1:"i";a:1:{s:1:"o";a:1:{s:1:"n";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8898;}}}}}}}}}}}s:1:"v";a:1:{s:1:"i";a:1:{s:1:"s";a:1:{s:1:"i";a:1:{s:1:"b";a:1:{s:1:"l";a:1:{s:1:"e";a:2:{s:1:"C";a:1:{s:1:"o";a:1:{s:1:"m";a:1:{s:1:"m";a:1:{s:1:"a";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8291;}}}}}}s:1:"T";a:1:{s:1:"i";a:1:{s:1:"m";a:1:{s:1:"e";a:1:{s:1:"s";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8290;}}}}}}}}}}}}}}s:1:"o";a:3:{s:1:"g";a:1:{s:1:"o";a:1:{s:1:"n";a:1:{s:1:";";a:1:{s:9:"codepoint";i:302;}}}}s:1:"p";a:1:{s:1:"f";a:1:{s:1:";";a:1:{s:9:"codepoint";i:120128;}}}s:1:"t";a:1:{s:1:"a";a:1:{s:1:";";a:1:{s:9:"codepoint";i:921;}}}}s:1:"s";a:1:{s:1:"c";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8464;}}}}s:1:"t";a:1:{s:1:"i";a:1:{s:1:"l";a:1:{s:1:"d";a:1:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:296;}}}}}}s:1:"u";a:2:{s:1:"k";a:1:{s:1:"c";a:1:{s:1:"y";a:1:{s:1:";";a:1:{s:9:"codepoint";i:1030;}}}}s:1:"m";a:1:{s:1:"l";a:2:{s:1:";";a:1:{s:9:"codepoint";i:207;}s:9:"codepoint";i:207;}}}}s:1:"J";a:5:{s:1:"c";a:2:{s:1:"i";a:1:{s:1:"r";a:1:{s:1:"c";a:1:{s:1:";";a:1:{s:9:"codepoint";i:308;}}}}s:1:"y";a:1:{s:1:";";a:1:{s:9:"codepoint";i:1049;}}}s:1:"f";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:120077;}}}s:1:"o";a:1:{s:1:"p";a:1:{s:1:"f";a:1:{s:1:";";a:1:{s:9:"codepoint";i:120129;}}}}s:1:"s";a:2:{s:1:"c";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:119973;}}}s:1:"e";a:1:{s:1:"r";a:1:{s:1:"c";a:1:{s:1:"y";a:1:{s:1:";";a:1:{s:9:"codepoint";i:1032;}}}}}}s:1:"u";a:1:{s:1:"k";a:1:{s:1:"c";a:1:{s:1:"y";a:1:{s:1:";";a:1:{s:9:"codepoint";i:1028;}}}}}}s:1:"K";a:7:{s:1:"H";a:1:{s:1:"c";a:1:{s:1:"y";a:1:{s:1:";";a:1:{s:9:"codepoint";i:1061;}}}}s:1:"J";a:1:{s:1:"c";a:1:{s:1:"y";a:1:{s:1:";";a:1:{s:9:"codepoint";i:1036;}}}}s:1:"a";a:1:{s:1:"p";a:1:{s:1:"p";a:1:{s:1:"a";a:1:{s:1:";";a:1:{s:9:"codepoint";i:922;}}}}}s:1:"c";a:2:{s:1:"e";a:1:{s:1:"d";a:1:{s:1:"i";a:1:{s:1:"l";a:1:{s:1:";";a:1:{s:9:"codepoint";i:310;}}}}}s:1:"y";a:1:{s:1:";";a:1:{s:9:"codepoint";i:1050;}}}s:1:"f";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:120078;}}}s:1:"o";a:1:{s:1:"p";a:1:{s:1:"f";a:1:{s:1:";";a:1:{s:9:"codepoint";i:120130;}}}}s:1:"s";a:1:{s:1:"c";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:119974;}}}}}s:1:"L";a:11:{s:1:"J";a:1:{s:1:"c";a:1:{s:1:"y";a:1:{s:1:";";a:1:{s:9:"codepoint";i:1033;}}}}s:1:"T";a:2:{s:1:";";a:1:{s:9:"codepoint";i:60;}s:9:"codepoint";i:60;}s:1:"a";a:5:{s:1:"c";a:1:{s:1:"u";a:1:{s:1:"t";a:1:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:313;}}}}}s:1:"m";a:1:{s:1:"b";a:1:{s:1:"d";a:1:{s:1:"a";a:1:{s:1:";";a:1:{s:9:"codepoint";i:923;}}}}}s:1:"n";a:1:{s:1:"g";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10218;}}}s:1:"p";a:1:{s:1:"l";a:1:{s:1:"a";a:1:{s:1:"c";a:1:{s:1:"e";a:1:{s:1:"t";a:1:{s:1:"r";a:1:{s:1:"f";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8466;}}}}}}}}}s:1:"r";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8606;}}}}s:1:"c";a:3:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:"o";a:1:{s:1:"n";a:1:{s:1:";";a:1:{s:9:"codepoint";i:317;}}}}}s:1:"e";a:1:{s:1:"d";a:1:{s:1:"i";a:1:{s:1:"l";a:1:{s:1:";";a:1:{s:9:"codepoint";i:315;}}}}}s:1:"y";a:1:{s:1:";";a:1:{s:9:"codepoint";i:1051;}}}s:1:"e";a:2:{s:1:"f";a:1:{s:1:"t";a:10:{s:1:"A";a:2:{s:1:"n";a:1:{s:1:"g";a:1:{s:1:"l";a:1:{s:1:"e";a:1:{s:1:"B";a:1:{s:1:"r";a:1:{s:1:"a";a:1:{s:1:"c";a:1:{s:1:"k";a:1:{s:1:"e";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10216;}}}}}}}}}}}}s:1:"r";a:1:{s:1:"r";a:1:{s:1:"o";a:1:{s:1:"w";a:3:{s:1:";";a:1:{s:9:"codepoint";i:8592;}s:1:"B";a:1:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8676;}}}}s:1:"R";a:1:{s:1:"i";a:1:{s:1:"g";a:1:{s:1:"h";a:1:{s:1:"t";a:1:{s:1:"A";a:1:{s:1:"r";a:1:{s:1:"r";a:1:{s:1:"o";a:1:{s:1:"w";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8646;}}}}}}}}}}}}}}}}s:1:"C";a:1:{s:1:"e";a:1:{s:1:"i";a:1:{s:1:"l";a:1:{s:1:"i";a:1:{s:1:"n";a:1:{s:1:"g";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8968;}}}}}}}}s:1:"D";a:1:{s:1:"o";a:2:{s:1:"u";a:1:{s:1:"b";a:1:{s:1:"l";a:1:{s:1:"e";a:1:{s:1:"B";a:1:{s:1:"r";a:1:{s:1:"a";a:1:{s:1:"c";a:1:{s:1:"k";a:1:{s:1:"e";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10214;}}}}}}}}}}}}s:1:"w";a:1:{s:1:"n";a:2:{s:1:"T";a:1:{s:1:"e";a:1:{s:1:"e";a:1:{s:1:"V";a:1:{s:1:"e";a:1:{s:1:"c";a:1:{s:1:"t";a:1:{s:1:"o";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10593;}}}}}}}}}}s:1:"V";a:1:{s:1:"e";a:1:{s:1:"c";a:1:{s:1:"t";a:1:{s:1:"o";a:1:{s:1:"r";a:2:{s:1:";";a:1:{s:9:"codepoint";i:8643;}s:1:"B";a:1:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10585;}}}}}}}}}}}}}}s:1:"F";a:1:{s:1:"l";a:1:{s:1:"o";a:1:{s:1:"o";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8970;}}}}}}s:1:"R";a:1:{s:1:"i";a:1:{s:1:"g";a:1:{s:1:"h";a:1:{s:1:"t";a:2:{s:1:"A";a:1:{s:1:"r";a:1:{s:1:"r";a:1:{s:1:"o";a:1:{s:1:"w";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8596;}}}}}}s:1:"V";a:1:{s:1:"e";a:1:{s:1:"c";a:1:{s:1:"t";a:1:{s:1:"o";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10574;}}}}}}}}}}}}s:1:"T";a:2:{s:1:"e";a:1:{s:1:"e";a:3:{s:1:";";a:1:{s:9:"codepoint";i:8867;}s:1:"A";a:1:{s:1:"r";a:1:{s:1:"r";a:1:{s:1:"o";a:1:{s:1:"w";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8612;}}}}}}s:1:"V";a:1:{s:1:"e";a:1:{s:1:"c";a:1:{s:1:"t";a:1:{s:1:"o";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10586;}}}}}}}}}s:1:"r";a:1:{s:1:"i";a:1:{s:1:"a";a:1:{s:1:"n";a:1:{s:1:"g";a:1:{s:1:"l";a:1:{s:1:"e";a:3:{s:1:";";a:1:{s:9:"codepoint";i:8882;}s:1:"B";a:1:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10703;}}}}s:1:"E";a:1:{s:1:"q";a:1:{s:1:"u";a:1:{s:1:"a";a:1:{s:1:"l";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8884;}}}}}}}}}}}}}}s:1:"U";a:1:{s:1:"p";a:3:{s:1:"D";a:1:{s:1:"o";a:1:{s:1:"w";a:1:{s:1:"n";a:1:{s:1:"V";a:1:{s:1:"e";a:1:{s:1:"c";a:1:{s:1:"t";a:1:{s:1:"o";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10577;}}}}}}}}}}}s:1:"T";a:1:{s:1:"e";a:1:{s:1:"e";a:1:{s:1:"V";a:1:{s:1:"e";a:1:{s:1:"c";a:1:{s:1:"t";a:1:{s:1:"o";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10592;}}}}}}}}}}s:1:"V";a:1:{s:1:"e";a:1:{s:1:"c";a:1:{s:1:"t";a:1:{s:1:"o";a:1:{s:1:"r";a:2:{s:1:";";a:1:{s:9:"codepoint";i:8639;}s:1:"B";a:1:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10584;}}}}}}}}}}}}s:1:"V";a:1:{s:1:"e";a:1:{s:1:"c";a:1:{s:1:"t";a:1:{s:1:"o";a:1:{s:1:"r";a:2:{s:1:";";a:1:{s:9:"codepoint";i:8636;}s:1:"B";a:1:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10578;}}}}}}}}}}s:1:"a";a:1:{s:1:"r";a:1:{s:1:"r";a:1:{s:1:"o";a:1:{s:1:"w";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8656;}}}}}}s:1:"r";a:1:{s:1:"i";a:1:{s:1:"g";a:1:{s:1:"h";a:1:{s:1:"t";a:1:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:"r";a:1:{s:1:"o";a:1:{s:1:"w";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8660;}}}}}}}}}}}}}s:1:"s";a:1:{s:1:"s";a:6:{s:1:"E";a:1:{s:1:"q";a:1:{s:1:"u";a:1:{s:1:"a";a:1:{s:1:"l";a:1:{s:1:"G";a:1:{s:1:"r";a:1:{s:1:"e";a:1:{s:1:"a";a:1:{s:1:"t";a:1:{s:1:"e";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8922;}}}}}}}}}}}}}s:1:"F";a:1:{s:1:"u";a:1:{s:1:"l";a:1:{s:1:"l";a:1:{s:1:"E";a:1:{s:1:"q";a:1:{s:1:"u";a:1:{s:1:"a";a:1:{s:1:"l";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8806;}}}}}}}}}}s:1:"G";a:1:{s:1:"r";a:1:{s:1:"e";a:1:{s:1:"a";a:1:{s:1:"t";a:1:{s:1:"e";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8822;}}}}}}}}s:1:"L";a:1:{s:1:"e";a:1:{s:1:"s";a:1:{s:1:"s";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10913;}}}}}s:1:"S";a:1:{s:1:"l";a:1:{s:1:"a";a:1:{s:1:"n";a:1:{s:1:"t";a:1:{s:1:"E";a:1:{s:1:"q";a:1:{s:1:"u";a:1:{s:1:"a";a:1:{s:1:"l";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10877;}}}}}}}}}}}s:1:"T";a:1:{s:1:"i";a:1:{s:1:"l";a:1:{s:1:"d";a:1:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8818;}}}}}}}}}s:1:"f";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:120079;}}}s:1:"l";a:2:{s:1:";";a:1:{s:9:"codepoint";i:8920;}s:1:"e";a:1:{s:1:"f";a:1:{s:1:"t";a:1:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:"r";a:1:{s:1:"o";a:1:{s:1:"w";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8666;}}}}}}}}}}s:1:"m";a:1:{s:1:"i";a:1:{s:1:"d";a:1:{s:1:"o";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:319;}}}}}}s:1:"o";a:3:{s:1:"n";a:1:{s:1:"g";a:4:{s:1:"L";a:1:{s:1:"e";a:1:{s:1:"f";a:1:{s:1:"t";a:2:{s:1:"A";a:1:{s:1:"r";a:1:{s:1:"r";a:1:{s:1:"o";a:1:{s:1:"w";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10229;}}}}}}s:1:"R";a:1:{s:1:"i";a:1:{s:1:"g";a:1:{s:1:"h";a:1:{s:1:"t";a:1:{s:1:"A";a:1:{s:1:"r";a:1:{s:1:"r";a:1:{s:1:"o";a:1:{s:1:"w";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10231;}}}}}}}}}}}}}}}s:1:"R";a:1:{s:1:"i";a:1:{s:1:"g";a:1:{s:1:"h";a:1:{s:1:"t";a:1:{s:1:"A";a:1:{s:1:"r";a:1:{s:1:"r";a:1:{s:1:"o";a:1:{s:1:"w";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10230;}}}}}}}}}}}s:1:"l";a:1:{s:1:"e";a:1:{s:1:"f";a:1:{s:1:"t";a:2:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:"r";a:1:{s:1:"o";a:1:{s:1:"w";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10232;}}}}}}s:1:"r";a:1:{s:1:"i";a:1:{s:1:"g";a:1:{s:1:"h";a:1:{s:1:"t";a:1:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:"r";a:1:{s:1:"o";a:1:{s:1:"w";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10234;}}}}}}}}}}}}}}}s:1:"r";a:1:{s:1:"i";a:1:{s:1:"g";a:1:{s:1:"h";a:1:{s:1:"t";a:1:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:"r";a:1:{s:1:"o";a:1:{s:1:"w";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10233;}}}}}}}}}}}}}s:1:"p";a:1:{s:1:"f";a:1:{s:1:";";a:1:{s:9:"codepoint";i:120131;}}}s:1:"w";a:1:{s:1:"e";a:1:{s:1:"r";a:2:{s:1:"L";a:1:{s:1:"e";a:1:{s:1:"f";a:1:{s:1:"t";a:1:{s:1:"A";a:1:{s:1:"r";a:1:{s:1:"r";a:1:{s:1:"o";a:1:{s:1:"w";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8601;}}}}}}}}}}s:1:"R";a:1:{s:1:"i";a:1:{s:1:"g";a:1:{s:1:"h";a:1:{s:1:"t";a:1:{s:1:"A";a:1:{s:1:"r";a:1:{s:1:"r";a:1:{s:1:"o";a:1:{s:1:"w";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8600;}}}}}}}}}}}}}}}s:1:"s";a:3:{s:1:"c";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8466;}}}s:1:"h";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8624;}}s:1:"t";a:1:{s:1:"r";a:1:{s:1:"o";a:1:{s:1:"k";a:1:{s:1:";";a:1:{s:9:"codepoint";i:321;}}}}}}s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8810;}}}s:1:"M";a:8:{s:1:"a";a:1:{s:1:"p";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10501;}}}s:1:"c";a:1:{s:1:"y";a:1:{s:1:";";a:1:{s:9:"codepoint";i:1052;}}}s:1:"e";a:2:{s:1:"d";a:1:{s:1:"i";a:1:{s:1:"u";a:1:{s:1:"m";a:1:{s:1:"S";a:1:{s:1:"p";a:1:{s:1:"a";a:1:{s:1:"c";a:1:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8287;}}}}}}}}}}s:1:"l";a:1:{s:1:"l";a:1:{s:1:"i";a:1:{s:1:"n";a:1:{s:1:"t";a:1:{s:1:"r";a:1:{s:1:"f";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8499;}}}}}}}}}s:1:"f";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:120080;}}}s:1:"i";a:1:{s:1:"n";a:1:{s:1:"u";a:1:{s:1:"s";a:1:{s:1:"P";a:1:{s:1:"l";a:1:{s:1:"u";a:1:{s:1:"s";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8723;}}}}}}}}}s:1:"o";a:1:{s:1:"p";a:1:{s:1:"f";a:1:{s:1:";";a:1:{s:9:"codepoint";i:120132;}}}}s:1:"s";a:1:{s:1:"c";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8499;}}}}s:1:"u";a:1:{s:1:";";a:1:{s:9:"codepoint";i:924;}}}s:1:"N";a:9:{s:1:"J";a:1:{s:1:"c";a:1:{s:1:"y";a:1:{s:1:";";a:1:{s:9:"codepoint";i:1034;}}}}s:1:"a";a:1:{s:1:"c";a:1:{s:1:"u";a:1:{s:1:"t";a:1:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:323;}}}}}}s:1:"c";a:3:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:"o";a:1:{s:1:"n";a:1:{s:1:";";a:1:{s:9:"codepoint";i:327;}}}}}s:1:"e";a:1:{s:1:"d";a:1:{s:1:"i";a:1:{s:1:"l";a:1:{s:1:";";a:1:{s:9:"codepoint";i:325;}}}}}s:1:"y";a:1:{s:1:";";a:1:{s:9:"codepoint";i:1053;}}}s:1:"e";a:3:{s:1:"g";a:1:{s:1:"a";a:1:{s:1:"t";a:1:{s:1:"i";a:1:{s:1:"v";a:1:{s:1:"e";a:3:{s:1:"M";a:1:{s:1:"e";a:1:{s:1:"d";a:1:{s:1:"i";a:1:{s:1:"u";a:1:{s:1:"m";a:1:{s:1:"S";a:1:{s:1:"p";a:1:{s:1:"a";a:1:{s:1:"c";a:1:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8203;}}}}}}}}}}}}s:1:"T";a:1:{s:1:"h";a:1:{s:1:"i";a:2:{s:1:"c";a:1:{s:1:"k";a:1:{s:1:"S";a:1:{s:1:"p";a:1:{s:1:"a";a:1:{s:1:"c";a:1:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8203;}}}}}}}}s:1:"n";a:1:{s:1:"S";a:1:{s:1:"p";a:1:{s:1:"a";a:1:{s:1:"c";a:1:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8203;}}}}}}}}}}s:1:"V";a:1:{s:1:"e";a:1:{s:1:"r";a:1:{s:1:"y";a:1:{s:1:"T";a:1:{s:1:"h";a:1:{s:1:"i";a:1:{s:1:"n";a:1:{s:1:"S";a:1:{s:1:"p";a:1:{s:1:"a";a:1:{s:1:"c";a:1:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8203;}}}}}}}}}}}}}}}}}}}}s:1:"s";a:1:{s:1:"t";a:1:{s:1:"e";a:1:{s:1:"d";a:2:{s:1:"G";a:1:{s:1:"r";a:1:{s:1:"e";a:1:{s:1:"a";a:1:{s:1:"t";a:1:{s:1:"e";a:1:{s:1:"r";a:1:{s:1:"G";a:1:{s:1:"r";a:1:{s:1:"e";a:1:{s:1:"a";a:1:{s:1:"t";a:1:{s:1:"e";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8811;}}}}}}}}}}}}}}}s:1:"L";a:1:{s:1:"e";a:1:{s:1:"s";a:1:{s:1:"s";a:1:{s:1:"L";a:1:{s:1:"e";a:1:{s:1:"s";a:1:{s:1:"s";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8810;}}}}}}}}}}}}}s:1:"w";a:1:{s:1:"L";a:1:{s:1:"i";a:1:{s:1:"n";a:1:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10;}}}}}}}s:1:"f";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:120081;}}}s:1:"o";a:4:{s:1:"B";a:1:{s:1:"r";a:1:{s:1:"e";a:1:{s:1:"a";a:1:{s:1:"k";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8288;}}}}}}s:1:"n";a:1:{s:1:"B";a:1:{s:1:"r";a:1:{s:1:"e";a:1:{s:1:"a";a:1:{s:1:"k";a:1:{s:1:"i";a:1:{s:1:"n";a:1:{s:1:"g";a:1:{s:1:"S";a:1:{s:1:"p";a:1:{s:1:"a";a:1:{s:1:"c";a:1:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:160;}}}}}}}}}}}}}}}s:1:"p";a:1:{s:1:"f";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8469;}}}s:1:"t";a:11:{s:1:";";a:1:{s:9:"codepoint";i:10988;}s:1:"C";a:2:{s:1:"o";a:1:{s:1:"n";a:1:{s:1:"g";a:1:{s:1:"r";a:1:{s:1:"u";a:1:{s:1:"e";a:1:{s:1:"n";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8802;}}}}}}}}}s:1:"u";a:1:{s:1:"p";a:1:{s:1:"C";a:1:{s:1:"a";a:1:{s:1:"p";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8813;}}}}}}}s:1:"D";a:1:{s:1:"o";a:1:{s:1:"u";a:1:{s:1:"b";a:1:{s:1:"l";a:1:{s:1:"e";a:1:{s:1:"V";a:1:{s:1:"e";a:1:{s:1:"r";a:1:{s:1:"t";a:1:{s:1:"i";a:1:{s:1:"c";a:1:{s:1:"a";a:1:{s:1:"l";a:1:{s:1:"B";a:1:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8742;}}}}}}}}}}}}}}}}}}s:1:"E";a:3:{s:1:"l";a:1:{s:1:"e";a:1:{s:1:"m";a:1:{s:1:"e";a:1:{s:1:"n";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8713;}}}}}}}s:1:"q";a:1:{s:1:"u";a:1:{s:1:"a";a:1:{s:1:"l";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8800;}}}}}s:1:"x";a:1:{s:1:"i";a:1:{s:1:"s";a:1:{s:1:"t";a:1:{s:1:"s";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8708;}}}}}}}s:1:"G";a:1:{s:1:"r";a:1:{s:1:"e";a:1:{s:1:"a";a:1:{s:1:"t";a:1:{s:1:"e";a:1:{s:1:"r";a:4:{s:1:";";a:1:{s:9:"codepoint";i:8815;}s:1:"E";a:1:{s:1:"q";a:1:{s:1:"u";a:1:{s:1:"a";a:1:{s:1:"l";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8817;}}}}}}s:1:"L";a:1:{s:1:"e";a:1:{s:1:"s";a:1:{s:1:"s";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8825;}}}}}s:1:"T";a:1:{s:1:"i";a:1:{s:1:"l";a:1:{s:1:"d";a:1:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8821;}}}}}}}}}}}}}s:1:"L";a:1:{s:1:"e";a:2:{s:1:"f";a:1:{s:1:"t";a:1:{s:1:"T";a:1:{s:1:"r";a:1:{s:1:"i";a:1:{s:1:"a";a:1:{s:1:"n";a:1:{s:1:"g";a:1:{s:1:"l";a:1:{s:1:"e";a:2:{s:1:";";a:1:{s:9:"codepoint";i:8938;}s:1:"E";a:1:{s:1:"q";a:1:{s:1:"u";a:1:{s:1:"a";a:1:{s:1:"l";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8940;}}}}}}}}}}}}}}}}s:1:"s";a:1:{s:1:"s";a:4:{s:1:";";a:1:{s:9:"codepoint";i:8814;}s:1:"E";a:1:{s:1:"q";a:1:{s:1:"u";a:1:{s:1:"a";a:1:{s:1:"l";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8816;}}}}}}s:1:"G";a:1:{s:1:"r";a:1:{s:1:"e";a:1:{s:1:"a";a:1:{s:1:"t";a:1:{s:1:"e";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8824;}}}}}}}}s:1:"T";a:1:{s:1:"i";a:1:{s:1:"l";a:1:{s:1:"d";a:1:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8820;}}}}}}}}}}s:1:"P";a:1:{s:1:"r";a:1:{s:1:"e";a:1:{s:1:"c";a:1:{s:1:"e";a:1:{s:1:"d";a:1:{s:1:"e";a:1:{s:1:"s";a:2:{s:1:";";a:1:{s:9:"codepoint";i:8832;}s:1:"S";a:1:{s:1:"l";a:1:{s:1:"a";a:1:{s:1:"n";a:1:{s:1:"t";a:1:{s:1:"E";a:1:{s:1:"q";a:1:{s:1:"u";a:1:{s:1:"a";a:1:{s:1:"l";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8928;}}}}}}}}}}}}}}}}}}}s:1:"R";a:2:{s:1:"e";a:1:{s:1:"v";a:1:{s:1:"e";a:1:{s:1:"r";a:1:{s:1:"s";a:1:{s:1:"e";a:1:{s:1:"E";a:1:{s:1:"l";a:1:{s:1:"e";a:1:{s:1:"m";a:1:{s:1:"e";a:1:{s:1:"n";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8716;}}}}}}}}}}}}}}s:1:"i";a:1:{s:1:"g";a:1:{s:1:"h";a:1:{s:1:"t";a:1:{s:1:"T";a:1:{s:1:"r";a:1:{s:1:"i";a:1:{s:1:"a";a:1:{s:1:"n";a:1:{s:1:"g";a:1:{s:1:"l";a:1:{s:1:"e";a:2:{s:1:";";a:1:{s:9:"codepoint";i:8939;}s:1:"E";a:1:{s:1:"q";a:1:{s:1:"u";a:1:{s:1:"a";a:1:{s:1:"l";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8941;}}}}}}}}}}}}}}}}}}}s:1:"S";a:2:{s:1:"q";a:1:{s:1:"u";a:1:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:"e";a:1:{s:1:"S";a:1:{s:1:"u";a:2:{s:1:"b";a:1:{s:1:"s";a:1:{s:1:"e";a:1:{s:1:"t";a:1:{s:1:"E";a:1:{s:1:"q";a:1:{s:1:"u";a:1:{s:1:"a";a:1:{s:1:"l";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8930;}}}}}}}}}}s:1:"p";a:1:{s:1:"e";a:1:{s:1:"r";a:1:{s:1:"s";a:1:{s:1:"e";a:1:{s:1:"t";a:1:{s:1:"E";a:1:{s:1:"q";a:1:{s:1:"u";a:1:{s:1:"a";a:1:{s:1:"l";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8931;}}}}}}}}}}}}}}}}}}}s:1:"u";a:3:{s:1:"b";a:1:{s:1:"s";a:1:{s:1:"e";a:1:{s:1:"t";a:1:{s:1:"E";a:1:{s:1:"q";a:1:{s:1:"u";a:1:{s:1:"a";a:1:{s:1:"l";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8840;}}}}}}}}}}s:1:"c";a:1:{s:1:"c";a:1:{s:1:"e";a:1:{s:1:"e";a:1:{s:1:"d";a:1:{s:1:"s";a:2:{s:1:";";a:1:{s:9:"codepoint";i:8833;}s:1:"S";a:1:{s:1:"l";a:1:{s:1:"a";a:1:{s:1:"n";a:1:{s:1:"t";a:1:{s:1:"E";a:1:{s:1:"q";a:1:{s:1:"u";a:1:{s:1:"a";a:1:{s:1:"l";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8929;}}}}}}}}}}}}}}}}}s:1:"p";a:1:{s:1:"e";a:1:{s:1:"r";a:1:{s:1:"s";a:1:{s:1:"e";a:1:{s:1:"t";a:1:{s:1:"E";a:1:{s:1:"q";a:1:{s:1:"u";a:1:{s:1:"a";a:1:{s:1:"l";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8841;}}}}}}}}}}}}}}s:1:"T";a:1:{s:1:"i";a:1:{s:1:"l";a:1:{s:1:"d";a:1:{s:1:"e";a:4:{s:1:";";a:1:{s:9:"codepoint";i:8769;}s:1:"E";a:1:{s:1:"q";a:1:{s:1:"u";a:1:{s:1:"a";a:1:{s:1:"l";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8772;}}}}}}s:1:"F";a:1:{s:1:"u";a:1:{s:1:"l";a:1:{s:1:"l";a:1:{s:1:"E";a:1:{s:1:"q";a:1:{s:1:"u";a:1:{s:1:"a";a:1:{s:1:"l";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8775;}}}}}}}}}}s:1:"T";a:1:{s:1:"i";a:1:{s:1:"l";a:1:{s:1:"d";a:1:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8777;}}}}}}}}}}}s:1:"V";a:1:{s:1:"e";a:1:{s:1:"r";a:1:{s:1:"t";a:1:{s:1:"i";a:1:{s:1:"c";a:1:{s:1:"a";a:1:{s:1:"l";a:1:{s:1:"B";a:1:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8740;}}}}}}}}}}}}}}s:1:"s";a:1:{s:1:"c";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:119977;}}}}s:1:"t";a:1:{s:1:"i";a:1:{s:1:"l";a:1:{s:1:"d";a:1:{s:1:"e";a:2:{s:1:";";a:1:{s:9:"codepoint";i:209;}s:9:"codepoint";i:209;}}}}}s:1:"u";a:1:{s:1:";";a:1:{s:9:"codepoint";i:925;}}}s:1:"O";a:14:{s:1:"E";a:1:{s:1:"l";a:1:{s:1:"i";a:1:{s:1:"g";a:1:{s:1:";";a:1:{s:9:"codepoint";i:338;}}}}}s:1:"a";a:1:{s:1:"c";a:1:{s:1:"u";a:1:{s:1:"t";a:1:{s:1:"e";a:2:{s:1:";";a:1:{s:9:"codepoint";i:211;}s:9:"codepoint";i:211;}}}}}s:1:"c";a:2:{s:1:"i";a:1:{s:1:"r";a:1:{s:1:"c";a:2:{s:1:";";a:1:{s:9:"codepoint";i:212;}s:9:"codepoint";i:212;}}}s:1:"y";a:1:{s:1:";";a:1:{s:9:"codepoint";i:1054;}}}s:1:"d";a:1:{s:1:"b";a:1:{s:1:"l";a:1:{s:1:"a";a:1:{s:1:"c";a:1:{s:1:";";a:1:{s:9:"codepoint";i:336;}}}}}}s:1:"f";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:120082;}}}s:1:"g";a:1:{s:1:"r";a:1:{s:1:"a";a:1:{s:1:"v";a:1:{s:1:"e";a:2:{s:1:";";a:1:{s:9:"codepoint";i:210;}s:9:"codepoint";i:210;}}}}}s:1:"m";a:3:{s:1:"a";a:1:{s:1:"c";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:332;}}}}s:1:"e";a:1:{s:1:"g";a:1:{s:1:"a";a:1:{s:1:";";a:1:{s:9:"codepoint";i:937;}}}}s:1:"i";a:1:{s:1:"c";a:1:{s:1:"r";a:1:{s:1:"o";a:1:{s:1:"n";a:1:{s:1:";";a:1:{s:9:"codepoint";i:927;}}}}}}}s:1:"o";a:1:{s:1:"p";a:1:{s:1:"f";a:1:{s:1:";";a:1:{s:9:"codepoint";i:120134;}}}}s:1:"p";a:1:{s:1:"e";a:1:{s:1:"n";a:1:{s:1:"C";a:1:{s:1:"u";a:1:{s:1:"r";a:1:{s:1:"l";a:1:{s:1:"y";a:2:{s:1:"D";a:1:{s:1:"o";a:1:{s:1:"u";a:1:{s:1:"b";a:1:{s:1:"l";a:1:{s:1:"e";a:1:{s:1:"Q";a:1:{s:1:"u";a:1:{s:1:"o";a:1:{s:1:"t";a:1:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8220;}}}}}}}}}}}}s:1:"Q";a:1:{s:1:"u";a:1:{s:1:"o";a:1:{s:1:"t";a:1:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8216;}}}}}}}}}}}}}}s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10836;}}s:1:"s";a:2:{s:1:"c";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:119978;}}}s:1:"l";a:1:{s:1:"a";a:1:{s:1:"s";a:1:{s:1:"h";a:2:{s:1:";";a:1:{s:9:"codepoint";i:216;}s:9:"codepoint";i:216;}}}}}s:1:"t";a:1:{s:1:"i";a:2:{s:1:"l";a:1:{s:1:"d";a:1:{s:1:"e";a:2:{s:1:";";a:1:{s:9:"codepoint";i:213;}s:9:"codepoint";i:213;}}}s:1:"m";a:1:{s:1:"e";a:1:{s:1:"s";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10807;}}}}}}s:1:"u";a:1:{s:1:"m";a:1:{s:1:"l";a:2:{s:1:";";a:1:{s:9:"codepoint";i:214;}s:9:"codepoint";i:214;}}}s:1:"v";a:1:{s:1:"e";a:1:{s:1:"r";a:2:{s:1:"B";a:2:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:175;}}}s:1:"r";a:1:{s:1:"a";a:1:{s:1:"c";a:2:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:9182;}}s:1:"k";a:1:{s:1:"e";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:9140;}}}}}}}}s:1:"P";a:1:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:"e";a:1:{s:1:"n";a:1:{s:1:"t";a:1:{s:1:"h";a:1:{s:1:"e";a:1:{s:1:"s";a:1:{s:1:"i";a:1:{s:1:"s";a:1:{s:1:";";a:1:{s:9:"codepoint";i:9180;}}}}}}}}}}}}}}}}s:1:"P";a:9:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:"t";a:1:{s:1:"i";a:1:{s:1:"a";a:1:{s:1:"l";a:1:{s:1:"D";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8706;}}}}}}}}s:1:"c";a:1:{s:1:"y";a:1:{s:1:";";a:1:{s:9:"codepoint";i:1055;}}}s:1:"f";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:120083;}}}s:1:"h";a:1:{s:1:"i";a:1:{s:1:";";a:1:{s:9:"codepoint";i:934;}}}s:1:"i";a:1:{s:1:";";a:1:{s:9:"codepoint";i:928;}}s:1:"l";a:1:{s:1:"u";a:1:{s:1:"s";a:1:{s:1:"M";a:1:{s:1:"i";a:1:{s:1:"n";a:1:{s:1:"u";a:1:{s:1:"s";a:1:{s:1:";";a:1:{s:9:"codepoint";i:177;}}}}}}}}}s:1:"o";a:2:{s:1:"i";a:1:{s:1:"n";a:1:{s:1:"c";a:1:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:"e";a:1:{s:1:"p";a:1:{s:1:"l";a:1:{s:1:"a";a:1:{s:1:"n";a:1:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8460;}}}}}}}}}}}}s:1:"p";a:1:{s:1:"f";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8473;}}}}s:1:"r";a:4:{s:1:";";a:1:{s:9:"codepoint";i:10939;}s:1:"e";a:1:{s:1:"c";a:1:{s:1:"e";a:1:{s:1:"d";a:1:{s:1:"e";a:1:{s:1:"s";a:4:{s:1:";";a:1:{s:9:"codepoint";i:8826;}s:1:"E";a:1:{s:1:"q";a:1:{s:1:"u";a:1:{s:1:"a";a:1:{s:1:"l";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10927;}}}}}}s:1:"S";a:1:{s:1:"l";a:1:{s:1:"a";a:1:{s:1:"n";a:1:{s:1:"t";a:1:{s:1:"E";a:1:{s:1:"q";a:1:{s:1:"u";a:1:{s:1:"a";a:1:{s:1:"l";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8828;}}}}}}}}}}}s:1:"T";a:1:{s:1:"i";a:1:{s:1:"l";a:1:{s:1:"d";a:1:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8830;}}}}}}}}}}}}s:1:"i";a:1:{s:1:"m";a:1:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8243;}}}}s:1:"o";a:2:{s:1:"d";a:1:{s:1:"u";a:1:{s:1:"c";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8719;}}}}}s:1:"p";a:1:{s:1:"o";a:1:{s:1:"r";a:1:{s:1:"t";a:1:{s:1:"i";a:1:{s:1:"o";a:1:{s:1:"n";a:2:{s:1:";";a:1:{s:9:"codepoint";i:8759;}s:1:"a";a:1:{s:1:"l";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8733;}}}}}}}}}}}}s:1:"s";a:2:{s:1:"c";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:119979;}}}s:1:"i";a:1:{s:1:";";a:1:{s:9:"codepoint";i:936;}}}}s:1:"Q";a:4:{s:1:"U";a:1:{s:1:"O";a:1:{s:1:"T";a:2:{s:1:";";a:1:{s:9:"codepoint";i:34;}s:9:"codepoint";i:34;}}}s:1:"f";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:120084;}}}s:1:"o";a:1:{s:1:"p";a:1:{s:1:"f";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8474;}}}}s:1:"s";a:1:{s:1:"c";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:119980;}}}}}s:1:"R";a:12:{s:1:"B";a:1:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10512;}}}}}s:1:"E";a:1:{s:1:"G";a:2:{s:1:";";a:1:{s:9:"codepoint";i:174;}s:9:"codepoint";i:174;}}s:1:"a";a:3:{s:1:"c";a:1:{s:1:"u";a:1:{s:1:"t";a:1:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:340;}}}}}s:1:"n";a:1:{s:1:"g";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10219;}}}s:1:"r";a:1:{s:1:"r";a:2:{s:1:";";a:1:{s:9:"codepoint";i:8608;}s:1:"t";a:1:{s:1:"l";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10518;}}}}}}s:1:"c";a:3:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:"o";a:1:{s:1:"n";a:1:{s:1:";";a:1:{s:9:"codepoint";i:344;}}}}}s:1:"e";a:1:{s:1:"d";a:1:{s:1:"i";a:1:{s:1:"l";a:1:{s:1:";";a:1:{s:9:"codepoint";i:342;}}}}}s:1:"y";a:1:{s:1:";";a:1:{s:9:"codepoint";i:1056;}}}s:1:"e";a:2:{s:1:";";a:1:{s:9:"codepoint";i:8476;}s:1:"v";a:1:{s:1:"e";a:1:{s:1:"r";a:1:{s:1:"s";a:1:{s:1:"e";a:2:{s:1:"E";a:2:{s:1:"l";a:1:{s:1:"e";a:1:{s:1:"m";a:1:{s:1:"e";a:1:{s:1:"n";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8715;}}}}}}}s:1:"q";a:1:{s:1:"u";a:1:{s:1:"i";a:1:{s:1:"l";a:1:{s:1:"i";a:1:{s:1:"b";a:1:{s:1:"r";a:1:{s:1:"i";a:1:{s:1:"u";a:1:{s:1:"m";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8651;}}}}}}}}}}}}s:1:"U";a:1:{s:1:"p";a:1:{s:1:"E";a:1:{s:1:"q";a:1:{s:1:"u";a:1:{s:1:"i";a:1:{s:1:"l";a:1:{s:1:"i";a:1:{s:1:"b";a:1:{s:1:"r";a:1:{s:1:"i";a:1:{s:1:"u";a:1:{s:1:"m";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10607;}}}}}}}}}}}}}}}}}}}}s:1:"f";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8476;}}}s:1:"h";a:1:{s:1:"o";a:1:{s:1:";";a:1:{s:9:"codepoint";i:929;}}}s:1:"i";a:1:{s:1:"g";a:1:{s:1:"h";a:1:{s:1:"t";a:8:{s:1:"A";a:2:{s:1:"n";a:1:{s:1:"g";a:1:{s:1:"l";a:1:{s:1:"e";a:1:{s:1:"B";a:1:{s:1:"r";a:1:{s:1:"a";a:1:{s:1:"c";a:1:{s:1:"k";a:1:{s:1:"e";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10217;}}}}}}}}}}}}s:1:"r";a:1:{s:1:"r";a:1:{s:1:"o";a:1:{s:1:"w";a:3:{s:1:";";a:1:{s:9:"codepoint";i:8594;}s:1:"B";a:1:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8677;}}}}s:1:"L";a:1:{s:1:"e";a:1:{s:1:"f";a:1:{s:1:"t";a:1:{s:1:"A";a:1:{s:1:"r";a:1:{s:1:"r";a:1:{s:1:"o";a:1:{s:1:"w";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8644;}}}}}}}}}}}}}}}s:1:"C";a:1:{s:1:"e";a:1:{s:1:"i";a:1:{s:1:"l";a:1:{s:1:"i";a:1:{s:1:"n";a:1:{s:1:"g";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8969;}}}}}}}}s:1:"D";a:1:{s:1:"o";a:2:{s:1:"u";a:1:{s:1:"b";a:1:{s:1:"l";a:1:{s:1:"e";a:1:{s:1:"B";a:1:{s:1:"r";a:1:{s:1:"a";a:1:{s:1:"c";a:1:{s:1:"k";a:1:{s:1:"e";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10215;}}}}}}}}}}}}s:1:"w";a:1:{s:1:"n";a:2:{s:1:"T";a:1:{s:1:"e";a:1:{s:1:"e";a:1:{s:1:"V";a:1:{s:1:"e";a:1:{s:1:"c";a:1:{s:1:"t";a:1:{s:1:"o";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10589;}}}}}}}}}}s:1:"V";a:1:{s:1:"e";a:1:{s:1:"c";a:1:{s:1:"t";a:1:{s:1:"o";a:1:{s:1:"r";a:2:{s:1:";";a:1:{s:9:"codepoint";i:8642;}s:1:"B";a:1:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10581;}}}}}}}}}}}}}}s:1:"F";a:1:{s:1:"l";a:1:{s:1:"o";a:1:{s:1:"o";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8971;}}}}}}s:1:"T";a:2:{s:1:"e";a:1:{s:1:"e";a:3:{s:1:";";a:1:{s:9:"codepoint";i:8866;}s:1:"A";a:1:{s:1:"r";a:1:{s:1:"r";a:1:{s:1:"o";a:1:{s:1:"w";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8614;}}}}}}s:1:"V";a:1:{s:1:"e";a:1:{s:1:"c";a:1:{s:1:"t";a:1:{s:1:"o";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10587;}}}}}}}}}s:1:"r";a:1:{s:1:"i";a:1:{s:1:"a";a:1:{s:1:"n";a:1:{s:1:"g";a:1:{s:1:"l";a:1:{s:1:"e";a:3:{s:1:";";a:1:{s:9:"codepoint";i:8883;}s:1:"B";a:1:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10704;}}}}s:1:"E";a:1:{s:1:"q";a:1:{s:1:"u";a:1:{s:1:"a";a:1:{s:1:"l";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8885;}}}}}}}}}}}}}}s:1:"U";a:1:{s:1:"p";a:3:{s:1:"D";a:1:{s:1:"o";a:1:{s:1:"w";a:1:{s:1:"n";a:1:{s:1:"V";a:1:{s:1:"e";a:1:{s:1:"c";a:1:{s:1:"t";a:1:{s:1:"o";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10575;}}}}}}}}}}}s:1:"T";a:1:{s:1:"e";a:1:{s:1:"e";a:1:{s:1:"V";a:1:{s:1:"e";a:1:{s:1:"c";a:1:{s:1:"t";a:1:{s:1:"o";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10588;}}}}}}}}}}s:1:"V";a:1:{s:1:"e";a:1:{s:1:"c";a:1:{s:1:"t";a:1:{s:1:"o";a:1:{s:1:"r";a:2:{s:1:";";a:1:{s:9:"codepoint";i:8638;}s:1:"B";a:1:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10580;}}}}}}}}}}}}s:1:"V";a:1:{s:1:"e";a:1:{s:1:"c";a:1:{s:1:"t";a:1:{s:1:"o";a:1:{s:1:"r";a:2:{s:1:";";a:1:{s:9:"codepoint";i:8640;}s:1:"B";a:1:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10579;}}}}}}}}}}s:1:"a";a:1:{s:1:"r";a:1:{s:1:"r";a:1:{s:1:"o";a:1:{s:1:"w";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8658;}}}}}}}}}}s:1:"o";a:2:{s:1:"p";a:1:{s:1:"f";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8477;}}}s:1:"u";a:1:{s:1:"n";a:1:{s:1:"d";a:1:{s:1:"I";a:1:{s:1:"m";a:1:{s:1:"p";a:1:{s:1:"l";a:1:{s:1:"i";a:1:{s:1:"e";a:1:{s:1:"s";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10608;}}}}}}}}}}}}s:1:"r";a:1:{s:1:"i";a:1:{s:1:"g";a:1:{s:1:"h";a:1:{s:1:"t";a:1:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:"r";a:1:{s:1:"o";a:1:{s:1:"w";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8667;}}}}}}}}}}}s:1:"s";a:2:{s:1:"c";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8475;}}}s:1:"h";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8625;}}}s:1:"u";a:1:{s:1:"l";a:1:{s:1:"e";a:1:{s:1:"D";a:1:{s:1:"e";a:1:{s:1:"l";a:1:{s:1:"a";a:1:{s:1:"y";a:1:{s:1:"e";a:1:{s:1:"d";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10740;}}}}}}}}}}}}s:1:"S";a:13:{s:1:"H";a:2:{s:1:"C";a:1:{s:1:"H";a:1:{s:1:"c";a:1:{s:1:"y";a:1:{s:1:";";a:1:{s:9:"codepoint";i:1065;}}}}}s:1:"c";a:1:{s:1:"y";a:1:{s:1:";";a:1:{s:9:"codepoint";i:1064;}}}}s:1:"O";a:1:{s:1:"F";a:1:{s:1:"T";a:1:{s:1:"c";a:1:{s:1:"y";a:1:{s:1:";";a:1:{s:9:"codepoint";i:1068;}}}}}}s:1:"a";a:1:{s:1:"c";a:1:{s:1:"u";a:1:{s:1:"t";a:1:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:346;}}}}}}s:1:"c";a:5:{s:1:";";a:1:{s:9:"codepoint";i:10940;}s:1:"a";a:1:{s:1:"r";a:1:{s:1:"o";a:1:{s:1:"n";a:1:{s:1:";";a:1:{s:9:"codepoint";i:352;}}}}}s:1:"e";a:1:{s:1:"d";a:1:{s:1:"i";a:1:{s:1:"l";a:1:{s:1:";";a:1:{s:9:"codepoint";i:350;}}}}}s:1:"i";a:1:{s:1:"r";a:1:{s:1:"c";a:1:{s:1:";";a:1:{s:9:"codepoint";i:348;}}}}s:1:"y";a:1:{s:1:";";a:1:{s:9:"codepoint";i:1057;}}}s:1:"f";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:120086;}}}s:1:"h";a:1:{s:1:"o";a:1:{s:1:"r";a:1:{s:1:"t";a:4:{s:1:"D";a:1:{s:1:"o";a:1:{s:1:"w";a:1:{s:1:"n";a:1:{s:1:"A";a:1:{s:1:"r";a:1:{s:1:"r";a:1:{s:1:"o";a:1:{s:1:"w";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8595;}}}}}}}}}}s:1:"L";a:1:{s:1:"e";a:1:{s:1:"f";a:1:{s:1:"t";a:1:{s:1:"A";a:1:{s:1:"r";a:1:{s:1:"r";a:1:{s:1:"o";a:1:{s:1:"w";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8592;}}}}}}}}}}s:1:"R";a:1:{s:1:"i";a:1:{s:1:"g";a:1:{s:1:"h";a:1:{s:1:"t";a:1:{s:1:"A";a:1:{s:1:"r";a:1:{s:1:"r";a:1:{s:1:"o";a:1:{s:1:"w";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8594;}}}}}}}}}}}s:1:"U";a:1:{s:1:"p";a:1:{s:1:"A";a:1:{s:1:"r";a:1:{s:1:"r";a:1:{s:1:"o";a:1:{s:1:"w";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8593;}}}}}}}}}}}}s:1:"i";a:1:{s:1:"g";a:1:{s:1:"m";a:1:{s:1:"a";a:1:{s:1:";";a:1:{s:9:"codepoint";i:931;}}}}}s:1:"m";a:1:{s:1:"a";a:1:{s:1:"l";a:1:{s:1:"l";a:1:{s:1:"C";a:1:{s:1:"i";a:1:{s:1:"r";a:1:{s:1:"c";a:1:{s:1:"l";a:1:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8728;}}}}}}}}}}}s:1:"o";a:1:{s:1:"p";a:1:{s:1:"f";a:1:{s:1:";";a:1:{s:9:"codepoint";i:120138;}}}}s:1:"q";a:2:{s:1:"r";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8730;}}}s:1:"u";a:1:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:"e";a:4:{s:1:";";a:1:{s:9:"codepoint";i:9633;}s:1:"I";a:1:{s:1:"n";a:1:{s:1:"t";a:1:{s:1:"e";a:1:{s:1:"r";a:1:{s:1:"s";a:1:{s:1:"e";a:1:{s:1:"c";a:1:{s:1:"t";a:1:{s:1:"i";a:1:{s:1:"o";a:1:{s:1:"n";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8851;}}}}}}}}}}}}}s:1:"S";a:1:{s:1:"u";a:2:{s:1:"b";a:1:{s:1:"s";a:1:{s:1:"e";a:1:{s:1:"t";a:2:{s:1:";";a:1:{s:9:"codepoint";i:8847;}s:1:"E";a:1:{s:1:"q";a:1:{s:1:"u";a:1:{s:1:"a";a:1:{s:1:"l";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8849;}}}}}}}}}}s:1:"p";a:1:{s:1:"e";a:1:{s:1:"r";a:1:{s:1:"s";a:1:{s:1:"e";a:1:{s:1:"t";a:2:{s:1:";";a:1:{s:9:"codepoint";i:8848;}s:1:"E";a:1:{s:1:"q";a:1:{s:1:"u";a:1:{s:1:"a";a:1:{s:1:"l";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8850;}}}}}}}}}}}}}}s:1:"U";a:1:{s:1:"n";a:1:{s:1:"i";a:1:{s:1:"o";a:1:{s:1:"n";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8852;}}}}}}}}}}}s:1:"s";a:1:{s:1:"c";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:119982;}}}}s:1:"t";a:1:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8902;}}}}s:1:"u";a:4:{s:1:"b";a:2:{s:1:";";a:1:{s:9:"codepoint";i:8912;}s:1:"s";a:1:{s:1:"e";a:1:{s:1:"t";a:2:{s:1:";";a:1:{s:9:"codepoint";i:8912;}s:1:"E";a:1:{s:1:"q";a:1:{s:1:"u";a:1:{s:1:"a";a:1:{s:1:"l";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8838;}}}}}}}}}}s:1:"c";a:2:{s:1:"c";a:1:{s:1:"e";a:1:{s:1:"e";a:1:{s:1:"d";a:1:{s:1:"s";a:4:{s:1:";";a:1:{s:9:"codepoint";i:8827;}s:1:"E";a:1:{s:1:"q";a:1:{s:1:"u";a:1:{s:1:"a";a:1:{s:1:"l";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10928;}}}}}}s:1:"S";a:1:{s:1:"l";a:1:{s:1:"a";a:1:{s:1:"n";a:1:{s:1:"t";a:1:{s:1:"E";a:1:{s:1:"q";a:1:{s:1:"u";a:1:{s:1:"a";a:1:{s:1:"l";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8829;}}}}}}}}}}}s:1:"T";a:1:{s:1:"i";a:1:{s:1:"l";a:1:{s:1:"d";a:1:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8831;}}}}}}}}}}}s:1:"h";a:1:{s:1:"T";a:1:{s:1:"h";a:1:{s:1:"a";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8715;}}}}}}}s:1:"m";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8721;}}s:1:"p";a:3:{s:1:";";a:1:{s:9:"codepoint";i:8913;}s:1:"e";a:1:{s:1:"r";a:1:{s:1:"s";a:1:{s:1:"e";a:1:{s:1:"t";a:2:{s:1:";";a:1:{s:9:"codepoint";i:8835;}s:1:"E";a:1:{s:1:"q";a:1:{s:1:"u";a:1:{s:1:"a";a:1:{s:1:"l";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8839;}}}}}}}}}}}s:1:"s";a:1:{s:1:"e";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8913;}}}}}}}s:1:"T";a:11:{s:1:"H";a:1:{s:1:"O";a:1:{s:1:"R";a:1:{s:1:"N";a:2:{s:1:";";a:1:{s:9:"codepoint";i:222;}s:9:"codepoint";i:222;}}}}s:1:"R";a:1:{s:1:"A";a:1:{s:1:"D";a:1:{s:1:"E";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8482;}}}}}s:1:"S";a:2:{s:1:"H";a:1:{s:1:"c";a:1:{s:1:"y";a:1:{s:1:";";a:1:{s:9:"codepoint";i:1035;}}}}s:1:"c";a:1:{s:1:"y";a:1:{s:1:";";a:1:{s:9:"codepoint";i:1062;}}}}s:1:"a";a:2:{s:1:"b";a:1:{s:1:";";a:1:{s:9:"codepoint";i:9;}}s:1:"u";a:1:{s:1:";";a:1:{s:9:"codepoint";i:932;}}}s:1:"c";a:3:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:"o";a:1:{s:1:"n";a:1:{s:1:";";a:1:{s:9:"codepoint";i:356;}}}}}s:1:"e";a:1:{s:1:"d";a:1:{s:1:"i";a:1:{s:1:"l";a:1:{s:1:";";a:1:{s:9:"codepoint";i:354;}}}}}s:1:"y";a:1:{s:1:";";a:1:{s:9:"codepoint";i:1058;}}}s:1:"f";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:120087;}}}s:1:"h";a:2:{s:1:"e";a:2:{s:1:"r";a:1:{s:1:"e";a:1:{s:1:"f";a:1:{s:1:"o";a:1:{s:1:"r";a:1:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8756;}}}}}}}s:1:"t";a:1:{s:1:"a";a:1:{s:1:";";a:1:{s:9:"codepoint";i:920;}}}}s:1:"i";a:1:{s:1:"n";a:1:{s:1:"S";a:1:{s:1:"p";a:1:{s:1:"a";a:1:{s:1:"c";a:1:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8201;}}}}}}}}}s:1:"i";a:1:{s:1:"l";a:1:{s:1:"d";a:1:{s:1:"e";a:4:{s:1:";";a:1:{s:9:"codepoint";i:8764;}s:1:"E";a:1:{s:1:"q";a:1:{s:1:"u";a:1:{s:1:"a";a:1:{s:1:"l";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8771;}}}}}}s:1:"F";a:1:{s:1:"u";a:1:{s:1:"l";a:1:{s:1:"l";a:1:{s:1:"E";a:1:{s:1:"q";a:1:{s:1:"u";a:1:{s:1:"a";a:1:{s:1:"l";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8773;}}}}}}}}}}s:1:"T";a:1:{s:1:"i";a:1:{s:1:"l";a:1:{s:1:"d";a:1:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8776;}}}}}}}}}}s:1:"o";a:1:{s:1:"p";a:1:{s:1:"f";a:1:{s:1:";";a:1:{s:9:"codepoint";i:120139;}}}}s:1:"r";a:1:{s:1:"i";a:1:{s:1:"p";a:1:{s:1:"l";a:1:{s:1:"e";a:1:{s:1:"D";a:1:{s:1:"o";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8411;}}}}}}}}}s:1:"s";a:2:{s:1:"c";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:119983;}}}s:1:"t";a:1:{s:1:"r";a:1:{s:1:"o";a:1:{s:1:"k";a:1:{s:1:";";a:1:{s:9:"codepoint";i:358;}}}}}}}s:1:"U";a:14:{s:1:"a";a:2:{s:1:"c";a:1:{s:1:"u";a:1:{s:1:"t";a:1:{s:1:"e";a:2:{s:1:";";a:1:{s:9:"codepoint";i:218;}s:9:"codepoint";i:218;}}}}s:1:"r";a:1:{s:1:"r";a:2:{s:1:";";a:1:{s:9:"codepoint";i:8607;}s:1:"o";a:1:{s:1:"c";a:1:{s:1:"i";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10569;}}}}}}}}s:1:"b";a:1:{s:1:"r";a:2:{s:1:"c";a:1:{s:1:"y";a:1:{s:1:";";a:1:{s:9:"codepoint";i:1038;}}}s:1:"e";a:1:{s:1:"v";a:1:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:364;}}}}}}s:1:"c";a:2:{s:1:"i";a:1:{s:1:"r";a:1:{s:1:"c";a:2:{s:1:";";a:1:{s:9:"codepoint";i:219;}s:9:"codepoint";i:219;}}}s:1:"y";a:1:{s:1:";";a:1:{s:9:"codepoint";i:1059;}}}s:1:"d";a:1:{s:1:"b";a:1:{s:1:"l";a:1:{s:1:"a";a:1:{s:1:"c";a:1:{s:1:";";a:1:{s:9:"codepoint";i:368;}}}}}}s:1:"f";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:120088;}}}s:1:"g";a:1:{s:1:"r";a:1:{s:1:"a";a:1:{s:1:"v";a:1:{s:1:"e";a:2:{s:1:";";a:1:{s:9:"codepoint";i:217;}s:9:"codepoint";i:217;}}}}}s:1:"m";a:1:{s:1:"a";a:1:{s:1:"c";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:362;}}}}}s:1:"n";a:2:{s:1:"d";a:1:{s:1:"e";a:1:{s:1:"r";a:2:{s:1:"B";a:2:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:818;}}}s:1:"r";a:1:{s:1:"a";a:1:{s:1:"c";a:2:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:9183;}}s:1:"k";a:1:{s:1:"e";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:9141;}}}}}}}}s:1:"P";a:1:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:"e";a:1:{s:1:"n";a:1:{s:1:"t";a:1:{s:1:"h";a:1:{s:1:"e";a:1:{s:1:"s";a:1:{s:1:"i";a:1:{s:1:"s";a:1:{s:1:";";a:1:{s:9:"codepoint";i:9181;}}}}}}}}}}}}}}}s:1:"i";a:1:{s:1:"o";a:1:{s:1:"n";a:2:{s:1:";";a:1:{s:9:"codepoint";i:8899;}s:1:"P";a:1:{s:1:"l";a:1:{s:1:"u";a:1:{s:1:"s";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8846;}}}}}}}}}s:1:"o";a:2:{s:1:"g";a:1:{s:1:"o";a:1:{s:1:"n";a:1:{s:1:";";a:1:{s:9:"codepoint";i:370;}}}}s:1:"p";a:1:{s:1:"f";a:1:{s:1:";";a:1:{s:9:"codepoint";i:120140;}}}}s:1:"p";a:8:{s:1:"A";a:1:{s:1:"r";a:1:{s:1:"r";a:1:{s:1:"o";a:1:{s:1:"w";a:3:{s:1:";";a:1:{s:9:"codepoint";i:8593;}s:1:"B";a:1:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10514;}}}}s:1:"D";a:1:{s:1:"o";a:1:{s:1:"w";a:1:{s:1:"n";a:1:{s:1:"A";a:1:{s:1:"r";a:1:{s:1:"r";a:1:{s:1:"o";a:1:{s:1:"w";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8645;}}}}}}}}}}}}}}}s:1:"D";a:1:{s:1:"o";a:1:{s:1:"w";a:1:{s:1:"n";a:1:{s:1:"A";a:1:{s:1:"r";a:1:{s:1:"r";a:1:{s:1:"o";a:1:{s:1:"w";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8597;}}}}}}}}}}s:1:"E";a:1:{s:1:"q";a:1:{s:1:"u";a:1:{s:1:"i";a:1:{s:1:"l";a:1:{s:1:"i";a:1:{s:1:"b";a:1:{s:1:"r";a:1:{s:1:"i";a:1:{s:1:"u";a:1:{s:1:"m";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10606;}}}}}}}}}}}}s:1:"T";a:1:{s:1:"e";a:1:{s:1:"e";a:2:{s:1:";";a:1:{s:9:"codepoint";i:8869;}s:1:"A";a:1:{s:1:"r";a:1:{s:1:"r";a:1:{s:1:"o";a:1:{s:1:"w";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8613;}}}}}}}}}s:1:"a";a:1:{s:1:"r";a:1:{s:1:"r";a:1:{s:1:"o";a:1:{s:1:"w";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8657;}}}}}}s:1:"d";a:1:{s:1:"o";a:1:{s:1:"w";a:1:{s:1:"n";a:1:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:"r";a:1:{s:1:"o";a:1:{s:1:"w";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8661;}}}}}}}}}}s:1:"p";a:1:{s:1:"e";a:1:{s:1:"r";a:2:{s:1:"L";a:1:{s:1:"e";a:1:{s:1:"f";a:1:{s:1:"t";a:1:{s:1:"A";a:1:{s:1:"r";a:1:{s:1:"r";a:1:{s:1:"o";a:1:{s:1:"w";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8598;}}}}}}}}}}s:1:"R";a:1:{s:1:"i";a:1:{s:1:"g";a:1:{s:1:"h";a:1:{s:1:"t";a:1:{s:1:"A";a:1:{s:1:"r";a:1:{s:1:"r";a:1:{s:1:"o";a:1:{s:1:"w";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8599;}}}}}}}}}}}}}}s:1:"s";a:1:{s:1:"i";a:2:{s:1:";";a:1:{s:9:"codepoint";i:978;}s:1:"l";a:1:{s:1:"o";a:1:{s:1:"n";a:1:{s:1:";";a:1:{s:9:"codepoint";i:933;}}}}}}}s:1:"r";a:1:{s:1:"i";a:1:{s:1:"n";a:1:{s:1:"g";a:1:{s:1:";";a:1:{s:9:"codepoint";i:366;}}}}}s:1:"s";a:1:{s:1:"c";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:119984;}}}}s:1:"t";a:1:{s:1:"i";a:1:{s:1:"l";a:1:{s:1:"d";a:1:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:360;}}}}}}s:1:"u";a:1:{s:1:"m";a:1:{s:1:"l";a:2:{s:1:";";a:1:{s:9:"codepoint";i:220;}s:9:"codepoint";i:220;}}}}s:1:"V";a:9:{s:1:"D";a:1:{s:1:"a";a:1:{s:1:"s";a:1:{s:1:"h";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8875;}}}}}s:1:"b";a:1:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10987;}}}}s:1:"c";a:1:{s:1:"y";a:1:{s:1:";";a:1:{s:9:"codepoint";i:1042;}}}s:1:"d";a:1:{s:1:"a";a:1:{s:1:"s";a:1:{s:1:"h";a:2:{s:1:";";a:1:{s:9:"codepoint";i:8873;}s:1:"l";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10982;}}}}}}s:1:"e";a:2:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8897;}}s:1:"r";a:3:{s:1:"b";a:1:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8214;}}}}s:1:"t";a:2:{s:1:";";a:1:{s:9:"codepoint";i:8214;}s:1:"i";a:1:{s:1:"c";a:1:{s:1:"a";a:1:{s:1:"l";a:4:{s:1:"B";a:1:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8739;}}}}s:1:"L";a:1:{s:1:"i";a:1:{s:1:"n";a:1:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:124;}}}}}s:1:"S";a:1:{s:1:"e";a:1:{s:1:"p";a:1:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:"a";a:1:{s:1:"t";a:1:{s:1:"o";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10072;}}}}}}}}}}s:1:"T";a:1:{s:1:"i";a:1:{s:1:"l";a:1:{s:1:"d";a:1:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8768;}}}}}}}}}}}s:1:"y";a:1:{s:1:"T";a:1:{s:1:"h";a:1:{s:1:"i";a:1:{s:1:"n";a:1:{s:1:"S";a:1:{s:1:"p";a:1:{s:1:"a";a:1:{s:1:"c";a:1:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8202;}}}}}}}}}}}}}s:1:"f";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:120089;}}}s:1:"o";a:1:{s:1:"p";a:1:{s:1:"f";a:1:{s:1:";";a:1:{s:9:"codepoint";i:120141;}}}}s:1:"s";a:1:{s:1:"c";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:119985;}}}}s:1:"v";a:1:{s:1:"d";a:1:{s:1:"a";a:1:{s:1:"s";a:1:{s:1:"h";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8874;}}}}}}}s:1:"W";a:5:{s:1:"c";a:1:{s:1:"i";a:1:{s:1:"r";a:1:{s:1:"c";a:1:{s:1:";";a:1:{s:9:"codepoint";i:372;}}}}}s:1:"e";a:1:{s:1:"d";a:1:{s:1:"g";a:1:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8896;}}}}}s:1:"f";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:120090;}}}s:1:"o";a:1:{s:1:"p";a:1:{s:1:"f";a:1:{s:1:";";a:1:{s:9:"codepoint";i:120142;}}}}s:1:"s";a:1:{s:1:"c";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:119986;}}}}}s:1:"X";a:4:{s:1:"f";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:120091;}}}s:1:"i";a:1:{s:1:";";a:1:{s:9:"codepoint";i:926;}}s:1:"o";a:1:{s:1:"p";a:1:{s:1:"f";a:1:{s:1:";";a:1:{s:9:"codepoint";i:120143;}}}}s:1:"s";a:1:{s:1:"c";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:119987;}}}}}s:1:"Y";a:9:{s:1:"A";a:1:{s:1:"c";a:1:{s:1:"y";a:1:{s:1:";";a:1:{s:9:"codepoint";i:1071;}}}}s:1:"I";a:1:{s:1:"c";a:1:{s:1:"y";a:1:{s:1:";";a:1:{s:9:"codepoint";i:1031;}}}}s:1:"U";a:1:{s:1:"c";a:1:{s:1:"y";a:1:{s:1:";";a:1:{s:9:"codepoint";i:1070;}}}}s:1:"a";a:1:{s:1:"c";a:1:{s:1:"u";a:1:{s:1:"t";a:1:{s:1:"e";a:2:{s:1:";";a:1:{s:9:"codepoint";i:221;}s:9:"codepoint";i:221;}}}}}s:1:"c";a:2:{s:1:"i";a:1:{s:1:"r";a:1:{s:1:"c";a:1:{s:1:";";a:1:{s:9:"codepoint";i:374;}}}}s:1:"y";a:1:{s:1:";";a:1:{s:9:"codepoint";i:1067;}}}s:1:"f";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:120092;}}}s:1:"o";a:1:{s:1:"p";a:1:{s:1:"f";a:1:{s:1:";";a:1:{s:9:"codepoint";i:120144;}}}}s:1:"s";a:1:{s:1:"c";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:119988;}}}}s:1:"u";a:1:{s:1:"m";a:1:{s:1:"l";a:1:{s:1:";";a:1:{s:9:"codepoint";i:376;}}}}}s:1:"Z";a:8:{s:1:"H";a:1:{s:1:"c";a:1:{s:1:"y";a:1:{s:1:";";a:1:{s:9:"codepoint";i:1046;}}}}s:1:"a";a:1:{s:1:"c";a:1:{s:1:"u";a:1:{s:1:"t";a:1:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:377;}}}}}}s:1:"c";a:2:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:"o";a:1:{s:1:"n";a:1:{s:1:";";a:1:{s:9:"codepoint";i:381;}}}}}s:1:"y";a:1:{s:1:";";a:1:{s:9:"codepoint";i:1047;}}}s:1:"d";a:1:{s:1:"o";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:379;}}}}s:1:"e";a:2:{s:1:"r";a:1:{s:1:"o";a:1:{s:1:"W";a:1:{s:1:"i";a:1:{s:1:"d";a:1:{s:1:"t";a:1:{s:1:"h";a:1:{s:1:"S";a:1:{s:1:"p";a:1:{s:1:"a";a:1:{s:1:"c";a:1:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8203;}}}}}}}}}}}}}s:1:"t";a:1:{s:1:"a";a:1:{s:1:";";a:1:{s:9:"codepoint";i:918;}}}}s:1:"f";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8488;}}}s:1:"o";a:1:{s:1:"p";a:1:{s:1:"f";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8484;}}}}s:1:"s";a:1:{s:1:"c";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:119989;}}}}}s:1:"a";a:16:{s:1:"a";a:1:{s:1:"c";a:1:{s:1:"u";a:1:{s:1:"t";a:1:{s:1:"e";a:2:{s:1:";";a:1:{s:9:"codepoint";i:225;}s:9:"codepoint";i:225;}}}}}s:1:"b";a:1:{s:1:"r";a:1:{s:1:"e";a:1:{s:1:"v";a:1:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:259;}}}}}}s:1:"c";a:5:{s:1:";";a:1:{s:9:"codepoint";i:8766;}s:1:"d";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8767;}}s:1:"i";a:1:{s:1:"r";a:1:{s:1:"c";a:2:{s:1:";";a:1:{s:9:"codepoint";i:226;}s:9:"codepoint";i:226;}}}s:1:"u";a:1:{s:1:"t";a:1:{s:1:"e";a:2:{s:1:";";a:1:{s:9:"codepoint";i:180;}s:9:"codepoint";i:180;}}}s:1:"y";a:1:{s:1:";";a:1:{s:9:"codepoint";i:1072;}}}s:1:"e";a:1:{s:1:"l";a:1:{s:1:"i";a:1:{s:1:"g";a:2:{s:1:";";a:1:{s:9:"codepoint";i:230;}s:9:"codepoint";i:230;}}}}s:1:"f";a:2:{s:1:";";a:1:{s:9:"codepoint";i:8289;}s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:120094;}}}s:1:"g";a:1:{s:1:"r";a:1:{s:1:"a";a:1:{s:1:"v";a:1:{s:1:"e";a:2:{s:1:";";a:1:{s:9:"codepoint";i:224;}s:9:"codepoint";i:224;}}}}}s:1:"l";a:2:{s:1:"e";a:2:{s:1:"f";a:1:{s:1:"s";a:1:{s:1:"y";a:1:{s:1:"m";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8501;}}}}}s:1:"p";a:1:{s:1:"h";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8501;}}}}s:1:"p";a:1:{s:1:"h";a:1:{s:1:"a";a:1:{s:1:";";a:1:{s:9:"codepoint";i:945;}}}}}s:1:"m";a:2:{s:1:"a";a:2:{s:1:"c";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:257;}}}s:1:"l";a:1:{s:1:"g";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10815;}}}}s:1:"p";a:2:{s:1:";";a:1:{s:9:"codepoint";i:38;}s:9:"codepoint";i:38;}}s:1:"n";a:2:{s:1:"d";a:5:{s:1:";";a:1:{s:9:"codepoint";i:8743;}s:1:"a";a:1:{s:1:"n";a:1:{s:1:"d";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10837;}}}}s:1:"d";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10844;}}s:1:"s";a:1:{s:1:"l";a:1:{s:1:"o";a:1:{s:1:"p";a:1:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10840;}}}}}}s:1:"v";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10842;}}}s:1:"g";a:7:{s:1:";";a:1:{s:9:"codepoint";i:8736;}s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10660;}}s:1:"l";a:1:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8736;}}}s:1:"m";a:1:{s:1:"s";a:1:{s:1:"d";a:2:{s:1:";";a:1:{s:9:"codepoint";i:8737;}s:1:"a";a:8:{s:1:"a";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10664;}}s:1:"b";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10665;}}s:1:"c";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10666;}}s:1:"d";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10667;}}s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10668;}}s:1:"f";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10669;}}s:1:"g";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10670;}}s:1:"h";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10671;}}}}}}s:1:"r";a:1:{s:1:"t";a:2:{s:1:";";a:1:{s:9:"codepoint";i:8735;}s:1:"v";a:1:{s:1:"b";a:2:{s:1:";";a:1:{s:9:"codepoint";i:8894;}s:1:"d";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10653;}}}}}}s:1:"s";a:2:{s:1:"p";a:1:{s:1:"h";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8738;}}}s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8491;}}}s:1:"z";a:1:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:9084;}}}}}}}s:1:"o";a:2:{s:1:"g";a:1:{s:1:"o";a:1:{s:1:"n";a:1:{s:1:";";a:1:{s:9:"codepoint";i:261;}}}}s:1:"p";a:1:{s:1:"f";a:1:{s:1:";";a:1:{s:9:"codepoint";i:120146;}}}}s:1:"p";a:7:{s:1:";";a:1:{s:9:"codepoint";i:8776;}s:1:"E";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10864;}}s:1:"a";a:1:{s:1:"c";a:1:{s:1:"i";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10863;}}}}}s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8778;}}s:1:"i";a:1:{s:1:"d";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8779;}}}s:1:"o";a:1:{s:1:"s";a:1:{s:1:";";a:1:{s:9:"codepoint";i:39;}}}s:1:"p";a:1:{s:1:"r";a:1:{s:1:"o";a:1:{s:1:"x";a:2:{s:1:";";a:1:{s:9:"codepoint";i:8776;}s:1:"e";a:1:{s:1:"q";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8778;}}}}}}}}s:1:"r";a:1:{s:1:"i";a:1:{s:1:"n";a:1:{s:1:"g";a:2:{s:1:";";a:1:{s:9:"codepoint";i:229;}s:9:"codepoint";i:229;}}}}s:1:"s";a:3:{s:1:"c";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:119990;}}}s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:42;}}s:1:"y";a:1:{s:1:"m";a:1:{s:1:"p";a:2:{s:1:";";a:1:{s:9:"codepoint";i:8776;}s:1:"e";a:1:{s:1:"q";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8781;}}}}}}}s:1:"t";a:1:{s:1:"i";a:1:{s:1:"l";a:1:{s:1:"d";a:1:{s:1:"e";a:2:{s:1:";";a:1:{s:9:"codepoint";i:227;}s:9:"codepoint";i:227;}}}}}s:1:"u";a:1:{s:1:"m";a:1:{s:1:"l";a:2:{s:1:";";a:1:{s:9:"codepoint";i:228;}s:9:"codepoint";i:228;}}}s:1:"w";a:2:{s:1:"c";a:1:{s:1:"o";a:1:{s:1:"n";a:1:{s:1:"i";a:1:{s:1:"n";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8755;}}}}}}}s:1:"i";a:1:{s:1:"n";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10769;}}}}}}s:1:"b";a:16:{s:1:"N";a:1:{s:1:"o";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10989;}}}}s:1:"a";a:2:{s:1:"c";a:1:{s:1:"k";a:4:{s:1:"c";a:1:{s:1:"o";a:1:{s:1:"n";a:1:{s:1:"g";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8780;}}}}}s:1:"e";a:1:{s:1:"p";a:1:{s:1:"s";a:1:{s:1:"i";a:1:{s:1:"l";a:1:{s:1:"o";a:1:{s:1:"n";a:1:{s:1:";";a:1:{s:9:"codepoint";i:1014;}}}}}}}}s:1:"p";a:1:{s:1:"r";a:1:{s:1:"i";a:1:{s:1:"m";a:1:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8245;}}}}}}s:1:"s";a:1:{s:1:"i";a:1:{s:1:"m";a:2:{s:1:";";a:1:{s:9:"codepoint";i:8765;}s:1:"e";a:1:{s:1:"q";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8909;}}}}}}}}s:1:"r";a:2:{s:1:"v";a:1:{s:1:"e";a:1:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8893;}}}}s:1:"w";a:1:{s:1:"e";a:1:{s:1:"d";a:2:{s:1:";";a:1:{s:9:"codepoint";i:8965;}s:1:"g";a:1:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8965;}}}}}}}}s:1:"b";a:1:{s:1:"r";a:1:{s:1:"k";a:2:{s:1:";";a:1:{s:9:"codepoint";i:9141;}s:1:"t";a:1:{s:1:"b";a:1:{s:1:"r";a:1:{s:1:"k";a:1:{s:1:";";a:1:{s:9:"codepoint";i:9142;}}}}}}}}s:1:"c";a:2:{s:1:"o";a:1:{s:1:"n";a:1:{s:1:"g";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8780;}}}}s:1:"y";a:1:{s:1:";";a:1:{s:9:"codepoint";i:1073;}}}s:1:"d";a:1:{s:1:"q";a:1:{s:1:"u";a:1:{s:1:"o";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8222;}}}}}s:1:"e";a:5:{s:1:"c";a:1:{s:1:"a";a:1:{s:1:"u";a:1:{s:1:"s";a:2:{s:1:";";a:1:{s:9:"codepoint";i:8757;}s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8757;}}}}}}s:1:"m";a:1:{s:1:"p";a:1:{s:1:"t";a:1:{s:1:"y";a:1:{s:1:"v";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10672;}}}}}}s:1:"p";a:1:{s:1:"s";a:1:{s:1:"i";a:1:{s:1:";";a:1:{s:9:"codepoint";i:1014;}}}}s:1:"r";a:1:{s:1:"n";a:1:{s:1:"o";a:1:{s:1:"u";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8492;}}}}}s:1:"t";a:3:{s:1:"a";a:1:{s:1:";";a:1:{s:9:"codepoint";i:946;}}s:1:"h";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8502;}}s:1:"w";a:1:{s:1:"e";a:1:{s:1:"e";a:1:{s:1:"n";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8812;}}}}}}}s:1:"f";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:120095;}}}s:1:"i";a:1:{s:1:"g";a:7:{s:1:"c";a:3:{s:1:"a";a:1:{s:1:"p";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8898;}}}s:1:"i";a:1:{s:1:"r";a:1:{s:1:"c";a:1:{s:1:";";a:1:{s:9:"codepoint";i:9711;}}}}s:1:"u";a:1:{s:1:"p";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8899;}}}}s:1:"o";a:3:{s:1:"d";a:1:{s:1:"o";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10752;}}}}s:1:"p";a:1:{s:1:"l";a:1:{s:1:"u";a:1:{s:1:"s";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10753;}}}}}s:1:"t";a:1:{s:1:"i";a:1:{s:1:"m";a:1:{s:1:"e";a:1:{s:1:"s";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10754;}}}}}}}s:1:"s";a:2:{s:1:"q";a:1:{s:1:"c";a:1:{s:1:"u";a:1:{s:1:"p";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10758;}}}}}s:1:"t";a:1:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:9733;}}}}}s:1:"t";a:1:{s:1:"r";a:1:{s:1:"i";a:1:{s:1:"a";a:1:{s:1:"n";a:1:{s:1:"g";a:1:{s:1:"l";a:1:{s:1:"e";a:2:{s:1:"d";a:1:{s:1:"o";a:1:{s:1:"w";a:1:{s:1:"n";a:1:{s:1:";";a:1:{s:9:"codepoint";i:9661;}}}}}s:1:"u";a:1:{s:1:"p";a:1:{s:1:";";a:1:{s:9:"codepoint";i:9651;}}}}}}}}}}}s:1:"u";a:1:{s:1:"p";a:1:{s:1:"l";a:1:{s:1:"u";a:1:{s:1:"s";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10756;}}}}}}s:1:"v";a:1:{s:1:"e";a:1:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8897;}}}}s:1:"w";a:1:{s:1:"e";a:1:{s:1:"d";a:1:{s:1:"g";a:1:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8896;}}}}}}}}s:1:"k";a:1:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:"o";a:1:{s:1:"w";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10509;}}}}}}s:1:"l";a:3:{s:1:"a";a:2:{s:1:"c";a:1:{s:1:"k";a:3:{s:1:"l";a:1:{s:1:"o";a:1:{s:1:"z";a:1:{s:1:"e";a:1:{s:1:"n";a:1:{s:1:"g";a:1:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10731;}}}}}}}}s:1:"s";a:1:{s:1:"q";a:1:{s:1:"u";a:1:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:9642;}}}}}}}s:1:"t";a:1:{s:1:"r";a:1:{s:1:"i";a:1:{s:1:"a";a:1:{s:1:"n";a:1:{s:1:"g";a:1:{s:1:"l";a:1:{s:1:"e";a:4:{s:1:";";a:1:{s:9:"codepoint";i:9652;}s:1:"d";a:1:{s:1:"o";a:1:{s:1:"w";a:1:{s:1:"n";a:1:{s:1:";";a:1:{s:9:"codepoint";i:9662;}}}}}s:1:"l";a:1:{s:1:"e";a:1:{s:1:"f";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:9666;}}}}}s:1:"r";a:1:{s:1:"i";a:1:{s:1:"g";a:1:{s:1:"h";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:9656;}}}}}}}}}}}}}}}}s:1:"n";a:1:{s:1:"k";a:1:{s:1:";";a:1:{s:9:"codepoint";i:9251;}}}}s:1:"k";a:2:{i:1;a:2:{i:2;a:1:{s:1:";";a:1:{s:9:"codepoint";i:9618;}}i:4;a:1:{s:1:";";a:1:{s:9:"codepoint";i:9617;}}}i:3;a:1:{i:4;a:1:{s:1:";";a:1:{s:9:"codepoint";i:9619;}}}}s:1:"o";a:1:{s:1:"c";a:1:{s:1:"k";a:1:{s:1:";";a:1:{s:9:"codepoint";i:9608;}}}}}s:1:"n";a:1:{s:1:"o";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8976;}}}}s:1:"o";a:4:{s:1:"p";a:1:{s:1:"f";a:1:{s:1:";";a:1:{s:9:"codepoint";i:120147;}}}s:1:"t";a:2:{s:1:";";a:1:{s:9:"codepoint";i:8869;}s:1:"t";a:1:{s:1:"o";a:1:{s:1:"m";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8869;}}}}}s:1:"w";a:1:{s:1:"t";a:1:{s:1:"i";a:1:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8904;}}}}}s:1:"x";a:12:{s:1:"D";a:4:{s:1:"L";a:1:{s:1:";";a:1:{s:9:"codepoint";i:9559;}}s:1:"R";a:1:{s:1:";";a:1:{s:9:"codepoint";i:9556;}}s:1:"l";a:1:{s:1:";";a:1:{s:9:"codepoint";i:9558;}}s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:9555;}}}s:1:"H";a:5:{s:1:";";a:1:{s:9:"codepoint";i:9552;}s:1:"D";a:1:{s:1:";";a:1:{s:9:"codepoint";i:9574;}}s:1:"U";a:1:{s:1:";";a:1:{s:9:"codepoint";i:9577;}}s:1:"d";a:1:{s:1:";";a:1:{s:9:"codepoint";i:9572;}}s:1:"u";a:1:{s:1:";";a:1:{s:9:"codepoint";i:9575;}}}s:1:"U";a:4:{s:1:"L";a:1:{s:1:";";a:1:{s:9:"codepoint";i:9565;}}s:1:"R";a:1:{s:1:";";a:1:{s:9:"codepoint";i:9562;}}s:1:"l";a:1:{s:1:";";a:1:{s:9:"codepoint";i:9564;}}s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:9561;}}}s:1:"V";a:7:{s:1:";";a:1:{s:9:"codepoint";i:9553;}s:1:"H";a:1:{s:1:";";a:1:{s:9:"codepoint";i:9580;}}s:1:"L";a:1:{s:1:";";a:1:{s:9:"codepoint";i:9571;}}s:1:"R";a:1:{s:1:";";a:1:{s:9:"codepoint";i:9568;}}s:1:"h";a:1:{s:1:";";a:1:{s:9:"codepoint";i:9579;}}s:1:"l";a:1:{s:1:";";a:1:{s:9:"codepoint";i:9570;}}s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:9567;}}}s:1:"b";a:1:{s:1:"o";a:1:{s:1:"x";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10697;}}}}s:1:"d";a:4:{s:1:"L";a:1:{s:1:";";a:1:{s:9:"codepoint";i:9557;}}s:1:"R";a:1:{s:1:";";a:1:{s:9:"codepoint";i:9554;}}s:1:"l";a:1:{s:1:";";a:1:{s:9:"codepoint";i:9488;}}s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:9484;}}}s:1:"h";a:5:{s:1:";";a:1:{s:9:"codepoint";i:9472;}s:1:"D";a:1:{s:1:";";a:1:{s:9:"codepoint";i:9573;}}s:1:"U";a:1:{s:1:";";a:1:{s:9:"codepoint";i:9576;}}s:1:"d";a:1:{s:1:";";a:1:{s:9:"codepoint";i:9516;}}s:1:"u";a:1:{s:1:";";a:1:{s:9:"codepoint";i:9524;}}}s:1:"m";a:1:{s:1:"i";a:1:{s:1:"n";a:1:{s:1:"u";a:1:{s:1:"s";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8863;}}}}}}s:1:"p";a:1:{s:1:"l";a:1:{s:1:"u";a:1:{s:1:"s";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8862;}}}}}s:1:"t";a:1:{s:1:"i";a:1:{s:1:"m";a:1:{s:1:"e";a:1:{s:1:"s";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8864;}}}}}}s:1:"u";a:4:{s:1:"L";a:1:{s:1:";";a:1:{s:9:"codepoint";i:9563;}}s:1:"R";a:1:{s:1:";";a:1:{s:9:"codepoint";i:9560;}}s:1:"l";a:1:{s:1:";";a:1:{s:9:"codepoint";i:9496;}}s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:9492;}}}s:1:"v";a:7:{s:1:";";a:1:{s:9:"codepoint";i:9474;}s:1:"H";a:1:{s:1:";";a:1:{s:9:"codepoint";i:9578;}}s:1:"L";a:1:{s:1:";";a:1:{s:9:"codepoint";i:9569;}}s:1:"R";a:1:{s:1:";";a:1:{s:9:"codepoint";i:9566;}}s:1:"h";a:1:{s:1:";";a:1:{s:9:"codepoint";i:9532;}}s:1:"l";a:1:{s:1:";";a:1:{s:9:"codepoint";i:9508;}}s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:9500;}}}}}s:1:"p";a:1:{s:1:"r";a:1:{s:1:"i";a:1:{s:1:"m";a:1:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8245;}}}}}}s:1:"r";a:2:{s:1:"e";a:1:{s:1:"v";a:1:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:728;}}}}s:1:"v";a:1:{s:1:"b";a:1:{s:1:"a";a:1:{s:1:"r";a:2:{s:1:";";a:1:{s:9:"codepoint";i:166;}s:9:"codepoint";i:166;}}}}}s:1:"s";a:4:{s:1:"c";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:119991;}}}s:1:"e";a:1:{s:1:"m";a:1:{s:1:"i";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8271;}}}}s:1:"i";a:1:{s:1:"m";a:2:{s:1:";";a:1:{s:9:"codepoint";i:8765;}s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8909;}}}}s:1:"o";a:1:{s:1:"l";a:2:{s:1:";";a:1:{s:9:"codepoint";i:92;}s:1:"b";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10693;}}}}}s:1:"u";a:2:{s:1:"l";a:1:{s:1:"l";a:2:{s:1:";";a:1:{s:9:"codepoint";i:8226;}s:1:"e";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8226;}}}}}s:1:"m";a:1:{s:1:"p";a:3:{s:1:";";a:1:{s:9:"codepoint";i:8782;}s:1:"E";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10926;}}s:1:"e";a:2:{s:1:";";a:1:{s:9:"codepoint";i:8783;}s:1:"q";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8783;}}}}}}}s:1:"c";a:15:{s:1:"a";a:3:{s:1:"c";a:1:{s:1:"u";a:1:{s:1:"t";a:1:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:263;}}}}}s:1:"p";a:5:{s:1:";";a:1:{s:9:"codepoint";i:8745;}s:1:"a";a:1:{s:1:"n";a:1:{s:1:"d";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10820;}}}}s:1:"b";a:1:{s:1:"r";a:1:{s:1:"c";a:1:{s:1:"u";a:1:{s:1:"p";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10825;}}}}}}s:1:"c";a:2:{s:1:"a";a:1:{s:1:"p";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10827;}}}s:1:"u";a:1:{s:1:"p";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10823;}}}}s:1:"d";a:1:{s:1:"o";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10816;}}}}}s:1:"r";a:2:{s:1:"e";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8257;}}}s:1:"o";a:1:{s:1:"n";a:1:{s:1:";";a:1:{s:9:"codepoint";i:711;}}}}}s:1:"c";a:4:{s:1:"a";a:2:{s:1:"p";a:1:{s:1:"s";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10829;}}}s:1:"r";a:1:{s:1:"o";a:1:{s:1:"n";a:1:{s:1:";";a:1:{s:9:"codepoint";i:269;}}}}}s:1:"e";a:1:{s:1:"d";a:1:{s:1:"i";a:1:{s:1:"l";a:2:{s:1:";";a:1:{s:9:"codepoint";i:231;}s:9:"codepoint";i:231;}}}}s:1:"i";a:1:{s:1:"r";a:1:{s:1:"c";a:1:{s:1:";";a:1:{s:9:"codepoint";i:265;}}}}s:1:"u";a:1:{s:1:"p";a:1:{s:1:"s";a:2:{s:1:";";a:1:{s:9:"codepoint";i:10828;}s:1:"s";a:1:{s:1:"m";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10832;}}}}}}}s:1:"d";a:1:{s:1:"o";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:267;}}}}s:1:"e";a:3:{s:1:"d";a:1:{s:1:"i";a:1:{s:1:"l";a:2:{s:1:";";a:1:{s:9:"codepoint";i:184;}s:9:"codepoint";i:184;}}}s:1:"m";a:1:{s:1:"p";a:1:{s:1:"t";a:1:{s:1:"y";a:1:{s:1:"v";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10674;}}}}}}s:1:"n";a:1:{s:1:"t";a:3:{s:1:";";a:1:{s:9:"codepoint";i:162;}s:9:"codepoint";i:162;s:1:"e";a:1:{s:1:"r";a:1:{s:1:"d";a:1:{s:1:"o";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:183;}}}}}}}}}s:1:"f";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:120096;}}}s:1:"h";a:3:{s:1:"c";a:1:{s:1:"y";a:1:{s:1:";";a:1:{s:9:"codepoint";i:1095;}}}s:1:"e";a:1:{s:1:"c";a:1:{s:1:"k";a:2:{s:1:";";a:1:{s:9:"codepoint";i:10003;}s:1:"m";a:1:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:"k";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10003;}}}}}}}}s:1:"i";a:1:{s:1:";";a:1:{s:9:"codepoint";i:967;}}}s:1:"i";a:1:{s:1:"r";a:7:{s:1:";";a:1:{s:9:"codepoint";i:9675;}s:1:"E";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10691;}}s:1:"c";a:3:{s:1:";";a:1:{s:9:"codepoint";i:710;}s:1:"e";a:1:{s:1:"q";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8791;}}}s:1:"l";a:1:{s:1:"e";a:2:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:"r";a:1:{s:1:"o";a:1:{s:1:"w";a:2:{s:1:"l";a:1:{s:1:"e";a:1:{s:1:"f";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8634;}}}}}s:1:"r";a:1:{s:1:"i";a:1:{s:1:"g";a:1:{s:1:"h";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8635;}}}}}}}}}}}s:1:"d";a:5:{s:1:"R";a:1:{s:1:";";a:1:{s:9:"codepoint";i:174;}}s:1:"S";a:1:{s:1:";";a:1:{s:9:"codepoint";i:9416;}}s:1:"a";a:1:{s:1:"s";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8859;}}}}s:1:"c";a:1:{s:1:"i";a:1:{s:1:"r";a:1:{s:1:"c";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8858;}}}}}s:1:"d";a:1:{s:1:"a";a:1:{s:1:"s";a:1:{s:1:"h";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8861;}}}}}}}}}s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8791;}}s:1:"f";a:1:{s:1:"n";a:1:{s:1:"i";a:1:{s:1:"n";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10768;}}}}}}s:1:"m";a:1:{s:1:"i";a:1:{s:1:"d";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10991;}}}}s:1:"s";a:1:{s:1:"c";a:1:{s:1:"i";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10690;}}}}}}}s:1:"l";a:1:{s:1:"u";a:1:{s:1:"b";a:1:{s:1:"s";a:2:{s:1:";";a:1:{s:9:"codepoint";i:9827;}s:1:"u";a:1:{s:1:"i";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:9827;}}}}}}}}s:1:"o";a:4:{s:1:"l";a:1:{s:1:"o";a:1:{s:1:"n";a:2:{s:1:";";a:1:{s:9:"codepoint";i:58;}s:1:"e";a:2:{s:1:";";a:1:{s:9:"codepoint";i:8788;}s:1:"q";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8788;}}}}}}s:1:"m";a:2:{s:1:"m";a:1:{s:1:"a";a:2:{s:1:";";a:1:{s:9:"codepoint";i:44;}s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:64;}}}}s:1:"p";a:3:{s:1:";";a:1:{s:9:"codepoint";i:8705;}s:1:"f";a:1:{s:1:"n";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8728;}}}s:1:"l";a:1:{s:1:"e";a:2:{s:1:"m";a:1:{s:1:"e";a:1:{s:1:"n";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8705;}}}}}s:1:"x";a:1:{s:1:"e";a:1:{s:1:"s";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8450;}}}}}}}}s:1:"n";a:2:{s:1:"g";a:2:{s:1:";";a:1:{s:9:"codepoint";i:8773;}s:1:"d";a:1:{s:1:"o";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10861;}}}}}s:1:"i";a:1:{s:1:"n";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8750;}}}}}s:1:"p";a:3:{s:1:"f";a:1:{s:1:";";a:1:{s:9:"codepoint";i:120148;}}s:1:"r";a:1:{s:1:"o";a:1:{s:1:"d";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8720;}}}}s:1:"y";a:3:{s:1:";";a:1:{s:9:"codepoint";i:169;}s:9:"codepoint";i:169;s:1:"s";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8471;}}}}}}s:1:"r";a:2:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8629;}}}}s:1:"o";a:1:{s:1:"s";a:1:{s:1:"s";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10007;}}}}}s:1:"s";a:2:{s:1:"c";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:119992;}}}s:1:"u";a:2:{s:1:"b";a:2:{s:1:";";a:1:{s:9:"codepoint";i:10959;}s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10961;}}}s:1:"p";a:2:{s:1:";";a:1:{s:9:"codepoint";i:10960;}s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10962;}}}}}s:1:"t";a:1:{s:1:"d";a:1:{s:1:"o";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8943;}}}}}s:1:"u";a:7:{s:1:"d";a:1:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:"r";a:2:{s:1:"l";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10552;}}s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10549;}}}}}}s:1:"e";a:2:{s:1:"p";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8926;}}}s:1:"s";a:1:{s:1:"c";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8927;}}}}s:1:"l";a:1:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:"r";a:2:{s:1:";";a:1:{s:9:"codepoint";i:8630;}s:1:"p";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10557;}}}}}}s:1:"p";a:5:{s:1:";";a:1:{s:9:"codepoint";i:8746;}s:1:"b";a:1:{s:1:"r";a:1:{s:1:"c";a:1:{s:1:"a";a:1:{s:1:"p";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10824;}}}}}}s:1:"c";a:2:{s:1:"a";a:1:{s:1:"p";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10822;}}}s:1:"u";a:1:{s:1:"p";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10826;}}}}s:1:"d";a:1:{s:1:"o";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8845;}}}}s:1:"o";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10821;}}}}s:1:"r";a:4:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:"r";a:2:{s:1:";";a:1:{s:9:"codepoint";i:8631;}s:1:"m";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10556;}}}}}s:1:"l";a:1:{s:1:"y";a:3:{s:1:"e";a:1:{s:1:"q";a:2:{s:1:"p";a:1:{s:1:"r";a:1:{s:1:"e";a:1:{s:1:"c";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8926;}}}}}s:1:"s";a:1:{s:1:"u";a:1:{s:1:"c";a:1:{s:1:"c";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8927;}}}}}}}s:1:"v";a:1:{s:1:"e";a:1:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8910;}}}}s:1:"w";a:1:{s:1:"e";a:1:{s:1:"d";a:1:{s:1:"g";a:1:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8911;}}}}}}}}s:1:"r";a:1:{s:1:"e";a:1:{s:1:"n";a:2:{s:1:";";a:1:{s:9:"codepoint";i:164;}s:9:"codepoint";i:164;}}}s:1:"v";a:1:{s:1:"e";a:1:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:"r";a:1:{s:1:"o";a:1:{s:1:"w";a:2:{s:1:"l";a:1:{s:1:"e";a:1:{s:1:"f";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8630;}}}}}s:1:"r";a:1:{s:1:"i";a:1:{s:1:"g";a:1:{s:1:"h";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8631;}}}}}}}}}}}}}}s:1:"v";a:1:{s:1:"e";a:1:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8910;}}}}s:1:"w";a:1:{s:1:"e";a:1:{s:1:"d";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8911;}}}}}s:1:"w";a:2:{s:1:"c";a:1:{s:1:"o";a:1:{s:1:"n";a:1:{s:1:"i";a:1:{s:1:"n";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8754;}}}}}}}s:1:"i";a:1:{s:1:"n";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8753;}}}}}s:1:"y";a:1:{s:1:"l";a:1:{s:1:"c";a:1:{s:1:"t";a:1:{s:1:"y";a:1:{s:1:";";a:1:{s:9:"codepoint";i:9005;}}}}}}}s:1:"d";a:19:{s:1:"A";a:1:{s:1:"r";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8659;}}}}s:1:"H";a:1:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10597;}}}}s:1:"a";a:4:{s:1:"g";a:1:{s:1:"g";a:1:{s:1:"e";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8224;}}}}}s:1:"l";a:1:{s:1:"e";a:1:{s:1:"t";a:1:{s:1:"h";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8504;}}}}}s:1:"r";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8595;}}}s:1:"s";a:1:{s:1:"h";a:2:{s:1:";";a:1:{s:9:"codepoint";i:8208;}s:1:"v";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8867;}}}}}s:1:"b";a:2:{s:1:"k";a:1:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:"o";a:1:{s:1:"w";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10511;}}}}}}s:1:"l";a:1:{s:1:"a";a:1:{s:1:"c";a:1:{s:1:";";a:1:{s:9:"codepoint";i:733;}}}}}s:1:"c";a:2:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:"o";a:1:{s:1:"n";a:1:{s:1:";";a:1:{s:9:"codepoint";i:271;}}}}}s:1:"y";a:1:{s:1:";";a:1:{s:9:"codepoint";i:1076;}}}s:1:"d";a:3:{s:1:";";a:1:{s:9:"codepoint";i:8518;}s:1:"a";a:2:{s:1:"g";a:1:{s:1:"g";a:1:{s:1:"e";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8225;}}}}}s:1:"r";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8650;}}}}s:1:"o";a:1:{s:1:"t";a:1:{s:1:"s";a:1:{s:1:"e";a:1:{s:1:"q";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10871;}}}}}}}s:1:"e";a:3:{s:1:"g";a:2:{s:1:";";a:1:{s:9:"codepoint";i:176;}s:9:"codepoint";i:176;}s:1:"l";a:1:{s:1:"t";a:1:{s:1:"a";a:1:{s:1:";";a:1:{s:9:"codepoint";i:948;}}}}s:1:"m";a:1:{s:1:"p";a:1:{s:1:"t";a:1:{s:1:"y";a:1:{s:1:"v";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10673;}}}}}}}s:1:"f";a:2:{s:1:"i";a:1:{s:1:"s";a:1:{s:1:"h";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10623;}}}}}s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:120097;}}}s:1:"h";a:1:{s:1:"a";a:1:{s:1:"r";a:2:{s:1:"l";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8643;}}s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8642;}}}}}s:1:"i";a:5:{s:1:"a";a:1:{s:1:"m";a:3:{s:1:";";a:1:{s:9:"codepoint";i:8900;}s:1:"o";a:1:{s:1:"n";a:1:{s:1:"d";a:2:{s:1:";";a:1:{s:9:"codepoint";i:8900;}s:1:"s";a:1:{s:1:"u";a:1:{s:1:"i";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:9830;}}}}}}}}s:1:"s";a:1:{s:1:";";a:1:{s:9:"codepoint";i:9830;}}}}s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:168;}}s:1:"g";a:1:{s:1:"a";a:1:{s:1:"m";a:1:{s:1:"m";a:1:{s:1:"a";a:1:{s:1:";";a:1:{s:9:"codepoint";i:989;}}}}}}s:1:"s";a:1:{s:1:"i";a:1:{s:1:"n";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8946;}}}}s:1:"v";a:3:{s:1:";";a:1:{s:9:"codepoint";i:247;}s:1:"i";a:1:{s:1:"d";a:1:{s:1:"e";a:3:{s:1:";";a:1:{s:9:"codepoint";i:247;}s:9:"codepoint";i:247;s:1:"o";a:1:{s:1:"n";a:1:{s:1:"t";a:1:{s:1:"i";a:1:{s:1:"m";a:1:{s:1:"e";a:1:{s:1:"s";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8903;}}}}}}}}}}}s:1:"o";a:1:{s:1:"n";a:1:{s:1:"x";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8903;}}}}}}s:1:"j";a:1:{s:1:"c";a:1:{s:1:"y";a:1:{s:1:";";a:1:{s:9:"codepoint";i:1106;}}}}s:1:"l";a:1:{s:1:"c";a:2:{s:1:"o";a:1:{s:1:"r";a:1:{s:1:"n";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8990;}}}}s:1:"r";a:1:{s:1:"o";a:1:{s:1:"p";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8973;}}}}}}s:1:"o";a:5:{s:1:"l";a:1:{s:1:"l";a:1:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:36;}}}}}s:1:"p";a:1:{s:1:"f";a:1:{s:1:";";a:1:{s:9:"codepoint";i:120149;}}}s:1:"t";a:5:{s:1:";";a:1:{s:9:"codepoint";i:729;}s:1:"e";a:1:{s:1:"q";a:2:{s:1:";";a:1:{s:9:"codepoint";i:8784;}s:1:"d";a:1:{s:1:"o";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8785;}}}}}}s:1:"m";a:1:{s:1:"i";a:1:{s:1:"n";a:1:{s:1:"u";a:1:{s:1:"s";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8760;}}}}}}s:1:"p";a:1:{s:1:"l";a:1:{s:1:"u";a:1:{s:1:"s";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8724;}}}}}s:1:"s";a:1:{s:1:"q";a:1:{s:1:"u";a:1:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8865;}}}}}}}}s:1:"u";a:1:{s:1:"b";a:1:{s:1:"l";a:1:{s:1:"e";a:1:{s:1:"b";a:1:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:"w";a:1:{s:1:"e";a:1:{s:1:"d";a:1:{s:1:"g";a:1:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8966;}}}}}}}}}}}}}s:1:"w";a:1:{s:1:"n";a:3:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:"r";a:1:{s:1:"o";a:1:{s:1:"w";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8595;}}}}}}s:1:"d";a:1:{s:1:"o";a:1:{s:1:"w";a:1:{s:1:"n";a:1:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:"r";a:1:{s:1:"o";a:1:{s:1:"w";a:1:{s:1:"s";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8650;}}}}}}}}}}}s:1:"h";a:1:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:"p";a:1:{s:1:"o";a:1:{s:1:"o";a:1:{s:1:"n";a:2:{s:1:"l";a:1:{s:1:"e";a:1:{s:1:"f";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8643;}}}}}s:1:"r";a:1:{s:1:"i";a:1:{s:1:"g";a:1:{s:1:"h";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8642;}}}}}}}}}}}}}}}}s:1:"r";a:2:{s:1:"b";a:1:{s:1:"k";a:1:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:"o";a:1:{s:1:"w";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10512;}}}}}}}s:1:"c";a:2:{s:1:"o";a:1:{s:1:"r";a:1:{s:1:"n";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8991;}}}}s:1:"r";a:1:{s:1:"o";a:1:{s:1:"p";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8972;}}}}}}s:1:"s";a:3:{s:1:"c";a:2:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:119993;}}s:1:"y";a:1:{s:1:";";a:1:{s:9:"codepoint";i:1109;}}}s:1:"o";a:1:{s:1:"l";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10742;}}}s:1:"t";a:1:{s:1:"r";a:1:{s:1:"o";a:1:{s:1:"k";a:1:{s:1:";";a:1:{s:9:"codepoint";i:273;}}}}}}s:1:"t";a:2:{s:1:"d";a:1:{s:1:"o";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8945;}}}}s:1:"r";a:1:{s:1:"i";a:2:{s:1:";";a:1:{s:9:"codepoint";i:9663;}s:1:"f";a:1:{s:1:";";a:1:{s:9:"codepoint";i:9662;}}}}}s:1:"u";a:2:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8693;}}}}s:1:"h";a:1:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10607;}}}}}s:1:"w";a:1:{s:1:"a";a:1:{s:1:"n";a:1:{s:1:"g";a:1:{s:1:"l";a:1:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10662;}}}}}}}s:1:"z";a:2:{s:1:"c";a:1:{s:1:"y";a:1:{s:1:";";a:1:{s:9:"codepoint";i:1119;}}}s:1:"i";a:1:{s:1:"g";a:1:{s:1:"r";a:1:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10239;}}}}}}}}}s:1:"e";a:18:{s:1:"D";a:2:{s:1:"D";a:1:{s:1:"o";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10871;}}}}s:1:"o";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8785;}}}}s:1:"a";a:2:{s:1:"c";a:1:{s:1:"u";a:1:{s:1:"t";a:1:{s:1:"e";a:2:{s:1:";";a:1:{s:9:"codepoint";i:233;}s:9:"codepoint";i:233;}}}}s:1:"s";a:1:{s:1:"t";a:1:{s:1:"e";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10862;}}}}}}s:1:"c";a:4:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:"o";a:1:{s:1:"n";a:1:{s:1:";";a:1:{s:9:"codepoint";i:283;}}}}}s:1:"i";a:1:{s:1:"r";a:2:{s:1:";";a:1:{s:9:"codepoint";i:8790;}s:1:"c";a:2:{s:1:";";a:1:{s:9:"codepoint";i:234;}s:9:"codepoint";i:234;}}}s:1:"o";a:1:{s:1:"l";a:1:{s:1:"o";a:1:{s:1:"n";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8789;}}}}}s:1:"y";a:1:{s:1:";";a:1:{s:9:"codepoint";i:1101;}}}s:1:"d";a:1:{s:1:"o";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:279;}}}}s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8519;}}s:1:"f";a:2:{s:1:"D";a:1:{s:1:"o";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8786;}}}}s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:120098;}}}s:1:"g";a:3:{s:1:";";a:1:{s:9:"codepoint";i:10906;}s:1:"r";a:1:{s:1:"a";a:1:{s:1:"v";a:1:{s:1:"e";a:2:{s:1:";";a:1:{s:9:"codepoint";i:232;}s:9:"codepoint";i:232;}}}}s:1:"s";a:2:{s:1:";";a:1:{s:9:"codepoint";i:10902;}s:1:"d";a:1:{s:1:"o";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10904;}}}}}}s:1:"l";a:4:{s:1:";";a:1:{s:9:"codepoint";i:10905;}s:1:"i";a:1:{s:1:"n";a:1:{s:1:"t";a:1:{s:1:"e";a:1:{s:1:"r";a:1:{s:1:"s";a:1:{s:1:";";a:1:{s:9:"codepoint";i:9191;}}}}}}}s:1:"l";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8467;}}s:1:"s";a:2:{s:1:";";a:1:{s:9:"codepoint";i:10901;}s:1:"d";a:1:{s:1:"o";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10903;}}}}}}s:1:"m";a:3:{s:1:"a";a:1:{s:1:"c";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:275;}}}}s:1:"p";a:1:{s:1:"t";a:1:{s:1:"y";a:3:{s:1:";";a:1:{s:9:"codepoint";i:8709;}s:1:"s";a:1:{s:1:"e";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8709;}}}}s:1:"v";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8709;}}}}}s:1:"s";a:1:{s:1:"p";a:2:{i:1;a:2:{i:3;a:1:{s:1:";";a:1:{s:9:"codepoint";i:8196;}}i:4;a:1:{s:1:";";a:1:{s:9:"codepoint";i:8197;}}}s:1:";";a:1:{s:9:"codepoint";i:8195;}}}}s:1:"n";a:2:{s:1:"g";a:1:{s:1:";";a:1:{s:9:"codepoint";i:331;}}s:1:"s";a:1:{s:1:"p";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8194;}}}}s:1:"o";a:2:{s:1:"g";a:1:{s:1:"o";a:1:{s:1:"n";a:1:{s:1:";";a:1:{s:9:"codepoint";i:281;}}}}s:1:"p";a:1:{s:1:"f";a:1:{s:1:";";a:1:{s:9:"codepoint";i:120150;}}}}s:1:"p";a:3:{s:1:"a";a:1:{s:1:"r";a:2:{s:1:";";a:1:{s:9:"codepoint";i:8917;}s:1:"s";a:1:{s:1:"l";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10723;}}}}}s:1:"l";a:1:{s:1:"u";a:1:{s:1:"s";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10865;}}}}s:1:"s";a:1:{s:1:"i";a:3:{s:1:";";a:1:{s:9:"codepoint";i:1013;}s:1:"l";a:1:{s:1:"o";a:1:{s:1:"n";a:1:{s:1:";";a:1:{s:9:"codepoint";i:949;}}}}s:1:"v";a:1:{s:1:";";a:1:{s:9:"codepoint";i:949;}}}}}s:1:"q";a:4:{s:1:"c";a:2:{s:1:"i";a:1:{s:1:"r";a:1:{s:1:"c";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8790;}}}}s:1:"o";a:1:{s:1:"l";a:1:{s:1:"o";a:1:{s:1:"n";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8789;}}}}}}s:1:"s";a:2:{s:1:"i";a:1:{s:1:"m";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8770;}}}s:1:"l";a:1:{s:1:"a";a:1:{s:1:"n";a:1:{s:1:"t";a:2:{s:1:"g";a:1:{s:1:"t";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10902;}}}}s:1:"l";a:1:{s:1:"e";a:1:{s:1:"s";a:1:{s:1:"s";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10901;}}}}}}}}}}s:1:"u";a:3:{s:1:"a";a:1:{s:1:"l";a:1:{s:1:"s";a:1:{s:1:";";a:1:{s:9:"codepoint";i:61;}}}}s:1:"e";a:1:{s:1:"s";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8799;}}}}s:1:"i";a:1:{s:1:"v";a:2:{s:1:";";a:1:{s:9:"codepoint";i:8801;}s:1:"D";a:1:{s:1:"D";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10872;}}}}}}s:1:"v";a:1:{s:1:"p";a:1:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:"s";a:1:{s:1:"l";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10725;}}}}}}}}s:1:"r";a:2:{s:1:"D";a:1:{s:1:"o";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8787;}}}}s:1:"a";a:1:{s:1:"r";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10609;}}}}}s:1:"s";a:3:{s:1:"c";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8495;}}}s:1:"d";a:1:{s:1:"o";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8784;}}}}s:1:"i";a:1:{s:1:"m";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8770;}}}}s:1:"t";a:2:{s:1:"a";a:1:{s:1:";";a:1:{s:9:"codepoint";i:951;}}s:1:"h";a:2:{s:1:";";a:1:{s:9:"codepoint";i:240;}s:9:"codepoint";i:240;}}s:1:"u";a:2:{s:1:"m";a:1:{s:1:"l";a:2:{s:1:";";a:1:{s:9:"codepoint";i:235;}s:9:"codepoint";i:235;}}s:1:"r";a:1:{s:1:"o";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8364;}}}}s:1:"x";a:3:{s:1:"c";a:1:{s:1:"l";a:1:{s:1:";";a:1:{s:9:"codepoint";i:33;}}}s:1:"i";a:1:{s:1:"s";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8707;}}}}s:1:"p";a:2:{s:1:"e";a:1:{s:1:"c";a:1:{s:1:"t";a:1:{s:1:"a";a:1:{s:1:"t";a:1:{s:1:"i";a:1:{s:1:"o";a:1:{s:1:"n";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8496;}}}}}}}}}s:1:"o";a:1:{s:1:"n";a:1:{s:1:"e";a:1:{s:1:"n";a:1:{s:1:"t";a:1:{s:1:"i";a:1:{s:1:"a";a:1:{s:1:"l";a:1:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8519;}}}}}}}}}}}}}s:1:"f";a:11:{s:1:"a";a:1:{s:1:"l";a:1:{s:1:"l";a:1:{s:1:"i";a:1:{s:1:"n";a:1:{s:1:"g";a:1:{s:1:"d";a:1:{s:1:"o";a:1:{s:1:"t";a:1:{s:1:"s";a:1:{s:1:"e";a:1:{s:1:"q";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8786;}}}}}}}}}}}}}s:1:"c";a:1:{s:1:"y";a:1:{s:1:";";a:1:{s:9:"codepoint";i:1092;}}}s:1:"e";a:1:{s:1:"m";a:1:{s:1:"a";a:1:{s:1:"l";a:1:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:9792;}}}}}}s:1:"f";a:3:{s:1:"i";a:1:{s:1:"l";a:1:{s:1:"i";a:1:{s:1:"g";a:1:{s:1:";";a:1:{s:9:"codepoint";i:64259;}}}}}s:1:"l";a:2:{s:1:"i";a:1:{s:1:"g";a:1:{s:1:";";a:1:{s:9:"codepoint";i:64256;}}}s:1:"l";a:1:{s:1:"i";a:1:{s:1:"g";a:1:{s:1:";";a:1:{s:9:"codepoint";i:64260;}}}}}s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:120099;}}}s:1:"i";a:1:{s:1:"l";a:1:{s:1:"i";a:1:{s:1:"g";a:1:{s:1:";";a:1:{s:9:"codepoint";i:64257;}}}}}s:1:"l";a:3:{s:1:"a";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:9837;}}}s:1:"l";a:1:{s:1:"i";a:1:{s:1:"g";a:1:{s:1:";";a:1:{s:9:"codepoint";i:64258;}}}}s:1:"t";a:1:{s:1:"n";a:1:{s:1:"s";a:1:{s:1:";";a:1:{s:9:"codepoint";i:9649;}}}}}s:1:"n";a:1:{s:1:"o";a:1:{s:1:"f";a:1:{s:1:";";a:1:{s:9:"codepoint";i:402;}}}}s:1:"o";a:2:{s:1:"p";a:1:{s:1:"f";a:1:{s:1:";";a:1:{s:9:"codepoint";i:120151;}}}s:1:"r";a:2:{s:1:"a";a:1:{s:1:"l";a:1:{s:1:"l";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8704;}}}}s:1:"k";a:2:{s:1:";";a:1:{s:9:"codepoint";i:8916;}s:1:"v";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10969;}}}}}s:1:"p";a:1:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:"t";a:1:{s:1:"i";a:1:{s:1:"n";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10765;}}}}}}}}s:1:"r";a:2:{s:1:"a";a:2:{s:1:"c";a:6:{i:1;a:6:{i:2;a:2:{s:1:";";a:1:{s:9:"codepoint";i:189;}s:9:"codepoint";i:189;}i:3;a:1:{s:1:";";a:1:{s:9:"codepoint";i:8531;}}i:4;a:2:{s:1:";";a:1:{s:9:"codepoint";i:188;}s:9:"codepoint";i:188;}i:5;a:1:{s:1:";";a:1:{s:9:"codepoint";i:8533;}}i:6;a:1:{s:1:";";a:1:{s:9:"codepoint";i:8537;}}i:8;a:1:{s:1:";";a:1:{s:9:"codepoint";i:8539;}}}i:2;a:2:{i:3;a:1:{s:1:";";a:1:{s:9:"codepoint";i:8532;}}i:5;a:1:{s:1:";";a:1:{s:9:"codepoint";i:8534;}}}i:3;a:3:{i:4;a:2:{s:1:";";a:1:{s:9:"codepoint";i:190;}s:9:"codepoint";i:190;}i:5;a:1:{s:1:";";a:1:{s:9:"codepoint";i:8535;}}i:8;a:1:{s:1:";";a:1:{s:9:"codepoint";i:8540;}}}i:4;a:1:{i:5;a:1:{s:1:";";a:1:{s:9:"codepoint";i:8536;}}}i:5;a:2:{i:6;a:1:{s:1:";";a:1:{s:9:"codepoint";i:8538;}}i:8;a:1:{s:1:";";a:1:{s:9:"codepoint";i:8541;}}}i:7;a:1:{i:8;a:1:{s:1:";";a:1:{s:9:"codepoint";i:8542;}}}}s:1:"s";a:1:{s:1:"l";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8260;}}}}s:1:"o";a:1:{s:1:"w";a:1:{s:1:"n";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8994;}}}}}s:1:"s";a:1:{s:1:"c";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:119995;}}}}}s:1:"g";a:16:{s:1:"E";a:2:{s:1:";";a:1:{s:9:"codepoint";i:8807;}s:1:"l";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10892;}}}s:1:"a";a:3:{s:1:"c";a:1:{s:1:"u";a:1:{s:1:"t";a:1:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:501;}}}}}s:1:"m";a:1:{s:1:"m";a:1:{s:1:"a";a:2:{s:1:";";a:1:{s:9:"codepoint";i:947;}s:1:"d";a:1:{s:1:";";a:1:{s:9:"codepoint";i:989;}}}}}s:1:"p";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10886;}}}s:1:"b";a:1:{s:1:"r";a:1:{s:1:"e";a:1:{s:1:"v";a:1:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:287;}}}}}}s:1:"c";a:2:{s:1:"i";a:1:{s:1:"r";a:1:{s:1:"c";a:1:{s:1:";";a:1:{s:9:"codepoint";i:285;}}}}s:1:"y";a:1:{s:1:";";a:1:{s:9:"codepoint";i:1075;}}}s:1:"d";a:1:{s:1:"o";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:289;}}}}s:1:"e";a:4:{s:1:";";a:1:{s:9:"codepoint";i:8805;}s:1:"l";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8923;}}s:1:"q";a:3:{s:1:";";a:1:{s:9:"codepoint";i:8805;}s:1:"q";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8807;}}s:1:"s";a:1:{s:1:"l";a:1:{s:1:"a";a:1:{s:1:"n";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10878;}}}}}}}s:1:"s";a:4:{s:1:";";a:1:{s:9:"codepoint";i:10878;}s:1:"c";a:1:{s:1:"c";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10921;}}}s:1:"d";a:1:{s:1:"o";a:1:{s:1:"t";a:2:{s:1:";";a:1:{s:9:"codepoint";i:10880;}s:1:"o";a:2:{s:1:";";a:1:{s:9:"codepoint";i:10882;}s:1:"l";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10884;}}}}}}s:1:"l";a:1:{s:1:"e";a:1:{s:1:"s";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10900;}}}}}}s:1:"f";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:120100;}}}s:1:"g";a:2:{s:1:";";a:1:{s:9:"codepoint";i:8811;}s:1:"g";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8921;}}}s:1:"i";a:1:{s:1:"m";a:1:{s:1:"e";a:1:{s:1:"l";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8503;}}}}}s:1:"j";a:1:{s:1:"c";a:1:{s:1:"y";a:1:{s:1:";";a:1:{s:9:"codepoint";i:1107;}}}}s:1:"l";a:4:{s:1:";";a:1:{s:9:"codepoint";i:8823;}s:1:"E";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10898;}}s:1:"a";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10917;}}s:1:"j";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10916;}}}s:1:"n";a:4:{s:1:"E";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8809;}}s:1:"a";a:1:{s:1:"p";a:2:{s:1:";";a:1:{s:9:"codepoint";i:10890;}s:1:"p";a:1:{s:1:"r";a:1:{s:1:"o";a:1:{s:1:"x";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10890;}}}}}}}s:1:"e";a:2:{s:1:";";a:1:{s:9:"codepoint";i:10888;}s:1:"q";a:2:{s:1:";";a:1:{s:9:"codepoint";i:10888;}s:1:"q";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8809;}}}}s:1:"s";a:1:{s:1:"i";a:1:{s:1:"m";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8935;}}}}}s:1:"o";a:1:{s:1:"p";a:1:{s:1:"f";a:1:{s:1:";";a:1:{s:9:"codepoint";i:120152;}}}}s:1:"r";a:1:{s:1:"a";a:1:{s:1:"v";a:1:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:96;}}}}}s:1:"s";a:2:{s:1:"c";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8458;}}}s:1:"i";a:1:{s:1:"m";a:3:{s:1:";";a:1:{s:9:"codepoint";i:8819;}s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10894;}}s:1:"l";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10896;}}}}}s:1:"t";a:7:{s:1:";";a:1:{s:9:"codepoint";i:62;}s:9:"codepoint";i:62;s:1:"c";a:2:{s:1:"c";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10919;}}s:1:"i";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10874;}}}}s:1:"d";a:1:{s:1:"o";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8919;}}}}s:1:"l";a:1:{s:1:"P";a:1:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10645;}}}}}s:1:"q";a:1:{s:1:"u";a:1:{s:1:"e";a:1:{s:1:"s";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10876;}}}}}}s:1:"r";a:5:{s:1:"a";a:2:{s:1:"p";a:1:{s:1:"p";a:1:{s:1:"r";a:1:{s:1:"o";a:1:{s:1:"x";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10886;}}}}}}s:1:"r";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10616;}}}}s:1:"d";a:1:{s:1:"o";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8919;}}}}s:1:"e";a:1:{s:1:"q";a:2:{s:1:"l";a:1:{s:1:"e";a:1:{s:1:"s";a:1:{s:1:"s";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8923;}}}}}s:1:"q";a:1:{s:1:"l";a:1:{s:1:"e";a:1:{s:1:"s";a:1:{s:1:"s";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10892;}}}}}}}}s:1:"l";a:1:{s:1:"e";a:1:{s:1:"s";a:1:{s:1:"s";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8823;}}}}}s:1:"s";a:1:{s:1:"i";a:1:{s:1:"m";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8819;}}}}}}}s:1:"h";a:10:{s:1:"A";a:1:{s:1:"r";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8660;}}}}s:1:"a";a:4:{s:1:"i";a:1:{s:1:"r";a:1:{s:1:"s";a:1:{s:1:"p";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8202;}}}}}s:1:"l";a:1:{s:1:"f";a:1:{s:1:";";a:1:{s:9:"codepoint";i:189;}}}s:1:"m";a:1:{s:1:"i";a:1:{s:1:"l";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8459;}}}}}s:1:"r";a:2:{s:1:"d";a:1:{s:1:"c";a:1:{s:1:"y";a:1:{s:1:";";a:1:{s:9:"codepoint";i:1098;}}}}s:1:"r";a:3:{s:1:";";a:1:{s:9:"codepoint";i:8596;}s:1:"c";a:1:{s:1:"i";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10568;}}}}s:1:"w";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8621;}}}}}s:1:"b";a:1:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8463;}}}}s:1:"c";a:1:{s:1:"i";a:1:{s:1:"r";a:1:{s:1:"c";a:1:{s:1:";";a:1:{s:9:"codepoint";i:293;}}}}}s:1:"e";a:3:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:"t";a:1:{s:1:"s";a:2:{s:1:";";a:1:{s:9:"codepoint";i:9829;}s:1:"u";a:1:{s:1:"i";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:9829;}}}}}}}}s:1:"l";a:1:{s:1:"l";a:1:{s:1:"i";a:1:{s:1:"p";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8230;}}}}}s:1:"r";a:1:{s:1:"c";a:1:{s:1:"o";a:1:{s:1:"n";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8889;}}}}}}s:1:"f";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:120101;}}}s:1:"k";a:1:{s:1:"s";a:2:{s:1:"e";a:1:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:"o";a:1:{s:1:"w";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10533;}}}}}}s:1:"w";a:1:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:"o";a:1:{s:1:"w";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10534;}}}}}}}}s:1:"o";a:5:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8703;}}}}s:1:"m";a:1:{s:1:"t";a:1:{s:1:"h";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8763;}}}}}s:1:"o";a:1:{s:1:"k";a:2:{s:1:"l";a:1:{s:1:"e";a:1:{s:1:"f";a:1:{s:1:"t";a:1:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:"r";a:1:{s:1:"o";a:1:{s:1:"w";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8617;}}}}}}}}}}s:1:"r";a:1:{s:1:"i";a:1:{s:1:"g";a:1:{s:1:"h";a:1:{s:1:"t";a:1:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:"r";a:1:{s:1:"o";a:1:{s:1:"w";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8618;}}}}}}}}}}}}}s:1:"p";a:1:{s:1:"f";a:1:{s:1:";";a:1:{s:9:"codepoint";i:120153;}}}s:1:"r";a:1:{s:1:"b";a:1:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8213;}}}}}}s:1:"s";a:3:{s:1:"c";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:119997;}}}s:1:"l";a:1:{s:1:"a";a:1:{s:1:"s";a:1:{s:1:"h";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8463;}}}}}s:1:"t";a:1:{s:1:"r";a:1:{s:1:"o";a:1:{s:1:"k";a:1:{s:1:";";a:1:{s:9:"codepoint";i:295;}}}}}}s:1:"y";a:2:{s:1:"b";a:1:{s:1:"u";a:1:{s:1:"l";a:1:{s:1:"l";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8259;}}}}}s:1:"p";a:1:{s:1:"h";a:1:{s:1:"e";a:1:{s:1:"n";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8208;}}}}}}}s:1:"i";a:15:{s:1:"a";a:1:{s:1:"c";a:1:{s:1:"u";a:1:{s:1:"t";a:1:{s:1:"e";a:2:{s:1:";";a:1:{s:9:"codepoint";i:237;}s:9:"codepoint";i:237;}}}}}s:1:"c";a:3:{s:1:";";a:1:{s:9:"codepoint";i:8291;}s:1:"i";a:1:{s:1:"r";a:1:{s:1:"c";a:2:{s:1:";";a:1:{s:9:"codepoint";i:238;}s:9:"codepoint";i:238;}}}s:1:"y";a:1:{s:1:";";a:1:{s:9:"codepoint";i:1080;}}}s:1:"e";a:2:{s:1:"c";a:1:{s:1:"y";a:1:{s:1:";";a:1:{s:9:"codepoint";i:1077;}}}s:1:"x";a:1:{s:1:"c";a:1:{s:1:"l";a:2:{s:1:";";a:1:{s:9:"codepoint";i:161;}s:9:"codepoint";i:161;}}}}s:1:"f";a:2:{s:1:"f";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8660;}}s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:120102;}}}s:1:"g";a:1:{s:1:"r";a:1:{s:1:"a";a:1:{s:1:"v";a:1:{s:1:"e";a:2:{s:1:";";a:1:{s:9:"codepoint";i:236;}s:9:"codepoint";i:236;}}}}}s:1:"i";a:4:{s:1:";";a:1:{s:9:"codepoint";i:8520;}s:1:"i";a:2:{s:1:"i";a:1:{s:1:"n";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10764;}}}}s:1:"n";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8749;}}}}s:1:"n";a:1:{s:1:"f";a:1:{s:1:"i";a:1:{s:1:"n";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10716;}}}}}s:1:"o";a:1:{s:1:"t";a:1:{s:1:"a";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8489;}}}}}s:1:"j";a:1:{s:1:"l";a:1:{s:1:"i";a:1:{s:1:"g";a:1:{s:1:";";a:1:{s:9:"codepoint";i:307;}}}}}s:1:"m";a:3:{s:1:"a";a:3:{s:1:"c";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:299;}}}s:1:"g";a:3:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8465;}}s:1:"l";a:1:{s:1:"i";a:1:{s:1:"n";a:1:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8464;}}}}}s:1:"p";a:1:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8465;}}}}}}s:1:"t";a:1:{s:1:"h";a:1:{s:1:";";a:1:{s:9:"codepoint";i:305;}}}}s:1:"o";a:1:{s:1:"f";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8887;}}}s:1:"p";a:1:{s:1:"e";a:1:{s:1:"d";a:1:{s:1:";";a:1:{s:9:"codepoint";i:437;}}}}}s:1:"n";a:5:{s:1:";";a:1:{s:9:"codepoint";i:8712;}s:1:"c";a:1:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8453;}}}}}s:1:"f";a:1:{s:1:"i";a:1:{s:1:"n";a:2:{s:1:";";a:1:{s:9:"codepoint";i:8734;}s:1:"t";a:1:{s:1:"i";a:1:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10717;}}}}}}}s:1:"o";a:1:{s:1:"d";a:1:{s:1:"o";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:305;}}}}}s:1:"t";a:5:{s:1:";";a:1:{s:9:"codepoint";i:8747;}s:1:"c";a:1:{s:1:"a";a:1:{s:1:"l";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8890;}}}}s:1:"e";a:2:{s:1:"g";a:1:{s:1:"e";a:1:{s:1:"r";a:1:{s:1:"s";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8484;}}}}}s:1:"r";a:1:{s:1:"c";a:1:{s:1:"a";a:1:{s:1:"l";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8890;}}}}}}s:1:"l";a:1:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:"h";a:1:{s:1:"k";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10775;}}}}}}s:1:"p";a:1:{s:1:"r";a:1:{s:1:"o";a:1:{s:1:"d";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10812;}}}}}}}s:1:"o";a:4:{s:1:"c";a:1:{s:1:"y";a:1:{s:1:";";a:1:{s:9:"codepoint";i:1105;}}}s:1:"g";a:1:{s:1:"o";a:1:{s:1:"n";a:1:{s:1:";";a:1:{s:9:"codepoint";i:303;}}}}s:1:"p";a:1:{s:1:"f";a:1:{s:1:";";a:1:{s:9:"codepoint";i:120154;}}}s:1:"t";a:1:{s:1:"a";a:1:{s:1:";";a:1:{s:9:"codepoint";i:953;}}}}s:1:"p";a:1:{s:1:"r";a:1:{s:1:"o";a:1:{s:1:"d";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10812;}}}}}s:1:"q";a:1:{s:1:"u";a:1:{s:1:"e";a:1:{s:1:"s";a:1:{s:1:"t";a:2:{s:1:";";a:1:{s:9:"codepoint";i:191;}s:9:"codepoint";i:191;}}}}}s:1:"s";a:2:{s:1:"c";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:119998;}}}s:1:"i";a:1:{s:1:"n";a:5:{s:1:";";a:1:{s:9:"codepoint";i:8712;}s:1:"E";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8953;}}s:1:"d";a:1:{s:1:"o";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8949;}}}}s:1:"s";a:2:{s:1:";";a:1:{s:9:"codepoint";i:8948;}s:1:"v";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8947;}}}s:1:"v";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8712;}}}}}s:1:"t";a:2:{s:1:";";a:1:{s:9:"codepoint";i:8290;}s:1:"i";a:1:{s:1:"l";a:1:{s:1:"d";a:1:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:297;}}}}}}s:1:"u";a:2:{s:1:"k";a:1:{s:1:"c";a:1:{s:1:"y";a:1:{s:1:";";a:1:{s:9:"codepoint";i:1110;}}}}s:1:"m";a:1:{s:1:"l";a:2:{s:1:";";a:1:{s:9:"codepoint";i:239;}s:9:"codepoint";i:239;}}}}s:1:"j";a:6:{s:1:"c";a:2:{s:1:"i";a:1:{s:1:"r";a:1:{s:1:"c";a:1:{s:1:";";a:1:{s:9:"codepoint";i:309;}}}}s:1:"y";a:1:{s:1:";";a:1:{s:9:"codepoint";i:1081;}}}s:1:"f";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:120103;}}}s:1:"m";a:1:{s:1:"a";a:1:{s:1:"t";a:1:{s:1:"h";a:1:{s:1:";";a:1:{s:9:"codepoint";i:567;}}}}}s:1:"o";a:1:{s:1:"p";a:1:{s:1:"f";a:1:{s:1:";";a:1:{s:9:"codepoint";i:120155;}}}}s:1:"s";a:2:{s:1:"c";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:119999;}}}s:1:"e";a:1:{s:1:"r";a:1:{s:1:"c";a:1:{s:1:"y";a:1:{s:1:";";a:1:{s:9:"codepoint";i:1112;}}}}}}s:1:"u";a:1:{s:1:"k";a:1:{s:1:"c";a:1:{s:1:"y";a:1:{s:1:";";a:1:{s:9:"codepoint";i:1108;}}}}}}s:1:"k";a:8:{s:1:"a";a:1:{s:1:"p";a:1:{s:1:"p";a:1:{s:1:"a";a:2:{s:1:";";a:1:{s:9:"codepoint";i:954;}s:1:"v";a:1:{s:1:";";a:1:{s:9:"codepoint";i:1008;}}}}}}s:1:"c";a:2:{s:1:"e";a:1:{s:1:"d";a:1:{s:1:"i";a:1:{s:1:"l";a:1:{s:1:";";a:1:{s:9:"codepoint";i:311;}}}}}s:1:"y";a:1:{s:1:";";a:1:{s:9:"codepoint";i:1082;}}}s:1:"f";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:120104;}}}s:1:"g";a:1:{s:1:"r";a:1:{s:1:"e";a:1:{s:1:"e";a:1:{s:1:"n";a:1:{s:1:";";a:1:{s:9:"codepoint";i:312;}}}}}}s:1:"h";a:1:{s:1:"c";a:1:{s:1:"y";a:1:{s:1:";";a:1:{s:9:"codepoint";i:1093;}}}}s:1:"j";a:1:{s:1:"c";a:1:{s:1:"y";a:1:{s:1:";";a:1:{s:9:"codepoint";i:1116;}}}}s:1:"o";a:1:{s:1:"p";a:1:{s:1:"f";a:1:{s:1:";";a:1:{s:9:"codepoint";i:120156;}}}}s:1:"s";a:1:{s:1:"c";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:120000;}}}}}s:1:"l";a:22:{s:1:"A";a:3:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8666;}}}}s:1:"r";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8656;}}}s:1:"t";a:1:{s:1:"a";a:1:{s:1:"i";a:1:{s:1:"l";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10523;}}}}}}s:1:"B";a:1:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10510;}}}}}s:1:"E";a:2:{s:1:";";a:1:{s:9:"codepoint";i:8806;}s:1:"g";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10891;}}}s:1:"H";a:1:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10594;}}}}s:1:"a";a:9:{s:1:"c";a:1:{s:1:"u";a:1:{s:1:"t";a:1:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:314;}}}}}s:1:"e";a:1:{s:1:"m";a:1:{s:1:"p";a:1:{s:1:"t";a:1:{s:1:"y";a:1:{s:1:"v";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10676;}}}}}}}s:1:"g";a:1:{s:1:"r";a:1:{s:1:"a";a:1:{s:1:"n";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8466;}}}}}s:1:"m";a:1:{s:1:"b";a:1:{s:1:"d";a:1:{s:1:"a";a:1:{s:1:";";a:1:{s:9:"codepoint";i:955;}}}}}s:1:"n";a:1:{s:1:"g";a:3:{s:1:";";a:1:{s:9:"codepoint";i:10216;}s:1:"d";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10641;}}s:1:"l";a:1:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10216;}}}}}s:1:"p";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10885;}}s:1:"q";a:1:{s:1:"u";a:1:{s:1:"o";a:2:{s:1:";";a:1:{s:9:"codepoint";i:171;}s:9:"codepoint";i:171;}}}s:1:"r";a:1:{s:1:"r";a:8:{s:1:";";a:1:{s:9:"codepoint";i:8592;}s:1:"b";a:2:{s:1:";";a:1:{s:9:"codepoint";i:8676;}s:1:"f";a:1:{s:1:"s";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10527;}}}}s:1:"f";a:1:{s:1:"s";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10525;}}}s:1:"h";a:1:{s:1:"k";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8617;}}}s:1:"l";a:1:{s:1:"p";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8619;}}}s:1:"p";a:1:{s:1:"l";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10553;}}}s:1:"s";a:1:{s:1:"i";a:1:{s:1:"m";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10611;}}}}s:1:"t";a:1:{s:1:"l";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8610;}}}}}s:1:"t";a:3:{s:1:";";a:1:{s:9:"codepoint";i:10923;}s:1:"a";a:1:{s:1:"i";a:1:{s:1:"l";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10521;}}}}s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10925;}}}}s:1:"b";a:3:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10508;}}}}s:1:"b";a:1:{s:1:"r";a:1:{s:1:"k";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10098;}}}}s:1:"r";a:2:{s:1:"a";a:1:{s:1:"c";a:2:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:123;}}s:1:"k";a:1:{s:1:";";a:1:{s:9:"codepoint";i:91;}}}}s:1:"k";a:2:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10635;}}s:1:"s";a:1:{s:1:"l";a:2:{s:1:"d";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10639;}}s:1:"u";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10637;}}}}}}}s:1:"c";a:4:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:"o";a:1:{s:1:"n";a:1:{s:1:";";a:1:{s:9:"codepoint";i:318;}}}}}s:1:"e";a:2:{s:1:"d";a:1:{s:1:"i";a:1:{s:1:"l";a:1:{s:1:";";a:1:{s:9:"codepoint";i:316;}}}}s:1:"i";a:1:{s:1:"l";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8968;}}}}s:1:"u";a:1:{s:1:"b";a:1:{s:1:";";a:1:{s:9:"codepoint";i:123;}}}s:1:"y";a:1:{s:1:";";a:1:{s:9:"codepoint";i:1083;}}}s:1:"d";a:4:{s:1:"c";a:1:{s:1:"a";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10550;}}}s:1:"q";a:1:{s:1:"u";a:1:{s:1:"o";a:2:{s:1:";";a:1:{s:9:"codepoint";i:8220;}s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8222;}}}}}s:1:"r";a:2:{s:1:"d";a:1:{s:1:"h";a:1:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10599;}}}}}s:1:"u";a:1:{s:1:"s";a:1:{s:1:"h";a:1:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10571;}}}}}}}s:1:"s";a:1:{s:1:"h";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8626;}}}}s:1:"e";a:5:{s:1:";";a:1:{s:9:"codepoint";i:8804;}s:1:"f";a:1:{s:1:"t";a:5:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:"r";a:1:{s:1:"o";a:1:{s:1:"w";a:2:{s:1:";";a:1:{s:9:"codepoint";i:8592;}s:1:"t";a:1:{s:1:"a";a:1:{s:1:"i";a:1:{s:1:"l";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8610;}}}}}}}}}}s:1:"h";a:1:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:"p";a:1:{s:1:"o";a:1:{s:1:"o";a:1:{s:1:"n";a:2:{s:1:"d";a:1:{s:1:"o";a:1:{s:1:"w";a:1:{s:1:"n";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8637;}}}}}s:1:"u";a:1:{s:1:"p";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8636;}}}}}}}}}}s:1:"l";a:1:{s:1:"e";a:1:{s:1:"f";a:1:{s:1:"t";a:1:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:"r";a:1:{s:1:"o";a:1:{s:1:"w";a:1:{s:1:"s";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8647;}}}}}}}}}}}s:1:"r";a:1:{s:1:"i";a:1:{s:1:"g";a:1:{s:1:"h";a:1:{s:1:"t";a:3:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:"r";a:1:{s:1:"o";a:1:{s:1:"w";a:2:{s:1:";";a:1:{s:9:"codepoint";i:8596;}s:1:"s";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8646;}}}}}}}s:1:"h";a:1:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:"p";a:1:{s:1:"o";a:1:{s:1:"o";a:1:{s:1:"n";a:1:{s:1:"s";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8651;}}}}}}}}}s:1:"s";a:1:{s:1:"q";a:1:{s:1:"u";a:1:{s:1:"i";a:1:{s:1:"g";a:1:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:"r";a:1:{s:1:"o";a:1:{s:1:"w";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8621;}}}}}}}}}}}}}}}}s:1:"t";a:1:{s:1:"h";a:1:{s:1:"r";a:1:{s:1:"e";a:1:{s:1:"e";a:1:{s:1:"t";a:1:{s:1:"i";a:1:{s:1:"m";a:1:{s:1:"e";a:1:{s:1:"s";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8907;}}}}}}}}}}}}}s:1:"g";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8922;}}s:1:"q";a:3:{s:1:";";a:1:{s:9:"codepoint";i:8804;}s:1:"q";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8806;}}s:1:"s";a:1:{s:1:"l";a:1:{s:1:"a";a:1:{s:1:"n";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10877;}}}}}}}s:1:"s";a:5:{s:1:";";a:1:{s:9:"codepoint";i:10877;}s:1:"c";a:1:{s:1:"c";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10920;}}}s:1:"d";a:1:{s:1:"o";a:1:{s:1:"t";a:2:{s:1:";";a:1:{s:9:"codepoint";i:10879;}s:1:"o";a:2:{s:1:";";a:1:{s:9:"codepoint";i:10881;}s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10883;}}}}}}s:1:"g";a:1:{s:1:"e";a:1:{s:1:"s";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10899;}}}}s:1:"s";a:5:{s:1:"a";a:1:{s:1:"p";a:1:{s:1:"p";a:1:{s:1:"r";a:1:{s:1:"o";a:1:{s:1:"x";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10885;}}}}}}}s:1:"d";a:1:{s:1:"o";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8918;}}}}s:1:"e";a:1:{s:1:"q";a:2:{s:1:"g";a:1:{s:1:"t";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8922;}}}}s:1:"q";a:1:{s:1:"g";a:1:{s:1:"t";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10891;}}}}}}}s:1:"g";a:1:{s:1:"t";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8822;}}}}s:1:"s";a:1:{s:1:"i";a:1:{s:1:"m";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8818;}}}}}}}s:1:"f";a:3:{s:1:"i";a:1:{s:1:"s";a:1:{s:1:"h";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10620;}}}}}s:1:"l";a:1:{s:1:"o";a:1:{s:1:"o";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8970;}}}}}s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:120105;}}}s:1:"g";a:2:{s:1:";";a:1:{s:9:"codepoint";i:8822;}s:1:"E";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10897;}}}s:1:"h";a:2:{s:1:"a";a:1:{s:1:"r";a:2:{s:1:"d";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8637;}}s:1:"u";a:2:{s:1:";";a:1:{s:9:"codepoint";i:8636;}s:1:"l";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10602;}}}}}s:1:"b";a:1:{s:1:"l";a:1:{s:1:"k";a:1:{s:1:";";a:1:{s:9:"codepoint";i:9604;}}}}}s:1:"j";a:1:{s:1:"c";a:1:{s:1:"y";a:1:{s:1:";";a:1:{s:9:"codepoint";i:1113;}}}}s:1:"l";a:5:{s:1:";";a:1:{s:9:"codepoint";i:8810;}s:1:"a";a:1:{s:1:"r";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8647;}}}}s:1:"c";a:1:{s:1:"o";a:1:{s:1:"r";a:1:{s:1:"n";a:1:{s:1:"e";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8990;}}}}}}}s:1:"h";a:1:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:"d";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10603;}}}}}s:1:"t";a:1:{s:1:"r";a:1:{s:1:"i";a:1:{s:1:";";a:1:{s:9:"codepoint";i:9722;}}}}}s:1:"m";a:2:{s:1:"i";a:1:{s:1:"d";a:1:{s:1:"o";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:320;}}}}}s:1:"o";a:1:{s:1:"u";a:1:{s:1:"s";a:1:{s:1:"t";a:2:{s:1:";";a:1:{s:9:"codepoint";i:9136;}s:1:"a";a:1:{s:1:"c";a:1:{s:1:"h";a:1:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:9136;}}}}}}}}}}s:1:"n";a:4:{s:1:"E";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8808;}}s:1:"a";a:1:{s:1:"p";a:2:{s:1:";";a:1:{s:9:"codepoint";i:10889;}s:1:"p";a:1:{s:1:"r";a:1:{s:1:"o";a:1:{s:1:"x";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10889;}}}}}}}s:1:"e";a:2:{s:1:";";a:1:{s:9:"codepoint";i:10887;}s:1:"q";a:2:{s:1:";";a:1:{s:9:"codepoint";i:10887;}s:1:"q";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8808;}}}}s:1:"s";a:1:{s:1:"i";a:1:{s:1:"m";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8934;}}}}}s:1:"o";a:8:{s:1:"a";a:2:{s:1:"n";a:1:{s:1:"g";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10220;}}}s:1:"r";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8701;}}}}s:1:"b";a:1:{s:1:"r";a:1:{s:1:"k";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10214;}}}}s:1:"n";a:1:{s:1:"g";a:3:{s:1:"l";a:1:{s:1:"e";a:1:{s:1:"f";a:1:{s:1:"t";a:2:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:"r";a:1:{s:1:"o";a:1:{s:1:"w";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10229;}}}}}}s:1:"r";a:1:{s:1:"i";a:1:{s:1:"g";a:1:{s:1:"h";a:1:{s:1:"t";a:1:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:"r";a:1:{s:1:"o";a:1:{s:1:"w";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10231;}}}}}}}}}}}}}}}s:1:"m";a:1:{s:1:"a";a:1:{s:1:"p";a:1:{s:1:"s";a:1:{s:1:"t";a:1:{s:1:"o";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10236;}}}}}}}s:1:"r";a:1:{s:1:"i";a:1:{s:1:"g";a:1:{s:1:"h";a:1:{s:1:"t";a:1:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:"r";a:1:{s:1:"o";a:1:{s:1:"w";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10230;}}}}}}}}}}}}}s:1:"o";a:1:{s:1:"p";a:1:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:"r";a:1:{s:1:"o";a:1:{s:1:"w";a:2:{s:1:"l";a:1:{s:1:"e";a:1:{s:1:"f";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8619;}}}}}s:1:"r";a:1:{s:1:"i";a:1:{s:1:"g";a:1:{s:1:"h";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8620;}}}}}}}}}}}}}s:1:"p";a:3:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10629;}}}s:1:"f";a:1:{s:1:";";a:1:{s:9:"codepoint";i:120157;}}s:1:"l";a:1:{s:1:"u";a:1:{s:1:"s";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10797;}}}}}s:1:"t";a:1:{s:1:"i";a:1:{s:1:"m";a:1:{s:1:"e";a:1:{s:1:"s";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10804;}}}}}}s:1:"w";a:2:{s:1:"a";a:1:{s:1:"s";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8727;}}}}s:1:"b";a:1:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:95;}}}}}s:1:"z";a:3:{s:1:";";a:1:{s:9:"codepoint";i:9674;}s:1:"e";a:1:{s:1:"n";a:1:{s:1:"g";a:1:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:9674;}}}}}s:1:"f";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10731;}}}}s:1:"p";a:1:{s:1:"a";a:1:{s:1:"r";a:2:{s:1:";";a:1:{s:9:"codepoint";i:40;}s:1:"l";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10643;}}}}}}s:1:"r";a:5:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8646;}}}}s:1:"c";a:1:{s:1:"o";a:1:{s:1:"r";a:1:{s:1:"n";a:1:{s:1:"e";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8991;}}}}}}}s:1:"h";a:1:{s:1:"a";a:1:{s:1:"r";a:2:{s:1:";";a:1:{s:9:"codepoint";i:8651;}s:1:"d";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10605;}}}}}s:1:"m";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8206;}}s:1:"t";a:1:{s:1:"r";a:1:{s:1:"i";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8895;}}}}}s:1:"s";a:6:{s:1:"a";a:1:{s:1:"q";a:1:{s:1:"u";a:1:{s:1:"o";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8249;}}}}}s:1:"c";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:120001;}}}s:1:"h";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8624;}}s:1:"i";a:1:{s:1:"m";a:3:{s:1:";";a:1:{s:9:"codepoint";i:8818;}s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10893;}}s:1:"g";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10895;}}}}s:1:"q";a:2:{s:1:"b";a:1:{s:1:";";a:1:{s:9:"codepoint";i:91;}}s:1:"u";a:1:{s:1:"o";a:2:{s:1:";";a:1:{s:9:"codepoint";i:8216;}s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8218;}}}}}s:1:"t";a:1:{s:1:"r";a:1:{s:1:"o";a:1:{s:1:"k";a:1:{s:1:";";a:1:{s:9:"codepoint";i:322;}}}}}}s:1:"t";a:9:{s:1:";";a:1:{s:9:"codepoint";i:60;}s:9:"codepoint";i:60;s:1:"c";a:2:{s:1:"c";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10918;}}s:1:"i";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10873;}}}}s:1:"d";a:1:{s:1:"o";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8918;}}}}s:1:"h";a:1:{s:1:"r";a:1:{s:1:"e";a:1:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8907;}}}}}s:1:"i";a:1:{s:1:"m";a:1:{s:1:"e";a:1:{s:1:"s";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8905;}}}}}s:1:"l";a:1:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10614;}}}}}s:1:"q";a:1:{s:1:"u";a:1:{s:1:"e";a:1:{s:1:"s";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10875;}}}}}}s:1:"r";a:2:{s:1:"P";a:1:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10646;}}}}s:1:"i";a:3:{s:1:";";a:1:{s:9:"codepoint";i:9667;}s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8884;}}s:1:"f";a:1:{s:1:";";a:1:{s:9:"codepoint";i:9666;}}}}}s:1:"u";a:1:{s:1:"r";a:2:{s:1:"d";a:1:{s:1:"s";a:1:{s:1:"h";a:1:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10570;}}}}}}s:1:"u";a:1:{s:1:"h";a:1:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10598;}}}}}}}}s:1:"m";a:14:{s:1:"D";a:1:{s:1:"D";a:1:{s:1:"o";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8762;}}}}}s:1:"a";a:4:{s:1:"c";a:1:{s:1:"r";a:2:{s:1:";";a:1:{s:9:"codepoint";i:175;}s:9:"codepoint";i:175;}}s:1:"l";a:2:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:9794;}}s:1:"t";a:2:{s:1:";";a:1:{s:9:"codepoint";i:10016;}s:1:"e";a:1:{s:1:"s";a:1:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10016;}}}}}}s:1:"p";a:2:{s:1:";";a:1:{s:9:"codepoint";i:8614;}s:1:"s";a:1:{s:1:"t";a:1:{s:1:"o";a:4:{s:1:";";a:1:{s:9:"codepoint";i:8614;}s:1:"d";a:1:{s:1:"o";a:1:{s:1:"w";a:1:{s:1:"n";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8615;}}}}}s:1:"l";a:1:{s:1:"e";a:1:{s:1:"f";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8612;}}}}}s:1:"u";a:1:{s:1:"p";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8613;}}}}}}}s:1:"r";a:1:{s:1:"k";a:1:{s:1:"e";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:9646;}}}}}}s:1:"c";a:2:{s:1:"o";a:1:{s:1:"m";a:1:{s:1:"m";a:1:{s:1:"a";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10793;}}}}}s:1:"y";a:1:{s:1:";";a:1:{s:9:"codepoint";i:1084;}}}s:1:"d";a:1:{s:1:"a";a:1:{s:1:"s";a:1:{s:1:"h";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8212;}}}}}s:1:"e";a:1:{s:1:"a";a:1:{s:1:"s";a:1:{s:1:"u";a:1:{s:1:"r";a:1:{s:1:"e";a:1:{s:1:"d";a:1:{s:1:"a";a:1:{s:1:"n";a:1:{s:1:"g";a:1:{s:1:"l";a:1:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8737;}}}}}}}}}}}}}s:1:"f";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:120106;}}}s:1:"h";a:1:{s:1:"o";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8487;}}}s:1:"i";a:3:{s:1:"c";a:1:{s:1:"r";a:1:{s:1:"o";a:2:{s:1:";";a:1:{s:9:"codepoint";i:181;}s:9:"codepoint";i:181;}}}s:1:"d";a:4:{s:1:";";a:1:{s:9:"codepoint";i:8739;}s:1:"a";a:1:{s:1:"s";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:42;}}}}s:1:"c";a:1:{s:1:"i";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10992;}}}}s:1:"d";a:1:{s:1:"o";a:1:{s:1:"t";a:2:{s:1:";";a:1:{s:9:"codepoint";i:183;}s:9:"codepoint";i:183;}}}}s:1:"n";a:1:{s:1:"u";a:1:{s:1:"s";a:3:{s:1:";";a:1:{s:9:"codepoint";i:8722;}s:1:"b";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8863;}}s:1:"d";a:2:{s:1:";";a:1:{s:9:"codepoint";i:8760;}s:1:"u";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10794;}}}}}}}s:1:"l";a:2:{s:1:"c";a:1:{s:1:"p";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10971;}}}s:1:"d";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8230;}}}}s:1:"n";a:1:{s:1:"p";a:1:{s:1:"l";a:1:{s:1:"u";a:1:{s:1:"s";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8723;}}}}}}s:1:"o";a:2:{s:1:"d";a:1:{s:1:"e";a:1:{s:1:"l";a:1:{s:1:"s";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8871;}}}}}s:1:"p";a:1:{s:1:"f";a:1:{s:1:";";a:1:{s:9:"codepoint";i:120158;}}}}s:1:"p";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8723;}}s:1:"s";a:2:{s:1:"c";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:120002;}}}s:1:"t";a:1:{s:1:"p";a:1:{s:1:"o";a:1:{s:1:"s";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8766;}}}}}}s:1:"u";a:3:{s:1:";";a:1:{s:9:"codepoint";i:956;}s:1:"l";a:1:{s:1:"t";a:1:{s:1:"i";a:1:{s:1:"m";a:1:{s:1:"a";a:1:{s:1:"p";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8888;}}}}}}}s:1:"m";a:1:{s:1:"a";a:1:{s:1:"p";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8888;}}}}}}s:1:"n";a:23:{s:1:"L";a:1:{s:1:"e";a:1:{s:1:"f";a:1:{s:1:"t";a:2:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:"r";a:1:{s:1:"o";a:1:{s:1:"w";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8653;}}}}}}s:1:"r";a:1:{s:1:"i";a:1:{s:1:"g";a:1:{s:1:"h";a:1:{s:1:"t";a:1:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:"r";a:1:{s:1:"o";a:1:{s:1:"w";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8654;}}}}}}}}}}}}}}}s:1:"R";a:1:{s:1:"i";a:1:{s:1:"g";a:1:{s:1:"h";a:1:{s:1:"t";a:1:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:"r";a:1:{s:1:"o";a:1:{s:1:"w";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8655;}}}}}}}}}}}s:1:"V";a:2:{s:1:"D";a:1:{s:1:"a";a:1:{s:1:"s";a:1:{s:1:"h";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8879;}}}}}s:1:"d";a:1:{s:1:"a";a:1:{s:1:"s";a:1:{s:1:"h";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8878;}}}}}}s:1:"a";a:4:{s:1:"b";a:1:{s:1:"l";a:1:{s:1:"a";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8711;}}}}s:1:"c";a:1:{s:1:"u";a:1:{s:1:"t";a:1:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:324;}}}}}s:1:"p";a:3:{s:1:";";a:1:{s:9:"codepoint";i:8777;}s:1:"o";a:1:{s:1:"s";a:1:{s:1:";";a:1:{s:9:"codepoint";i:329;}}}s:1:"p";a:1:{s:1:"r";a:1:{s:1:"o";a:1:{s:1:"x";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8777;}}}}}}s:1:"t";a:1:{s:1:"u";a:1:{s:1:"r";a:2:{s:1:";";a:1:{s:9:"codepoint";i:9838;}s:1:"a";a:1:{s:1:"l";a:2:{s:1:";";a:1:{s:9:"codepoint";i:9838;}s:1:"s";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8469;}}}}}}}}s:1:"b";a:1:{s:1:"s";a:1:{s:1:"p";a:2:{s:1:";";a:1:{s:9:"codepoint";i:160;}s:9:"codepoint";i:160;}}}s:1:"c";a:5:{s:1:"a";a:2:{s:1:"p";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10819;}}s:1:"r";a:1:{s:1:"o";a:1:{s:1:"n";a:1:{s:1:";";a:1:{s:9:"codepoint";i:328;}}}}}s:1:"e";a:1:{s:1:"d";a:1:{s:1:"i";a:1:{s:1:"l";a:1:{s:1:";";a:1:{s:9:"codepoint";i:326;}}}}}s:1:"o";a:1:{s:1:"n";a:1:{s:1:"g";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8775;}}}}s:1:"u";a:1:{s:1:"p";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10818;}}}s:1:"y";a:1:{s:1:";";a:1:{s:9:"codepoint";i:1085;}}}s:1:"d";a:1:{s:1:"a";a:1:{s:1:"s";a:1:{s:1:"h";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8211;}}}}}s:1:"e";a:6:{s:1:";";a:1:{s:9:"codepoint";i:8800;}s:1:"A";a:1:{s:1:"r";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8663;}}}}s:1:"a";a:1:{s:1:"r";a:2:{s:1:"h";a:1:{s:1:"k";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10532;}}}s:1:"r";a:2:{s:1:";";a:1:{s:9:"codepoint";i:8599;}s:1:"o";a:1:{s:1:"w";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8599;}}}}}}s:1:"q";a:1:{s:1:"u";a:1:{s:1:"i";a:1:{s:1:"v";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8802;}}}}}s:1:"s";a:1:{s:1:"e";a:1:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10536;}}}}}s:1:"x";a:1:{s:1:"i";a:1:{s:1:"s";a:1:{s:1:"t";a:2:{s:1:";";a:1:{s:9:"codepoint";i:8708;}s:1:"s";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8708;}}}}}}}s:1:"f";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:120107;}}}s:1:"g";a:3:{s:1:"e";a:2:{s:1:";";a:1:{s:9:"codepoint";i:8817;}s:1:"q";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8817;}}}s:1:"s";a:1:{s:1:"i";a:1:{s:1:"m";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8821;}}}}s:1:"t";a:2:{s:1:";";a:1:{s:9:"codepoint";i:8815;}s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8815;}}}}s:1:"h";a:3:{s:1:"A";a:1:{s:1:"r";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8654;}}}}s:1:"a";a:1:{s:1:"r";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8622;}}}}s:1:"p";a:1:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10994;}}}}}s:1:"i";a:3:{s:1:";";a:1:{s:9:"codepoint";i:8715;}s:1:"s";a:2:{s:1:";";a:1:{s:9:"codepoint";i:8956;}s:1:"d";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8954;}}}s:1:"v";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8715;}}}s:1:"j";a:1:{s:1:"c";a:1:{s:1:"y";a:1:{s:1:";";a:1:{s:9:"codepoint";i:1114;}}}}s:1:"l";a:6:{s:1:"A";a:1:{s:1:"r";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8653;}}}}s:1:"a";a:1:{s:1:"r";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8602;}}}}s:1:"d";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8229;}}}s:1:"e";a:4:{s:1:";";a:1:{s:9:"codepoint";i:8816;}s:1:"f";a:1:{s:1:"t";a:2:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:"r";a:1:{s:1:"o";a:1:{s:1:"w";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8602;}}}}}}s:1:"r";a:1:{s:1:"i";a:1:{s:1:"g";a:1:{s:1:"h";a:1:{s:1:"t";a:1:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:"r";a:1:{s:1:"o";a:1:{s:1:"w";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8622;}}}}}}}}}}}}}s:1:"q";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8816;}}s:1:"s";a:1:{s:1:"s";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8814;}}}}s:1:"s";a:1:{s:1:"i";a:1:{s:1:"m";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8820;}}}}s:1:"t";a:2:{s:1:";";a:1:{s:9:"codepoint";i:8814;}s:1:"r";a:1:{s:1:"i";a:2:{s:1:";";a:1:{s:9:"codepoint";i:8938;}s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8940;}}}}}}s:1:"m";a:1:{s:1:"i";a:1:{s:1:"d";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8740;}}}}s:1:"o";a:2:{s:1:"p";a:1:{s:1:"f";a:1:{s:1:";";a:1:{s:9:"codepoint";i:120159;}}}s:1:"t";a:4:{s:1:";";a:1:{s:9:"codepoint";i:172;}s:9:"codepoint";i:172;s:1:"i";a:1:{s:1:"n";a:2:{s:1:";";a:1:{s:9:"codepoint";i:8713;}s:1:"v";a:3:{s:1:"a";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8713;}}s:1:"b";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8951;}}s:1:"c";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8950;}}}}}s:1:"n";a:1:{s:1:"i";a:2:{s:1:";";a:1:{s:9:"codepoint";i:8716;}s:1:"v";a:3:{s:1:"a";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8716;}}s:1:"b";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8958;}}s:1:"c";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8957;}}}}}}}s:1:"p";a:3:{s:1:"a";a:1:{s:1:"r";a:2:{s:1:";";a:1:{s:9:"codepoint";i:8742;}s:1:"a";a:1:{s:1:"l";a:1:{s:1:"l";a:1:{s:1:"e";a:1:{s:1:"l";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8742;}}}}}}}}s:1:"o";a:1:{s:1:"l";a:1:{s:1:"i";a:1:{s:1:"n";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10772;}}}}}}s:1:"r";a:3:{s:1:";";a:1:{s:9:"codepoint";i:8832;}s:1:"c";a:1:{s:1:"u";a:1:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8928;}}}}s:1:"e";a:1:{s:1:"c";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8832;}}}}}s:1:"r";a:4:{s:1:"A";a:1:{s:1:"r";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8655;}}}}s:1:"a";a:1:{s:1:"r";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8603;}}}}s:1:"i";a:1:{s:1:"g";a:1:{s:1:"h";a:1:{s:1:"t";a:1:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:"r";a:1:{s:1:"o";a:1:{s:1:"w";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8603;}}}}}}}}}}s:1:"t";a:1:{s:1:"r";a:1:{s:1:"i";a:2:{s:1:";";a:1:{s:9:"codepoint";i:8939;}s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8941;}}}}}}s:1:"s";a:7:{s:1:"c";a:3:{s:1:";";a:1:{s:9:"codepoint";i:8833;}s:1:"c";a:1:{s:1:"u";a:1:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8929;}}}}s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:120003;}}}s:1:"h";a:1:{s:1:"o";a:1:{s:1:"r";a:1:{s:1:"t";a:2:{s:1:"m";a:1:{s:1:"i";a:1:{s:1:"d";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8740;}}}}s:1:"p";a:1:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:"a";a:1:{s:1:"l";a:1:{s:1:"l";a:1:{s:1:"e";a:1:{s:1:"l";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8742;}}}}}}}}}}}}}s:1:"i";a:1:{s:1:"m";a:2:{s:1:";";a:1:{s:9:"codepoint";i:8769;}s:1:"e";a:2:{s:1:";";a:1:{s:9:"codepoint";i:8772;}s:1:"q";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8772;}}}}}s:1:"m";a:1:{s:1:"i";a:1:{s:1:"d";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8740;}}}}s:1:"p";a:1:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8742;}}}}s:1:"q";a:1:{s:1:"s";a:1:{s:1:"u";a:2:{s:1:"b";a:1:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8930;}}}s:1:"p";a:1:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8931;}}}}}}s:1:"u";a:3:{s:1:"b";a:3:{s:1:";";a:1:{s:9:"codepoint";i:8836;}s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8840;}}s:1:"s";a:1:{s:1:"e";a:1:{s:1:"t";a:1:{s:1:"e";a:1:{s:1:"q";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8840;}}}}}}}s:1:"c";a:1:{s:1:"c";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8833;}}}s:1:"p";a:3:{s:1:";";a:1:{s:9:"codepoint";i:8837;}s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8841;}}s:1:"s";a:1:{s:1:"e";a:1:{s:1:"t";a:1:{s:1:"e";a:1:{s:1:"q";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8841;}}}}}}}}}s:1:"t";a:4:{s:1:"g";a:1:{s:1:"l";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8825;}}}s:1:"i";a:1:{s:1:"l";a:1:{s:1:"d";a:1:{s:1:"e";a:2:{s:1:";";a:1:{s:9:"codepoint";i:241;}s:9:"codepoint";i:241;}}}}s:1:"l";a:1:{s:1:"g";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8824;}}}s:1:"r";a:1:{s:1:"i";a:1:{s:1:"a";a:1:{s:1:"n";a:1:{s:1:"g";a:1:{s:1:"l";a:1:{s:1:"e";a:2:{s:1:"l";a:1:{s:1:"e";a:1:{s:1:"f";a:1:{s:1:"t";a:2:{s:1:";";a:1:{s:9:"codepoint";i:8938;}s:1:"e";a:1:{s:1:"q";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8940;}}}}}}}s:1:"r";a:1:{s:1:"i";a:1:{s:1:"g";a:1:{s:1:"h";a:1:{s:1:"t";a:2:{s:1:";";a:1:{s:9:"codepoint";i:8939;}s:1:"e";a:1:{s:1:"q";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8941;}}}}}}}}}}}}}}}}s:1:"u";a:2:{s:1:";";a:1:{s:9:"codepoint";i:957;}s:1:"m";a:3:{s:1:";";a:1:{s:9:"codepoint";i:35;}s:1:"e";a:1:{s:1:"r";a:1:{s:1:"o";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8470;}}}}s:1:"s";a:1:{s:1:"p";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8199;}}}}}s:1:"v";a:6:{s:1:"D";a:1:{s:1:"a";a:1:{s:1:"s";a:1:{s:1:"h";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8877;}}}}}s:1:"H";a:1:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10500;}}}}}s:1:"d";a:1:{s:1:"a";a:1:{s:1:"s";a:1:{s:1:"h";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8876;}}}}}s:1:"i";a:1:{s:1:"n";a:1:{s:1:"f";a:1:{s:1:"i";a:1:{s:1:"n";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10718;}}}}}}s:1:"l";a:1:{s:1:"A";a:1:{s:1:"r";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10498;}}}}}s:1:"r";a:1:{s:1:"A";a:1:{s:1:"r";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10499;}}}}}}s:1:"w";a:3:{s:1:"A";a:1:{s:1:"r";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8662;}}}}s:1:"a";a:1:{s:1:"r";a:2:{s:1:"h";a:1:{s:1:"k";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10531;}}}s:1:"r";a:2:{s:1:";";a:1:{s:9:"codepoint";i:8598;}s:1:"o";a:1:{s:1:"w";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8598;}}}}}}s:1:"n";a:1:{s:1:"e";a:1:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10535;}}}}}}}s:1:"o";a:18:{s:1:"S";a:1:{s:1:";";a:1:{s:9:"codepoint";i:9416;}}s:1:"a";a:2:{s:1:"c";a:1:{s:1:"u";a:1:{s:1:"t";a:1:{s:1:"e";a:2:{s:1:";";a:1:{s:9:"codepoint";i:243;}s:9:"codepoint";i:243;}}}}s:1:"s";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8859;}}}}s:1:"c";a:2:{s:1:"i";a:1:{s:1:"r";a:2:{s:1:";";a:1:{s:9:"codepoint";i:8858;}s:1:"c";a:2:{s:1:";";a:1:{s:9:"codepoint";i:244;}s:9:"codepoint";i:244;}}}s:1:"y";a:1:{s:1:";";a:1:{s:9:"codepoint";i:1086;}}}s:1:"d";a:5:{s:1:"a";a:1:{s:1:"s";a:1:{s:1:"h";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8861;}}}}s:1:"b";a:1:{s:1:"l";a:1:{s:1:"a";a:1:{s:1:"c";a:1:{s:1:";";a:1:{s:9:"codepoint";i:337;}}}}}s:1:"i";a:1:{s:1:"v";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10808;}}}s:1:"o";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8857;}}}s:1:"s";a:1:{s:1:"o";a:1:{s:1:"l";a:1:{s:1:"d";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10684;}}}}}}s:1:"e";a:1:{s:1:"l";a:1:{s:1:"i";a:1:{s:1:"g";a:1:{s:1:";";a:1:{s:9:"codepoint";i:339;}}}}}s:1:"f";a:2:{s:1:"c";a:1:{s:1:"i";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10687;}}}}s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:120108;}}}s:1:"g";a:3:{s:1:"o";a:1:{s:1:"n";a:1:{s:1:";";a:1:{s:9:"codepoint";i:731;}}}s:1:"r";a:1:{s:1:"a";a:1:{s:1:"v";a:1:{s:1:"e";a:2:{s:1:";";a:1:{s:9:"codepoint";i:242;}s:9:"codepoint";i:242;}}}}s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10689;}}}s:1:"h";a:2:{s:1:"b";a:1:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10677;}}}}s:1:"m";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8486;}}}s:1:"i";a:1:{s:1:"n";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8750;}}}}s:1:"l";a:4:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8634;}}}}s:1:"c";a:2:{s:1:"i";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10686;}}}s:1:"r";a:1:{s:1:"o";a:1:{s:1:"s";a:1:{s:1:"s";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10683;}}}}}}s:1:"i";a:1:{s:1:"n";a:1:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8254;}}}}s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10688;}}}s:1:"m";a:3:{s:1:"a";a:1:{s:1:"c";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:333;}}}}s:1:"e";a:1:{s:1:"g";a:1:{s:1:"a";a:1:{s:1:";";a:1:{s:9:"codepoint";i:969;}}}}s:1:"i";a:3:{s:1:"c";a:1:{s:1:"r";a:1:{s:1:"o";a:1:{s:1:"n";a:1:{s:1:";";a:1:{s:9:"codepoint";i:959;}}}}}s:1:"d";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10678;}}s:1:"n";a:1:{s:1:"u";a:1:{s:1:"s";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8854;}}}}}}s:1:"o";a:1:{s:1:"p";a:1:{s:1:"f";a:1:{s:1:";";a:1:{s:9:"codepoint";i:120160;}}}}s:1:"p";a:3:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10679;}}}s:1:"e";a:1:{s:1:"r";a:1:{s:1:"p";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10681;}}}}s:1:"l";a:1:{s:1:"u";a:1:{s:1:"s";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8853;}}}}}s:1:"r";a:7:{s:1:";";a:1:{s:9:"codepoint";i:8744;}s:1:"a";a:1:{s:1:"r";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8635;}}}}s:1:"d";a:4:{s:1:";";a:1:{s:9:"codepoint";i:10845;}s:1:"e";a:1:{s:1:"r";a:2:{s:1:";";a:1:{s:9:"codepoint";i:8500;}s:1:"o";a:1:{s:1:"f";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8500;}}}}}s:1:"f";a:2:{s:1:";";a:1:{s:9:"codepoint";i:170;}s:9:"codepoint";i:170;}s:1:"m";a:2:{s:1:";";a:1:{s:9:"codepoint";i:186;}s:9:"codepoint";i:186;}}s:1:"i";a:1:{s:1:"g";a:1:{s:1:"o";a:1:{s:1:"f";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8886;}}}}}s:1:"o";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10838;}}}s:1:"s";a:1:{s:1:"l";a:1:{s:1:"o";a:1:{s:1:"p";a:1:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10839;}}}}}}s:1:"v";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10843;}}}s:1:"s";a:3:{s:1:"c";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8500;}}}s:1:"l";a:1:{s:1:"a";a:1:{s:1:"s";a:1:{s:1:"h";a:2:{s:1:";";a:1:{s:9:"codepoint";i:248;}s:9:"codepoint";i:248;}}}}s:1:"o";a:1:{s:1:"l";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8856;}}}}s:1:"t";a:1:{s:1:"i";a:2:{s:1:"l";a:1:{s:1:"d";a:1:{s:1:"e";a:2:{s:1:";";a:1:{s:9:"codepoint";i:245;}s:9:"codepoint";i:245;}}}s:1:"m";a:1:{s:1:"e";a:1:{s:1:"s";a:2:{s:1:";";a:1:{s:9:"codepoint";i:8855;}s:1:"a";a:1:{s:1:"s";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10806;}}}}}}}}s:1:"u";a:1:{s:1:"m";a:1:{s:1:"l";a:2:{s:1:";";a:1:{s:9:"codepoint";i:246;}s:9:"codepoint";i:246;}}}s:1:"v";a:1:{s:1:"b";a:1:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:9021;}}}}}}s:1:"p";a:12:{s:1:"a";a:1:{s:1:"r";a:4:{s:1:";";a:1:{s:9:"codepoint";i:8741;}s:1:"a";a:3:{s:1:";";a:1:{s:9:"codepoint";i:182;}s:9:"codepoint";i:182;s:1:"l";a:1:{s:1:"l";a:1:{s:1:"e";a:1:{s:1:"l";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8741;}}}}}}s:1:"s";a:2:{s:1:"i";a:1:{s:1:"m";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10995;}}}s:1:"l";a:1:{s:1:";";a:1:{s:9:"codepoint";i:11005;}}}s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8706;}}}}s:1:"c";a:1:{s:1:"y";a:1:{s:1:";";a:1:{s:9:"codepoint";i:1087;}}}s:1:"e";a:1:{s:1:"r";a:5:{s:1:"c";a:1:{s:1:"n";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:37;}}}}s:1:"i";a:1:{s:1:"o";a:1:{s:1:"d";a:1:{s:1:";";a:1:{s:9:"codepoint";i:46;}}}}s:1:"m";a:1:{s:1:"i";a:1:{s:1:"l";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8240;}}}}s:1:"p";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8869;}}s:1:"t";a:1:{s:1:"e";a:1:{s:1:"n";a:1:{s:1:"k";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8241;}}}}}}}s:1:"f";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:120109;}}}s:1:"h";a:3:{s:1:"i";a:2:{s:1:";";a:1:{s:9:"codepoint";i:966;}s:1:"v";a:1:{s:1:";";a:1:{s:9:"codepoint";i:966;}}}s:1:"m";a:1:{s:1:"m";a:1:{s:1:"a";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8499;}}}}}s:1:"o";a:1:{s:1:"n";a:1:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:9742;}}}}}s:1:"i";a:3:{s:1:";";a:1:{s:9:"codepoint";i:960;}s:1:"t";a:1:{s:1:"c";a:1:{s:1:"h";a:1:{s:1:"f";a:1:{s:1:"o";a:1:{s:1:"r";a:1:{s:1:"k";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8916;}}}}}}}}s:1:"v";a:1:{s:1:";";a:1:{s:9:"codepoint";i:982;}}}s:1:"l";a:2:{s:1:"a";a:1:{s:1:"n";a:2:{s:1:"c";a:1:{s:1:"k";a:2:{s:1:";";a:1:{s:9:"codepoint";i:8463;}s:1:"h";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8462;}}}}s:1:"k";a:1:{s:1:"v";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8463;}}}}}s:1:"u";a:1:{s:1:"s";a:9:{s:1:";";a:1:{s:9:"codepoint";i:43;}s:1:"a";a:1:{s:1:"c";a:1:{s:1:"i";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10787;}}}}}s:1:"b";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8862;}}s:1:"c";a:1:{s:1:"i";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10786;}}}}s:1:"d";a:2:{s:1:"o";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8724;}}s:1:"u";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10789;}}}s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10866;}}s:1:"m";a:1:{s:1:"n";a:2:{s:1:";";a:1:{s:9:"codepoint";i:177;}s:9:"codepoint";i:177;}}s:1:"s";a:1:{s:1:"i";a:1:{s:1:"m";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10790;}}}}s:1:"t";a:1:{s:1:"w";a:1:{s:1:"o";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10791;}}}}}}}s:1:"m";a:1:{s:1:";";a:1:{s:9:"codepoint";i:177;}}s:1:"o";a:3:{s:1:"i";a:1:{s:1:"n";a:1:{s:1:"t";a:1:{s:1:"i";a:1:{s:1:"n";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10773;}}}}}}}s:1:"p";a:1:{s:1:"f";a:1:{s:1:";";a:1:{s:9:"codepoint";i:120161;}}}s:1:"u";a:1:{s:1:"n";a:1:{s:1:"d";a:2:{s:1:";";a:1:{s:9:"codepoint";i:163;}s:9:"codepoint";i:163;}}}}s:1:"r";a:10:{s:1:";";a:1:{s:9:"codepoint";i:8826;}s:1:"E";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10931;}}s:1:"a";a:1:{s:1:"p";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10935;}}}s:1:"c";a:1:{s:1:"u";a:1:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8828;}}}}s:1:"e";a:2:{s:1:";";a:1:{s:9:"codepoint";i:10927;}s:1:"c";a:6:{s:1:";";a:1:{s:9:"codepoint";i:8826;}s:1:"a";a:1:{s:1:"p";a:1:{s:1:"p";a:1:{s:1:"r";a:1:{s:1:"o";a:1:{s:1:"x";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10935;}}}}}}}s:1:"c";a:1:{s:1:"u";a:1:{s:1:"r";a:1:{s:1:"l";a:1:{s:1:"y";a:1:{s:1:"e";a:1:{s:1:"q";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8828;}}}}}}}}s:1:"e";a:1:{s:1:"q";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10927;}}}s:1:"n";a:3:{s:1:"a";a:1:{s:1:"p";a:1:{s:1:"p";a:1:{s:1:"r";a:1:{s:1:"o";a:1:{s:1:"x";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10937;}}}}}}}s:1:"e";a:1:{s:1:"q";a:1:{s:1:"q";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10933;}}}}s:1:"s";a:1:{s:1:"i";a:1:{s:1:"m";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8936;}}}}}s:1:"s";a:1:{s:1:"i";a:1:{s:1:"m";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8830;}}}}}}s:1:"i";a:1:{s:1:"m";a:1:{s:1:"e";a:2:{s:1:";";a:1:{s:9:"codepoint";i:8242;}s:1:"s";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8473;}}}}}s:1:"n";a:3:{s:1:"E";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10933;}}s:1:"a";a:1:{s:1:"p";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10937;}}}s:1:"s";a:1:{s:1:"i";a:1:{s:1:"m";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8936;}}}}}s:1:"o";a:3:{s:1:"d";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8719;}}s:1:"f";a:3:{s:1:"a";a:1:{s:1:"l";a:1:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:9006;}}}}}s:1:"l";a:1:{s:1:"i";a:1:{s:1:"n";a:1:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8978;}}}}}s:1:"s";a:1:{s:1:"u";a:1:{s:1:"r";a:1:{s:1:"f";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8979;}}}}}}s:1:"p";a:2:{s:1:";";a:1:{s:9:"codepoint";i:8733;}s:1:"t";a:1:{s:1:"o";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8733;}}}}}s:1:"s";a:1:{s:1:"i";a:1:{s:1:"m";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8830;}}}}s:1:"u";a:1:{s:1:"r";a:1:{s:1:"e";a:1:{s:1:"l";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8880;}}}}}}s:1:"s";a:2:{s:1:"c";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:120005;}}}s:1:"i";a:1:{s:1:";";a:1:{s:9:"codepoint";i:968;}}}s:1:"u";a:1:{s:1:"n";a:1:{s:1:"c";a:1:{s:1:"s";a:1:{s:1:"p";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8200;}}}}}}}s:1:"q";a:6:{s:1:"f";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:120110;}}}s:1:"i";a:1:{s:1:"n";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10764;}}}}s:1:"o";a:1:{s:1:"p";a:1:{s:1:"f";a:1:{s:1:";";a:1:{s:9:"codepoint";i:120162;}}}}s:1:"p";a:1:{s:1:"r";a:1:{s:1:"i";a:1:{s:1:"m";a:1:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8279;}}}}}}s:1:"s";a:1:{s:1:"c";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:120006;}}}}s:1:"u";a:3:{s:1:"a";a:1:{s:1:"t";a:2:{s:1:"e";a:1:{s:1:"r";a:1:{s:1:"n";a:1:{s:1:"i";a:1:{s:1:"o";a:1:{s:1:"n";a:1:{s:1:"s";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8461;}}}}}}}}s:1:"i";a:1:{s:1:"n";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10774;}}}}}}s:1:"e";a:1:{s:1:"s";a:1:{s:1:"t";a:2:{s:1:";";a:1:{s:9:"codepoint";i:63;}s:1:"e";a:1:{s:1:"q";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8799;}}}}}}s:1:"o";a:1:{s:1:"t";a:2:{s:1:";";a:1:{s:9:"codepoint";i:34;}s:9:"codepoint";i:34;}}}}s:1:"r";a:21:{s:1:"A";a:3:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8667;}}}}s:1:"r";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8658;}}}s:1:"t";a:1:{s:1:"a";a:1:{s:1:"i";a:1:{s:1:"l";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10524;}}}}}}s:1:"B";a:1:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10511;}}}}}s:1:"H";a:1:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10596;}}}}s:1:"a";a:7:{s:1:"c";a:2:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10714;}}s:1:"u";a:1:{s:1:"t";a:1:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:341;}}}}}s:1:"d";a:1:{s:1:"i";a:1:{s:1:"c";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8730;}}}}s:1:"e";a:1:{s:1:"m";a:1:{s:1:"p";a:1:{s:1:"t";a:1:{s:1:"y";a:1:{s:1:"v";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10675;}}}}}}}s:1:"n";a:1:{s:1:"g";a:4:{s:1:";";a:1:{s:9:"codepoint";i:10217;}s:1:"d";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10642;}}s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10661;}}s:1:"l";a:1:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10217;}}}}}s:1:"q";a:1:{s:1:"u";a:1:{s:1:"o";a:2:{s:1:";";a:1:{s:9:"codepoint";i:187;}s:9:"codepoint";i:187;}}}s:1:"r";a:1:{s:1:"r";a:11:{s:1:";";a:1:{s:9:"codepoint";i:8594;}s:1:"a";a:1:{s:1:"p";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10613;}}}s:1:"b";a:2:{s:1:";";a:1:{s:9:"codepoint";i:8677;}s:1:"f";a:1:{s:1:"s";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10528;}}}}s:1:"c";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10547;}}s:1:"f";a:1:{s:1:"s";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10526;}}}s:1:"h";a:1:{s:1:"k";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8618;}}}s:1:"l";a:1:{s:1:"p";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8620;}}}s:1:"p";a:1:{s:1:"l";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10565;}}}s:1:"s";a:1:{s:1:"i";a:1:{s:1:"m";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10612;}}}}s:1:"t";a:1:{s:1:"l";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8611;}}}s:1:"w";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8605;}}}}s:1:"t";a:2:{s:1:"a";a:1:{s:1:"i";a:1:{s:1:"l";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10522;}}}}s:1:"i";a:1:{s:1:"o";a:2:{s:1:";";a:1:{s:9:"codepoint";i:8758;}s:1:"n";a:1:{s:1:"a";a:1:{s:1:"l";a:1:{s:1:"s";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8474;}}}}}}}}}s:1:"b";a:3:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10509;}}}}s:1:"b";a:1:{s:1:"r";a:1:{s:1:"k";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10099;}}}}s:1:"r";a:2:{s:1:"a";a:1:{s:1:"c";a:2:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:125;}}s:1:"k";a:1:{s:1:";";a:1:{s:9:"codepoint";i:93;}}}}s:1:"k";a:2:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10636;}}s:1:"s";a:1:{s:1:"l";a:2:{s:1:"d";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10638;}}s:1:"u";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10640;}}}}}}}s:1:"c";a:4:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:"o";a:1:{s:1:"n";a:1:{s:1:";";a:1:{s:9:"codepoint";i:345;}}}}}s:1:"e";a:2:{s:1:"d";a:1:{s:1:"i";a:1:{s:1:"l";a:1:{s:1:";";a:1:{s:9:"codepoint";i:343;}}}}s:1:"i";a:1:{s:1:"l";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8969;}}}}s:1:"u";a:1:{s:1:"b";a:1:{s:1:";";a:1:{s:9:"codepoint";i:125;}}}s:1:"y";a:1:{s:1:";";a:1:{s:9:"codepoint";i:1088;}}}s:1:"d";a:4:{s:1:"c";a:1:{s:1:"a";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10551;}}}s:1:"l";a:1:{s:1:"d";a:1:{s:1:"h";a:1:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10601;}}}}}}s:1:"q";a:1:{s:1:"u";a:1:{s:1:"o";a:2:{s:1:";";a:1:{s:9:"codepoint";i:8221;}s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8221;}}}}}s:1:"s";a:1:{s:1:"h";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8627;}}}}s:1:"e";a:3:{s:1:"a";a:1:{s:1:"l";a:4:{s:1:";";a:1:{s:9:"codepoint";i:8476;}s:1:"i";a:1:{s:1:"n";a:1:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8475;}}}}s:1:"p";a:1:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8476;}}}}}s:1:"s";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8477;}}}}s:1:"c";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:9645;}}}s:1:"g";a:2:{s:1:";";a:1:{s:9:"codepoint";i:174;}s:9:"codepoint";i:174;}}s:1:"f";a:3:{s:1:"i";a:1:{s:1:"s";a:1:{s:1:"h";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10621;}}}}}s:1:"l";a:1:{s:1:"o";a:1:{s:1:"o";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8971;}}}}}s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:120111;}}}s:1:"h";a:2:{s:1:"a";a:1:{s:1:"r";a:2:{s:1:"d";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8641;}}s:1:"u";a:2:{s:1:";";a:1:{s:9:"codepoint";i:8640;}s:1:"l";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10604;}}}}}s:1:"o";a:2:{s:1:";";a:1:{s:9:"codepoint";i:961;}s:1:"v";a:1:{s:1:";";a:1:{s:9:"codepoint";i:1009;}}}}s:1:"i";a:3:{s:1:"g";a:1:{s:1:"h";a:1:{s:1:"t";a:6:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:"r";a:1:{s:1:"o";a:1:{s:1:"w";a:2:{s:1:";";a:1:{s:9:"codepoint";i:8594;}s:1:"t";a:1:{s:1:"a";a:1:{s:1:"i";a:1:{s:1:"l";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8611;}}}}}}}}}}s:1:"h";a:1:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:"p";a:1:{s:1:"o";a:1:{s:1:"o";a:1:{s:1:"n";a:2:{s:1:"d";a:1:{s:1:"o";a:1:{s:1:"w";a:1:{s:1:"n";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8641;}}}}}s:1:"u";a:1:{s:1:"p";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8640;}}}}}}}}}}s:1:"l";a:1:{s:1:"e";a:1:{s:1:"f";a:1:{s:1:"t";a:2:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:"r";a:1:{s:1:"o";a:1:{s:1:"w";a:1:{s:1:"s";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8644;}}}}}}}s:1:"h";a:1:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:"p";a:1:{s:1:"o";a:1:{s:1:"o";a:1:{s:1:"n";a:1:{s:1:"s";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8652;}}}}}}}}}}}}}s:1:"r";a:1:{s:1:"i";a:1:{s:1:"g";a:1:{s:1:"h";a:1:{s:1:"t";a:1:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:"r";a:1:{s:1:"o";a:1:{s:1:"w";a:1:{s:1:"s";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8649;}}}}}}}}}}}}s:1:"s";a:1:{s:1:"q";a:1:{s:1:"u";a:1:{s:1:"i";a:1:{s:1:"g";a:1:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:"r";a:1:{s:1:"o";a:1:{s:1:"w";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8605;}}}}}}}}}}}s:1:"t";a:1:{s:1:"h";a:1:{s:1:"r";a:1:{s:1:"e";a:1:{s:1:"e";a:1:{s:1:"t";a:1:{s:1:"i";a:1:{s:1:"m";a:1:{s:1:"e";a:1:{s:1:"s";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8908;}}}}}}}}}}}}}}s:1:"n";a:1:{s:1:"g";a:1:{s:1:";";a:1:{s:9:"codepoint";i:730;}}}s:1:"s";a:1:{s:1:"i";a:1:{s:1:"n";a:1:{s:1:"g";a:1:{s:1:"d";a:1:{s:1:"o";a:1:{s:1:"t";a:1:{s:1:"s";a:1:{s:1:"e";a:1:{s:1:"q";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8787;}}}}}}}}}}}}s:1:"l";a:3:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8644;}}}}s:1:"h";a:1:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8652;}}}}s:1:"m";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8207;}}}s:1:"m";a:1:{s:1:"o";a:1:{s:1:"u";a:1:{s:1:"s";a:1:{s:1:"t";a:2:{s:1:";";a:1:{s:9:"codepoint";i:9137;}s:1:"a";a:1:{s:1:"c";a:1:{s:1:"h";a:1:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:9137;}}}}}}}}}}s:1:"n";a:1:{s:1:"m";a:1:{s:1:"i";a:1:{s:1:"d";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10990;}}}}}s:1:"o";a:4:{s:1:"a";a:2:{s:1:"n";a:1:{s:1:"g";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10221;}}}s:1:"r";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8702;}}}}s:1:"b";a:1:{s:1:"r";a:1:{s:1:"k";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10215;}}}}s:1:"p";a:3:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10630;}}}s:1:"f";a:1:{s:1:";";a:1:{s:9:"codepoint";i:120163;}}s:1:"l";a:1:{s:1:"u";a:1:{s:1:"s";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10798;}}}}}s:1:"t";a:1:{s:1:"i";a:1:{s:1:"m";a:1:{s:1:"e";a:1:{s:1:"s";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10805;}}}}}}}s:1:"p";a:2:{s:1:"a";a:1:{s:1:"r";a:2:{s:1:";";a:1:{s:9:"codepoint";i:41;}s:1:"g";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10644;}}}}}s:1:"p";a:1:{s:1:"o";a:1:{s:1:"l";a:1:{s:1:"i";a:1:{s:1:"n";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10770;}}}}}}}}s:1:"r";a:1:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8649;}}}}}s:1:"s";a:4:{s:1:"a";a:1:{s:1:"q";a:1:{s:1:"u";a:1:{s:1:"o";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8250;}}}}}s:1:"c";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:120007;}}}s:1:"h";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8625;}}s:1:"q";a:2:{s:1:"b";a:1:{s:1:";";a:1:{s:9:"codepoint";i:93;}}s:1:"u";a:1:{s:1:"o";a:2:{s:1:";";a:1:{s:9:"codepoint";i:8217;}s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8217;}}}}}}s:1:"t";a:3:{s:1:"h";a:1:{s:1:"r";a:1:{s:1:"e";a:1:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8908;}}}}}s:1:"i";a:1:{s:1:"m";a:1:{s:1:"e";a:1:{s:1:"s";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8906;}}}}}s:1:"r";a:1:{s:1:"i";a:4:{s:1:";";a:1:{s:9:"codepoint";i:9657;}s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8885;}}s:1:"f";a:1:{s:1:";";a:1:{s:9:"codepoint";i:9656;}}s:1:"l";a:1:{s:1:"t";a:1:{s:1:"r";a:1:{s:1:"i";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10702;}}}}}}}}s:1:"u";a:1:{s:1:"l";a:1:{s:1:"u";a:1:{s:1:"h";a:1:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10600;}}}}}}}s:1:"x";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8478;}}}s:1:"s";a:19:{s:1:"a";a:1:{s:1:"c";a:1:{s:1:"u";a:1:{s:1:"t";a:1:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:347;}}}}}}s:1:"b";a:1:{s:1:"q";a:1:{s:1:"u";a:1:{s:1:"o";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8218;}}}}}s:1:"c";a:10:{s:1:";";a:1:{s:9:"codepoint";i:8827;}s:1:"E";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10932;}}s:1:"a";a:2:{s:1:"p";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10936;}}s:1:"r";a:1:{s:1:"o";a:1:{s:1:"n";a:1:{s:1:";";a:1:{s:9:"codepoint";i:353;}}}}}s:1:"c";a:1:{s:1:"u";a:1:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8829;}}}}s:1:"e";a:2:{s:1:";";a:1:{s:9:"codepoint";i:10928;}s:1:"d";a:1:{s:1:"i";a:1:{s:1:"l";a:1:{s:1:";";a:1:{s:9:"codepoint";i:351;}}}}}s:1:"i";a:1:{s:1:"r";a:1:{s:1:"c";a:1:{s:1:";";a:1:{s:9:"codepoint";i:349;}}}}s:1:"n";a:3:{s:1:"E";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10934;}}s:1:"a";a:1:{s:1:"p";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10938;}}}s:1:"s";a:1:{s:1:"i";a:1:{s:1:"m";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8937;}}}}}s:1:"p";a:1:{s:1:"o";a:1:{s:1:"l";a:1:{s:1:"i";a:1:{s:1:"n";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10771;}}}}}}}s:1:"s";a:1:{s:1:"i";a:1:{s:1:"m";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8831;}}}}s:1:"y";a:1:{s:1:";";a:1:{s:9:"codepoint";i:1089;}}}s:1:"d";a:1:{s:1:"o";a:1:{s:1:"t";a:3:{s:1:";";a:1:{s:9:"codepoint";i:8901;}s:1:"b";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8865;}}s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10854;}}}}}s:1:"e";a:7:{s:1:"A";a:1:{s:1:"r";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8664;}}}}s:1:"a";a:1:{s:1:"r";a:2:{s:1:"h";a:1:{s:1:"k";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10533;}}}s:1:"r";a:2:{s:1:";";a:1:{s:9:"codepoint";i:8600;}s:1:"o";a:1:{s:1:"w";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8600;}}}}}}s:1:"c";a:1:{s:1:"t";a:2:{s:1:";";a:1:{s:9:"codepoint";i:167;}s:9:"codepoint";i:167;}}s:1:"m";a:1:{s:1:"i";a:1:{s:1:";";a:1:{s:9:"codepoint";i:59;}}}s:1:"s";a:1:{s:1:"w";a:1:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10537;}}}}}s:1:"t";a:1:{s:1:"m";a:2:{s:1:"i";a:1:{s:1:"n";a:1:{s:1:"u";a:1:{s:1:"s";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8726;}}}}}s:1:"n";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8726;}}}}s:1:"x";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10038;}}}}s:1:"f";a:1:{s:1:"r";a:2:{s:1:";";a:1:{s:9:"codepoint";i:120112;}s:1:"o";a:1:{s:1:"w";a:1:{s:1:"n";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8994;}}}}}}s:1:"h";a:4:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:"p";a:1:{s:1:";";a:1:{s:9:"codepoint";i:9839;}}}}s:1:"c";a:2:{s:1:"h";a:1:{s:1:"c";a:1:{s:1:"y";a:1:{s:1:";";a:1:{s:9:"codepoint";i:1097;}}}}s:1:"y";a:1:{s:1:";";a:1:{s:9:"codepoint";i:1096;}}}s:1:"o";a:1:{s:1:"r";a:1:{s:1:"t";a:2:{s:1:"m";a:1:{s:1:"i";a:1:{s:1:"d";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8739;}}}}s:1:"p";a:1:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:"a";a:1:{s:1:"l";a:1:{s:1:"l";a:1:{s:1:"e";a:1:{s:1:"l";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8741;}}}}}}}}}}}}s:1:"y";a:2:{s:1:";";a:1:{s:9:"codepoint";i:173;}s:9:"codepoint";i:173;}}s:1:"i";a:2:{s:1:"g";a:1:{s:1:"m";a:1:{s:1:"a";a:3:{s:1:";";a:1:{s:9:"codepoint";i:963;}s:1:"f";a:1:{s:1:";";a:1:{s:9:"codepoint";i:962;}}s:1:"v";a:1:{s:1:";";a:1:{s:9:"codepoint";i:962;}}}}}s:1:"m";a:8:{s:1:";";a:1:{s:9:"codepoint";i:8764;}s:1:"d";a:1:{s:1:"o";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10858;}}}}s:1:"e";a:2:{s:1:";";a:1:{s:9:"codepoint";i:8771;}s:1:"q";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8771;}}}s:1:"g";a:2:{s:1:";";a:1:{s:9:"codepoint";i:10910;}s:1:"E";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10912;}}}s:1:"l";a:2:{s:1:";";a:1:{s:9:"codepoint";i:10909;}s:1:"E";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10911;}}}s:1:"n";a:1:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8774;}}}s:1:"p";a:1:{s:1:"l";a:1:{s:1:"u";a:1:{s:1:"s";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10788;}}}}}s:1:"r";a:1:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10610;}}}}}}}s:1:"l";a:1:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8592;}}}}}s:1:"m";a:4:{s:1:"a";a:2:{s:1:"l";a:1:{s:1:"l";a:1:{s:1:"s";a:1:{s:1:"e";a:1:{s:1:"t";a:1:{s:1:"m";a:1:{s:1:"i";a:1:{s:1:"n";a:1:{s:1:"u";a:1:{s:1:"s";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8726;}}}}}}}}}}}s:1:"s";a:1:{s:1:"h";a:1:{s:1:"p";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10803;}}}}}s:1:"e";a:1:{s:1:"p";a:1:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:"s";a:1:{s:1:"l";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10724;}}}}}}}s:1:"i";a:2:{s:1:"d";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8739;}}s:1:"l";a:1:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8995;}}}}s:1:"t";a:2:{s:1:";";a:1:{s:9:"codepoint";i:10922;}s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10924;}}}}s:1:"o";a:3:{s:1:"f";a:1:{s:1:"t";a:1:{s:1:"c";a:1:{s:1:"y";a:1:{s:1:";";a:1:{s:9:"codepoint";i:1100;}}}}}s:1:"l";a:2:{s:1:";";a:1:{s:9:"codepoint";i:47;}s:1:"b";a:2:{s:1:";";a:1:{s:9:"codepoint";i:10692;}s:1:"a";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:9023;}}}}}s:1:"p";a:1:{s:1:"f";a:1:{s:1:";";a:1:{s:9:"codepoint";i:120164;}}}}s:1:"p";a:1:{s:1:"a";a:2:{s:1:"d";a:1:{s:1:"e";a:1:{s:1:"s";a:2:{s:1:";";a:1:{s:9:"codepoint";i:9824;}s:1:"u";a:1:{s:1:"i";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:9824;}}}}}}}s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8741;}}}}s:1:"q";a:3:{s:1:"c";a:2:{s:1:"a";a:1:{s:1:"p";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8851;}}}s:1:"u";a:1:{s:1:"p";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8852;}}}}s:1:"s";a:1:{s:1:"u";a:2:{s:1:"b";a:3:{s:1:";";a:1:{s:9:"codepoint";i:8847;}s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8849;}}s:1:"s";a:1:{s:1:"e";a:1:{s:1:"t";a:2:{s:1:";";a:1:{s:9:"codepoint";i:8847;}s:1:"e";a:1:{s:1:"q";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8849;}}}}}}}s:1:"p";a:3:{s:1:";";a:1:{s:9:"codepoint";i:8848;}s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8850;}}s:1:"s";a:1:{s:1:"e";a:1:{s:1:"t";a:2:{s:1:";";a:1:{s:9:"codepoint";i:8848;}s:1:"e";a:1:{s:1:"q";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8850;}}}}}}}}}s:1:"u";a:3:{s:1:";";a:1:{s:9:"codepoint";i:9633;}s:1:"a";a:1:{s:1:"r";a:2:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:9633;}}s:1:"f";a:1:{s:1:";";a:1:{s:9:"codepoint";i:9642;}}}}s:1:"f";a:1:{s:1:";";a:1:{s:9:"codepoint";i:9642;}}}}s:1:"r";a:1:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8594;}}}}}s:1:"s";a:4:{s:1:"c";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:120008;}}}s:1:"e";a:1:{s:1:"t";a:1:{s:1:"m";a:1:{s:1:"n";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8726;}}}}}s:1:"m";a:1:{s:1:"i";a:1:{s:1:"l";a:1:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8995;}}}}}s:1:"t";a:1:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:"f";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8902;}}}}}}s:1:"t";a:2:{s:1:"a";a:1:{s:1:"r";a:2:{s:1:";";a:1:{s:9:"codepoint";i:9734;}s:1:"f";a:1:{s:1:";";a:1:{s:9:"codepoint";i:9733;}}}}s:1:"r";a:2:{s:1:"a";a:1:{s:1:"i";a:1:{s:1:"g";a:1:{s:1:"h";a:1:{s:1:"t";a:2:{s:1:"e";a:1:{s:1:"p";a:1:{s:1:"s";a:1:{s:1:"i";a:1:{s:1:"l";a:1:{s:1:"o";a:1:{s:1:"n";a:1:{s:1:";";a:1:{s:9:"codepoint";i:1013;}}}}}}}}s:1:"p";a:1:{s:1:"h";a:1:{s:1:"i";a:1:{s:1:";";a:1:{s:9:"codepoint";i:981;}}}}}}}}}s:1:"n";a:1:{s:1:"s";a:1:{s:1:";";a:1:{s:9:"codepoint";i:175;}}}}}s:1:"u";a:5:{s:1:"b";a:9:{s:1:";";a:1:{s:9:"codepoint";i:8834;}s:1:"E";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10949;}}s:1:"d";a:1:{s:1:"o";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10941;}}}}s:1:"e";a:2:{s:1:";";a:1:{s:9:"codepoint";i:8838;}s:1:"d";a:1:{s:1:"o";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10947;}}}}}s:1:"m";a:1:{s:1:"u";a:1:{s:1:"l";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10945;}}}}}s:1:"n";a:2:{s:1:"E";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10955;}}s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8842;}}}s:1:"p";a:1:{s:1:"l";a:1:{s:1:"u";a:1:{s:1:"s";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10943;}}}}}s:1:"r";a:1:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10617;}}}}}s:1:"s";a:3:{s:1:"e";a:1:{s:1:"t";a:3:{s:1:";";a:1:{s:9:"codepoint";i:8834;}s:1:"e";a:1:{s:1:"q";a:2:{s:1:";";a:1:{s:9:"codepoint";i:8838;}s:1:"q";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10949;}}}}s:1:"n";a:1:{s:1:"e";a:1:{s:1:"q";a:2:{s:1:";";a:1:{s:9:"codepoint";i:8842;}s:1:"q";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10955;}}}}}}}s:1:"i";a:1:{s:1:"m";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10951;}}}s:1:"u";a:2:{s:1:"b";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10965;}}s:1:"p";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10963;}}}}}s:1:"c";a:1:{s:1:"c";a:6:{s:1:";";a:1:{s:9:"codepoint";i:8827;}s:1:"a";a:1:{s:1:"p";a:1:{s:1:"p";a:1:{s:1:"r";a:1:{s:1:"o";a:1:{s:1:"x";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10936;}}}}}}}s:1:"c";a:1:{s:1:"u";a:1:{s:1:"r";a:1:{s:1:"l";a:1:{s:1:"y";a:1:{s:1:"e";a:1:{s:1:"q";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8829;}}}}}}}}s:1:"e";a:1:{s:1:"q";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10928;}}}s:1:"n";a:3:{s:1:"a";a:1:{s:1:"p";a:1:{s:1:"p";a:1:{s:1:"r";a:1:{s:1:"o";a:1:{s:1:"x";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10938;}}}}}}}s:1:"e";a:1:{s:1:"q";a:1:{s:1:"q";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10934;}}}}s:1:"s";a:1:{s:1:"i";a:1:{s:1:"m";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8937;}}}}}s:1:"s";a:1:{s:1:"i";a:1:{s:1:"m";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8831;}}}}}}s:1:"m";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8721;}}s:1:"n";a:1:{s:1:"g";a:1:{s:1:";";a:1:{s:9:"codepoint";i:9834;}}}s:1:"p";a:13:{i:1;a:2:{s:1:";";a:1:{s:9:"codepoint";i:185;}s:9:"codepoint";i:185;}i:2;a:2:{s:1:";";a:1:{s:9:"codepoint";i:178;}s:9:"codepoint";i:178;}i:3;a:2:{s:1:";";a:1:{s:9:"codepoint";i:179;}s:9:"codepoint";i:179;}s:1:";";a:1:{s:9:"codepoint";i:8835;}s:1:"E";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10950;}}s:1:"d";a:2:{s:1:"o";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10942;}}}s:1:"s";a:1:{s:1:"u";a:1:{s:1:"b";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10968;}}}}}s:1:"e";a:2:{s:1:";";a:1:{s:9:"codepoint";i:8839;}s:1:"d";a:1:{s:1:"o";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10948;}}}}}s:1:"h";a:1:{s:1:"s";a:1:{s:1:"u";a:1:{s:1:"b";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10967;}}}}}s:1:"l";a:1:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10619;}}}}}s:1:"m";a:1:{s:1:"u";a:1:{s:1:"l";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10946;}}}}}s:1:"n";a:2:{s:1:"E";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10956;}}s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8843;}}}s:1:"p";a:1:{s:1:"l";a:1:{s:1:"u";a:1:{s:1:"s";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10944;}}}}}s:1:"s";a:3:{s:1:"e";a:1:{s:1:"t";a:3:{s:1:";";a:1:{s:9:"codepoint";i:8835;}s:1:"e";a:1:{s:1:"q";a:2:{s:1:";";a:1:{s:9:"codepoint";i:8839;}s:1:"q";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10950;}}}}s:1:"n";a:1:{s:1:"e";a:1:{s:1:"q";a:2:{s:1:";";a:1:{s:9:"codepoint";i:8843;}s:1:"q";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10956;}}}}}}}s:1:"i";a:1:{s:1:"m";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10952;}}}s:1:"u";a:2:{s:1:"b";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10964;}}s:1:"p";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10966;}}}}}}s:1:"w";a:3:{s:1:"A";a:1:{s:1:"r";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8665;}}}}s:1:"a";a:1:{s:1:"r";a:2:{s:1:"h";a:1:{s:1:"k";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10534;}}}s:1:"r";a:2:{s:1:";";a:1:{s:9:"codepoint";i:8601;}s:1:"o";a:1:{s:1:"w";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8601;}}}}}}s:1:"n";a:1:{s:1:"w";a:1:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10538;}}}}}}s:1:"z";a:1:{s:1:"l";a:1:{s:1:"i";a:1:{s:1:"g";a:2:{s:1:";";a:1:{s:9:"codepoint";i:223;}s:9:"codepoint";i:223;}}}}}s:1:"t";a:13:{s:1:"a";a:2:{s:1:"r";a:1:{s:1:"g";a:1:{s:1:"e";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8982;}}}}}s:1:"u";a:1:{s:1:";";a:1:{s:9:"codepoint";i:964;}}}s:1:"b";a:1:{s:1:"r";a:1:{s:1:"k";a:1:{s:1:";";a:1:{s:9:"codepoint";i:9140;}}}}s:1:"c";a:3:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:"o";a:1:{s:1:"n";a:1:{s:1:";";a:1:{s:9:"codepoint";i:357;}}}}}s:1:"e";a:1:{s:1:"d";a:1:{s:1:"i";a:1:{s:1:"l";a:1:{s:1:";";a:1:{s:9:"codepoint";i:355;}}}}}s:1:"y";a:1:{s:1:";";a:1:{s:9:"codepoint";i:1090;}}}s:1:"d";a:1:{s:1:"o";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8411;}}}}s:1:"e";a:1:{s:1:"l";a:1:{s:1:"r";a:1:{s:1:"e";a:1:{s:1:"c";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8981;}}}}}}s:1:"f";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:120113;}}}s:1:"h";a:4:{s:1:"e";a:2:{s:1:"r";a:1:{s:1:"e";a:2:{i:4;a:1:{s:1:";";a:1:{s:9:"codepoint";i:8756;}}s:1:"f";a:1:{s:1:"o";a:1:{s:1:"r";a:1:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8756;}}}}}}}s:1:"t";a:1:{s:1:"a";a:3:{s:1:";";a:1:{s:9:"codepoint";i:952;}s:1:"s";a:1:{s:1:"y";a:1:{s:1:"m";a:1:{s:1:";";a:1:{s:9:"codepoint";i:977;}}}}s:1:"v";a:1:{s:1:";";a:1:{s:9:"codepoint";i:977;}}}}}s:1:"i";a:2:{s:1:"c";a:1:{s:1:"k";a:2:{s:1:"a";a:1:{s:1:"p";a:1:{s:1:"p";a:1:{s:1:"r";a:1:{s:1:"o";a:1:{s:1:"x";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8776;}}}}}}}s:1:"s";a:1:{s:1:"i";a:1:{s:1:"m";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8764;}}}}}}s:1:"n";a:1:{s:1:"s";a:1:{s:1:"p";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8201;}}}}}s:1:"k";a:2:{s:1:"a";a:1:{s:1:"p";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8776;}}}s:1:"s";a:1:{s:1:"i";a:1:{s:1:"m";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8764;}}}}}s:1:"o";a:1:{s:1:"r";a:1:{s:1:"n";a:2:{s:1:";";a:1:{s:9:"codepoint";i:254;}s:9:"codepoint";i:254;}}}}s:1:"i";a:3:{s:1:"l";a:1:{s:1:"d";a:1:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:732;}}}}s:1:"m";a:1:{s:1:"e";a:1:{s:1:"s";a:4:{s:1:";";a:1:{s:9:"codepoint";i:215;}s:9:"codepoint";i:215;s:1:"b";a:2:{s:1:";";a:1:{s:9:"codepoint";i:8864;}s:1:"a";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10801;}}}}s:1:"d";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10800;}}}}}s:1:"n";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8749;}}}}s:1:"o";a:3:{s:1:"e";a:1:{s:1:"a";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10536;}}}s:1:"p";a:4:{s:1:";";a:1:{s:9:"codepoint";i:8868;}s:1:"b";a:1:{s:1:"o";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:9014;}}}}s:1:"c";a:1:{s:1:"i";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10993;}}}}s:1:"f";a:2:{s:1:";";a:1:{s:9:"codepoint";i:120165;}s:1:"o";a:1:{s:1:"r";a:1:{s:1:"k";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10970;}}}}}}s:1:"s";a:1:{s:1:"a";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10537;}}}}s:1:"p";a:1:{s:1:"r";a:1:{s:1:"i";a:1:{s:1:"m";a:1:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8244;}}}}}}s:1:"r";a:3:{s:1:"a";a:1:{s:1:"d";a:1:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8482;}}}}s:1:"i";a:7:{s:1:"a";a:1:{s:1:"n";a:1:{s:1:"g";a:1:{s:1:"l";a:1:{s:1:"e";a:5:{s:1:";";a:1:{s:9:"codepoint";i:9653;}s:1:"d";a:1:{s:1:"o";a:1:{s:1:"w";a:1:{s:1:"n";a:1:{s:1:";";a:1:{s:9:"codepoint";i:9663;}}}}}s:1:"l";a:1:{s:1:"e";a:1:{s:1:"f";a:1:{s:1:"t";a:2:{s:1:";";a:1:{s:9:"codepoint";i:9667;}s:1:"e";a:1:{s:1:"q";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8884;}}}}}}}s:1:"q";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8796;}}s:1:"r";a:1:{s:1:"i";a:1:{s:1:"g";a:1:{s:1:"h";a:1:{s:1:"t";a:2:{s:1:";";a:1:{s:9:"codepoint";i:9657;}s:1:"e";a:1:{s:1:"q";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8885;}}}}}}}}}}}}}s:1:"d";a:1:{s:1:"o";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:9708;}}}}s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8796;}}s:1:"m";a:1:{s:1:"i";a:1:{s:1:"n";a:1:{s:1:"u";a:1:{s:1:"s";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10810;}}}}}}s:1:"p";a:1:{s:1:"l";a:1:{s:1:"u";a:1:{s:1:"s";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10809;}}}}}s:1:"s";a:1:{s:1:"b";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10701;}}}s:1:"t";a:1:{s:1:"i";a:1:{s:1:"m";a:1:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10811;}}}}}}s:1:"p";a:1:{s:1:"e";a:1:{s:1:"z";a:1:{s:1:"i";a:1:{s:1:"u";a:1:{s:1:"m";a:1:{s:1:";";a:1:{s:9:"codepoint";i:9186;}}}}}}}}s:1:"s";a:3:{s:1:"c";a:2:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:120009;}}s:1:"y";a:1:{s:1:";";a:1:{s:9:"codepoint";i:1094;}}}s:1:"h";a:1:{s:1:"c";a:1:{s:1:"y";a:1:{s:1:";";a:1:{s:9:"codepoint";i:1115;}}}}s:1:"t";a:1:{s:1:"r";a:1:{s:1:"o";a:1:{s:1:"k";a:1:{s:1:";";a:1:{s:9:"codepoint";i:359;}}}}}}s:1:"w";a:2:{s:1:"i";a:1:{s:1:"x";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8812;}}}}s:1:"o";a:1:{s:1:"h";a:1:{s:1:"e";a:1:{s:1:"a";a:1:{s:1:"d";a:2:{s:1:"l";a:1:{s:1:"e";a:1:{s:1:"f";a:1:{s:1:"t";a:1:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:"r";a:1:{s:1:"o";a:1:{s:1:"w";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8606;}}}}}}}}}}s:1:"r";a:1:{s:1:"i";a:1:{s:1:"g";a:1:{s:1:"h";a:1:{s:1:"t";a:1:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:"r";a:1:{s:1:"o";a:1:{s:1:"w";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8608;}}}}}}}}}}}}}}}}}}s:1:"u";a:18:{s:1:"A";a:1:{s:1:"r";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8657;}}}}s:1:"H";a:1:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10595;}}}}s:1:"a";a:2:{s:1:"c";a:1:{s:1:"u";a:1:{s:1:"t";a:1:{s:1:"e";a:2:{s:1:";";a:1:{s:9:"codepoint";i:250;}s:9:"codepoint";i:250;}}}}s:1:"r";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8593;}}}}s:1:"b";a:1:{s:1:"r";a:2:{s:1:"c";a:1:{s:1:"y";a:1:{s:1:";";a:1:{s:9:"codepoint";i:1118;}}}s:1:"e";a:1:{s:1:"v";a:1:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:365;}}}}}}s:1:"c";a:2:{s:1:"i";a:1:{s:1:"r";a:1:{s:1:"c";a:2:{s:1:";";a:1:{s:9:"codepoint";i:251;}s:9:"codepoint";i:251;}}}s:1:"y";a:1:{s:1:";";a:1:{s:9:"codepoint";i:1091;}}}s:1:"d";a:3:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8645;}}}}s:1:"b";a:1:{s:1:"l";a:1:{s:1:"a";a:1:{s:1:"c";a:1:{s:1:";";a:1:{s:9:"codepoint";i:369;}}}}}s:1:"h";a:1:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10606;}}}}}s:1:"f";a:2:{s:1:"i";a:1:{s:1:"s";a:1:{s:1:"h";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10622;}}}}}s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:120114;}}}s:1:"g";a:1:{s:1:"r";a:1:{s:1:"a";a:1:{s:1:"v";a:1:{s:1:"e";a:2:{s:1:";";a:1:{s:9:"codepoint";i:249;}s:9:"codepoint";i:249;}}}}}s:1:"h";a:2:{s:1:"a";a:1:{s:1:"r";a:2:{s:1:"l";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8639;}}s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8638;}}}}s:1:"b";a:1:{s:1:"l";a:1:{s:1:"k";a:1:{s:1:";";a:1:{s:9:"codepoint";i:9600;}}}}}s:1:"l";a:2:{s:1:"c";a:2:{s:1:"o";a:1:{s:1:"r";a:1:{s:1:"n";a:2:{s:1:";";a:1:{s:9:"codepoint";i:8988;}s:1:"e";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8988;}}}}}}s:1:"r";a:1:{s:1:"o";a:1:{s:1:"p";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8975;}}}}}s:1:"t";a:1:{s:1:"r";a:1:{s:1:"i";a:1:{s:1:";";a:1:{s:9:"codepoint";i:9720;}}}}}s:1:"m";a:2:{s:1:"a";a:1:{s:1:"c";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:363;}}}}s:1:"l";a:2:{s:1:";";a:1:{s:9:"codepoint";i:168;}s:9:"codepoint";i:168;}}s:1:"o";a:2:{s:1:"g";a:1:{s:1:"o";a:1:{s:1:"n";a:1:{s:1:";";a:1:{s:9:"codepoint";i:371;}}}}s:1:"p";a:1:{s:1:"f";a:1:{s:1:";";a:1:{s:9:"codepoint";i:120166;}}}}s:1:"p";a:6:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:"r";a:1:{s:1:"o";a:1:{s:1:"w";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8593;}}}}}}s:1:"d";a:1:{s:1:"o";a:1:{s:1:"w";a:1:{s:1:"n";a:1:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:"r";a:1:{s:1:"o";a:1:{s:1:"w";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8597;}}}}}}}}}}s:1:"h";a:1:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:"p";a:1:{s:1:"o";a:1:{s:1:"o";a:1:{s:1:"n";a:2:{s:1:"l";a:1:{s:1:"e";a:1:{s:1:"f";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8639;}}}}}s:1:"r";a:1:{s:1:"i";a:1:{s:1:"g";a:1:{s:1:"h";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8638;}}}}}}}}}}}}}s:1:"l";a:1:{s:1:"u";a:1:{s:1:"s";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8846;}}}}s:1:"s";a:1:{s:1:"i";a:3:{s:1:";";a:1:{s:9:"codepoint";i:965;}s:1:"h";a:1:{s:1:";";a:1:{s:9:"codepoint";i:978;}}s:1:"l";a:1:{s:1:"o";a:1:{s:1:"n";a:1:{s:1:";";a:1:{s:9:"codepoint";i:965;}}}}}}s:1:"u";a:1:{s:1:"p";a:1:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:"r";a:1:{s:1:"o";a:1:{s:1:"w";a:1:{s:1:"s";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8648;}}}}}}}}}}s:1:"r";a:3:{s:1:"c";a:2:{s:1:"o";a:1:{s:1:"r";a:1:{s:1:"n";a:2:{s:1:";";a:1:{s:9:"codepoint";i:8989;}s:1:"e";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8989;}}}}}}s:1:"r";a:1:{s:1:"o";a:1:{s:1:"p";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8974;}}}}}s:1:"i";a:1:{s:1:"n";a:1:{s:1:"g";a:1:{s:1:";";a:1:{s:9:"codepoint";i:367;}}}}s:1:"t";a:1:{s:1:"r";a:1:{s:1:"i";a:1:{s:1:";";a:1:{s:9:"codepoint";i:9721;}}}}}s:1:"s";a:1:{s:1:"c";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:120010;}}}}s:1:"t";a:3:{s:1:"d";a:1:{s:1:"o";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8944;}}}}s:1:"i";a:1:{s:1:"l";a:1:{s:1:"d";a:1:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:361;}}}}}s:1:"r";a:1:{s:1:"i";a:2:{s:1:";";a:1:{s:9:"codepoint";i:9653;}s:1:"f";a:1:{s:1:";";a:1:{s:9:"codepoint";i:9652;}}}}}s:1:"u";a:2:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8648;}}}}s:1:"m";a:1:{s:1:"l";a:2:{s:1:";";a:1:{s:9:"codepoint";i:252;}s:9:"codepoint";i:252;}}}s:1:"w";a:1:{s:1:"a";a:1:{s:1:"n";a:1:{s:1:"g";a:1:{s:1:"l";a:1:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10663;}}}}}}}}s:1:"v";a:14:{s:1:"A";a:1:{s:1:"r";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8661;}}}}s:1:"B";a:1:{s:1:"a";a:1:{s:1:"r";a:2:{s:1:";";a:1:{s:9:"codepoint";i:10984;}s:1:"v";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10985;}}}}}s:1:"D";a:1:{s:1:"a";a:1:{s:1:"s";a:1:{s:1:"h";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8872;}}}}}s:1:"a";a:2:{s:1:"n";a:1:{s:1:"g";a:1:{s:1:"r";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10652;}}}}}s:1:"r";a:7:{s:1:"e";a:1:{s:1:"p";a:1:{s:1:"s";a:1:{s:1:"i";a:1:{s:1:"l";a:1:{s:1:"o";a:1:{s:1:"n";a:1:{s:1:";";a:1:{s:9:"codepoint";i:949;}}}}}}}}s:1:"k";a:1:{s:1:"a";a:1:{s:1:"p";a:1:{s:1:"p";a:1:{s:1:"a";a:1:{s:1:";";a:1:{s:9:"codepoint";i:1008;}}}}}}s:1:"n";a:1:{s:1:"o";a:1:{s:1:"t";a:1:{s:1:"h";a:1:{s:1:"i";a:1:{s:1:"n";a:1:{s:1:"g";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8709;}}}}}}}}s:1:"p";a:3:{s:1:"h";a:1:{s:1:"i";a:1:{s:1:";";a:1:{s:9:"codepoint";i:966;}}}s:1:"i";a:1:{s:1:";";a:1:{s:9:"codepoint";i:982;}}s:1:"r";a:1:{s:1:"o";a:1:{s:1:"p";a:1:{s:1:"t";a:1:{s:1:"o";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8733;}}}}}}}s:1:"r";a:2:{s:1:";";a:1:{s:9:"codepoint";i:8597;}s:1:"h";a:1:{s:1:"o";a:1:{s:1:";";a:1:{s:9:"codepoint";i:1009;}}}}s:1:"s";a:1:{s:1:"i";a:1:{s:1:"g";a:1:{s:1:"m";a:1:{s:1:"a";a:1:{s:1:";";a:1:{s:9:"codepoint";i:962;}}}}}}s:1:"t";a:2:{s:1:"h";a:1:{s:1:"e";a:1:{s:1:"t";a:1:{s:1:"a";a:1:{s:1:";";a:1:{s:9:"codepoint";i:977;}}}}}s:1:"r";a:1:{s:1:"i";a:1:{s:1:"a";a:1:{s:1:"n";a:1:{s:1:"g";a:1:{s:1:"l";a:1:{s:1:"e";a:2:{s:1:"l";a:1:{s:1:"e";a:1:{s:1:"f";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8882;}}}}}s:1:"r";a:1:{s:1:"i";a:1:{s:1:"g";a:1:{s:1:"h";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8883;}}}}}}}}}}}}}}}}s:1:"c";a:1:{s:1:"y";a:1:{s:1:";";a:1:{s:9:"codepoint";i:1074;}}}s:1:"d";a:1:{s:1:"a";a:1:{s:1:"s";a:1:{s:1:"h";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8866;}}}}}s:1:"e";a:3:{s:1:"e";a:3:{s:1:";";a:1:{s:9:"codepoint";i:8744;}s:1:"b";a:1:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8891;}}}}s:1:"e";a:1:{s:1:"q";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8794;}}}}s:1:"l";a:1:{s:1:"l";a:1:{s:1:"i";a:1:{s:1:"p";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8942;}}}}}s:1:"r";a:2:{s:1:"b";a:1:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:124;}}}}s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:124;}}}}s:1:"f";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:120115;}}}s:1:"l";a:1:{s:1:"t";a:1:{s:1:"r";a:1:{s:1:"i";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8882;}}}}}s:1:"o";a:1:{s:1:"p";a:1:{s:1:"f";a:1:{s:1:";";a:1:{s:9:"codepoint";i:120167;}}}}s:1:"p";a:1:{s:1:"r";a:1:{s:1:"o";a:1:{s:1:"p";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8733;}}}}}s:1:"r";a:1:{s:1:"t";a:1:{s:1:"r";a:1:{s:1:"i";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8883;}}}}}s:1:"s";a:1:{s:1:"c";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:120011;}}}}s:1:"z";a:1:{s:1:"i";a:1:{s:1:"g";a:1:{s:1:"z";a:1:{s:1:"a";a:1:{s:1:"g";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10650;}}}}}}}}s:1:"w";a:7:{s:1:"c";a:1:{s:1:"i";a:1:{s:1:"r";a:1:{s:1:"c";a:1:{s:1:";";a:1:{s:9:"codepoint";i:373;}}}}}s:1:"e";a:2:{s:1:"d";a:2:{s:1:"b";a:1:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10847;}}}}s:1:"g";a:1:{s:1:"e";a:2:{s:1:";";a:1:{s:9:"codepoint";i:8743;}s:1:"q";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8793;}}}}}s:1:"i";a:1:{s:1:"e";a:1:{s:1:"r";a:1:{s:1:"p";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8472;}}}}}}s:1:"f";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:120116;}}}s:1:"o";a:1:{s:1:"p";a:1:{s:1:"f";a:1:{s:1:";";a:1:{s:9:"codepoint";i:120168;}}}}s:1:"p";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8472;}}s:1:"r";a:2:{s:1:";";a:1:{s:9:"codepoint";i:8768;}s:1:"e";a:1:{s:1:"a";a:1:{s:1:"t";a:1:{s:1:"h";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8768;}}}}}}s:1:"s";a:1:{s:1:"c";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:120012;}}}}}s:1:"x";a:14:{s:1:"c";a:3:{s:1:"a";a:1:{s:1:"p";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8898;}}}s:1:"i";a:1:{s:1:"r";a:1:{s:1:"c";a:1:{s:1:";";a:1:{s:9:"codepoint";i:9711;}}}}s:1:"u";a:1:{s:1:"p";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8899;}}}}s:1:"d";a:1:{s:1:"t";a:1:{s:1:"r";a:1:{s:1:"i";a:1:{s:1:";";a:1:{s:9:"codepoint";i:9661;}}}}}s:1:"f";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:120117;}}}s:1:"h";a:2:{s:1:"A";a:1:{s:1:"r";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10234;}}}}s:1:"a";a:1:{s:1:"r";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10231;}}}}}s:1:"i";a:1:{s:1:";";a:1:{s:9:"codepoint";i:958;}}s:1:"l";a:2:{s:1:"A";a:1:{s:1:"r";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10232;}}}}s:1:"a";a:1:{s:1:"r";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10229;}}}}}s:1:"m";a:1:{s:1:"a";a:1:{s:1:"p";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10236;}}}}s:1:"n";a:1:{s:1:"i";a:1:{s:1:"s";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8955;}}}}s:1:"o";a:3:{s:1:"d";a:1:{s:1:"o";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10752;}}}}s:1:"p";a:2:{s:1:"f";a:1:{s:1:";";a:1:{s:9:"codepoint";i:120169;}}s:1:"l";a:1:{s:1:"u";a:1:{s:1:"s";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10753;}}}}}s:1:"t";a:1:{s:1:"i";a:1:{s:1:"m";a:1:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10754;}}}}}}s:1:"r";a:2:{s:1:"A";a:1:{s:1:"r";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10233;}}}}s:1:"a";a:1:{s:1:"r";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10230;}}}}}s:1:"s";a:2:{s:1:"c";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:120013;}}}s:1:"q";a:1:{s:1:"c";a:1:{s:1:"u";a:1:{s:1:"p";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10758;}}}}}}s:1:"u";a:2:{s:1:"p";a:1:{s:1:"l";a:1:{s:1:"u";a:1:{s:1:"s";a:1:{s:1:";";a:1:{s:9:"codepoint";i:10756;}}}}}s:1:"t";a:1:{s:1:"r";a:1:{s:1:"i";a:1:{s:1:";";a:1:{s:9:"codepoint";i:9651;}}}}}s:1:"v";a:1:{s:1:"e";a:1:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8897;}}}}s:1:"w";a:1:{s:1:"e";a:1:{s:1:"d";a:1:{s:1:"g";a:1:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8896;}}}}}}}s:1:"y";a:8:{s:1:"a";a:1:{s:1:"c";a:2:{s:1:"u";a:1:{s:1:"t";a:1:{s:1:"e";a:2:{s:1:";";a:1:{s:9:"codepoint";i:253;}s:9:"codepoint";i:253;}}}s:1:"y";a:1:{s:1:";";a:1:{s:9:"codepoint";i:1103;}}}}s:1:"c";a:2:{s:1:"i";a:1:{s:1:"r";a:1:{s:1:"c";a:1:{s:1:";";a:1:{s:9:"codepoint";i:375;}}}}s:1:"y";a:1:{s:1:";";a:1:{s:9:"codepoint";i:1099;}}}s:1:"e";a:1:{s:1:"n";a:2:{s:1:";";a:1:{s:9:"codepoint";i:165;}s:9:"codepoint";i:165;}}s:1:"f";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:120118;}}}s:1:"i";a:1:{s:1:"c";a:1:{s:1:"y";a:1:{s:1:";";a:1:{s:9:"codepoint";i:1111;}}}}s:1:"o";a:1:{s:1:"p";a:1:{s:1:"f";a:1:{s:1:";";a:1:{s:9:"codepoint";i:120170;}}}}s:1:"s";a:1:{s:1:"c";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:120014;}}}}s:1:"u";a:2:{s:1:"c";a:1:{s:1:"y";a:1:{s:1:";";a:1:{s:9:"codepoint";i:1102;}}}s:1:"m";a:1:{s:1:"l";a:2:{s:1:";";a:1:{s:9:"codepoint";i:255;}s:9:"codepoint";i:255;}}}}s:1:"z";a:10:{s:1:"a";a:1:{s:1:"c";a:1:{s:1:"u";a:1:{s:1:"t";a:1:{s:1:"e";a:1:{s:1:";";a:1:{s:9:"codepoint";i:378;}}}}}}s:1:"c";a:2:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:"o";a:1:{s:1:"n";a:1:{s:1:";";a:1:{s:9:"codepoint";i:382;}}}}}s:1:"y";a:1:{s:1:";";a:1:{s:9:"codepoint";i:1079;}}}s:1:"d";a:1:{s:1:"o";a:1:{s:1:"t";a:1:{s:1:";";a:1:{s:9:"codepoint";i:380;}}}}s:1:"e";a:2:{s:1:"e";a:1:{s:1:"t";a:1:{s:1:"r";a:1:{s:1:"f";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8488;}}}}}s:1:"t";a:1:{s:1:"a";a:1:{s:1:";";a:1:{s:9:"codepoint";i:950;}}}}s:1:"f";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:120119;}}}s:1:"h";a:1:{s:1:"c";a:1:{s:1:"y";a:1:{s:1:";";a:1:{s:9:"codepoint";i:1078;}}}}s:1:"i";a:1:{s:1:"g";a:1:{s:1:"r";a:1:{s:1:"a";a:1:{s:1:"r";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8669;}}}}}}}s:1:"o";a:1:{s:1:"p";a:1:{s:1:"f";a:1:{s:1:";";a:1:{s:9:"codepoint";i:120171;}}}}s:1:"s";a:1:{s:1:"c";a:1:{s:1:"r";a:1:{s:1:";";a:1:{s:9:"codepoint";i:120015;}}}}s:1:"w";a:2:{s:1:"j";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8205;}}s:1:"n";a:1:{s:1:"j";a:1:{s:1:";";a:1:{s:9:"codepoint";i:8204;}}}}}} \ No newline at end of file diff --git a/lib/dompdf/lib/php-font-lib/maps/adobe-standard-encoding.map b/lib/dompdf/lib/php-font-lib/maps/adobe-standard-encoding.map new file mode 100644 index 0000000..230d4a1 --- /dev/null +++ b/lib/dompdf/lib/php-font-lib/maps/adobe-standard-encoding.map @@ -0,0 +1,231 @@ +// Adobe Standard Encoding table for ttf2pt1 +// Thomas Henlich"; + return $this->_font_family = $font; + } + + throw new Exception("Unable to find a suitable font replacement for: '" . $this->_props["font_family"] . "'"); + + } + + /** + * Returns the resolved font size, in points + * + * @link http://www.w3.org/TR/CSS21/fonts.html#propdef-font-size + * @return float + */ + function get_font_size() + { + + if ($this->__font_size_calculated) { + return $this->_props["font_size"]; + } + + if (!isset($this->_props["font_size"])) { + $fs = self::$_defaults["font_size"]; + } else { + $fs = $this->_props["font_size"]; + } + + if (!isset($this->_parent_font_size)) { + $this->_parent_font_size = self::$default_font_size; + } + + switch ((string)$fs) { + case "xx-small": + case "x-small": + case "small": + case "medium": + case "large": + case "x-large": + case "xx-large": + $fs = self::$default_font_size * self::$font_size_keywords[$fs]; + break; + + case "smaller": + $fs = 8 / 9 * $this->_parent_font_size; + break; + + case "larger": + $fs = 6 / 5 * $this->_parent_font_size; + break; + + default: + break; + } + + // Ensure relative sizes resolve to something + if (($i = mb_strpos($fs, "em")) !== false) { + $fs = (float)mb_substr($fs, 0, $i) * $this->_parent_font_size; + } else if (($i = mb_strpos($fs, "ex")) !== false) { + $fs = (float)mb_substr($fs, 0, $i) * $this->_parent_font_size; + } else { + $fs = (float)$this->length_in_pt($fs); + } + + //see __set and __get, on all assignments clear cache! + $this->_prop_cache["font_size"] = null; + $this->_props["font_size"] = $fs; + $this->__font_size_calculated = true; + return $this->_props["font_size"]; + + } + + /** + * @link http://www.w3.org/TR/CSS21/text.html#propdef-word-spacing + * @return float + */ + function get_word_spacing() + { + if ($this->_props["word_spacing"] === "normal") { + return 0; + } + + return $this->_props["word_spacing"]; + } + + /** + * @link http://www.w3.org/TR/CSS21/text.html#propdef-letter-spacing + * @return float + */ + function get_letter_spacing() + { + if ($this->_props["letter_spacing"] === "normal") { + return 0; + } + + return $this->_props["letter_spacing"]; + } + + /** + * @link http://www.w3.org/TR/CSS21/visudet.html#propdef-line-height + * @return float + */ + function get_line_height() + { + if (array_key_exists("line_height", $this->_props) === false) + { + $this->_props["line_height"] = self::$_defaults["line_height"]; + } + $line_height = $this->_props["line_height"]; + + if ($line_height === "normal") { + return self::$default_line_height * $this->get_font_size(); + } + + if (is_numeric($line_height)) { + return $this->length_in_pt($line_height . "em", $this->get_font_size()); + } + + return $this->length_in_pt($line_height, $this->_parent_font_size); + } + + /** + * Returns the color as an array + * + * The array has the following format: + *+ +=20 U+0020 SPACE +=21 U+0021 EXCLAMATION MARK +=22 U+0022 QUOTATION MARK +=23 U+0023 NUMBER SIGN +=24 U+0024 DOLLAR SIGN +=25 U+0025 PERCENT SIGN +=26 U+0026 AMPERSAND +=27 U+2019 RIGHT SINGLE QUOTATION MARK +=28 U+0028 LEFT PARENTHESIS +=29 U+0029 RIGHT PARENTHESIS +=2A U+002A ASTERISK +=2B U+002B PLUS SIGN +=2C U+002C COMMA +=2D U+002D HYPHEN-MINUS +=2E U+002E FULL STOP +=2F U+002F SOLIDUS +=30 U+0030 DIGIT ZERO +=31 U+0031 DIGIT ONE +=32 U+0032 DIGIT TWO +=33 U+0033 DIGIT THREE +=34 U+0034 DIGIT FOUR +=35 U+0035 DIGIT FIVE +=36 U+0036 DIGIT SIX +=37 U+0037 DIGIT SEVEN +=38 U+0038 DIGIT EIGHT +=39 U+0039 DIGIT NINE +=3A U+003A COLON +=3B U+003B SEMICOLON +=3C U+003C LESS-THAN SIGN +=3D U+003D EQUALS SIGN +=3E U+003E GREATER-THAN SIGN +=3F U+003F QUESTION MARK +=40 U+0040 COMMERCIAL AT +=41 U+0041 LATIN CAPITAL LETTER A +=42 U+0042 LATIN CAPITAL LETTER B +=43 U+0043 LATIN CAPITAL LETTER C +=44 U+0044 LATIN CAPITAL LETTER D +=45 U+0045 LATIN CAPITAL LETTER E +=46 U+0046 LATIN CAPITAL LETTER F +=47 U+0047 LATIN CAPITAL LETTER G +=48 U+0048 LATIN CAPITAL LETTER H +=49 U+0049 LATIN CAPITAL LETTER I +=4A U+004A LATIN CAPITAL LETTER J +=4B U+004B LATIN CAPITAL LETTER K +=4C U+004C LATIN CAPITAL LETTER L +=4D U+004D LATIN CAPITAL LETTER M +=4E U+004E LATIN CAPITAL LETTER N +=4F U+004F LATIN CAPITAL LETTER O +=50 U+0050 LATIN CAPITAL LETTER P +=51 U+0051 LATIN CAPITAL LETTER Q +=52 U+0052 LATIN CAPITAL LETTER R +=53 U+0053 LATIN CAPITAL LETTER S +=54 U+0054 LATIN CAPITAL LETTER T +=55 U+0055 LATIN CAPITAL LETTER U +=56 U+0056 LATIN CAPITAL LETTER V +=57 U+0057 LATIN CAPITAL LETTER W +=58 U+0058 LATIN CAPITAL LETTER X +=59 U+0059 LATIN CAPITAL LETTER Y +=5A U+005A LATIN CAPITAL LETTER Z +=5B U+005B LEFT SQUARE BRACKET +=5C U+005C REVERSE SOLIDUS +=5D U+005D RIGHT SQUARE BRACKET +=5E U+005E CIRCUMFLEX ACCENT +=5F U+005F LOW LINE +=60 U+2018 LEFT SINGLE QUOTATION MARK +=61 U+0061 LATIN SMALL LETTER A +=62 U+0062 LATIN SMALL LETTER B +=63 U+0063 LATIN SMALL LETTER C +=64 U+0064 LATIN SMALL LETTER D +=65 U+0065 LATIN SMALL LETTER E +=66 U+0066 LATIN SMALL LETTER F +=67 U+0067 LATIN SMALL LETTER G +=68 U+0068 LATIN SMALL LETTER H +=69 U+0069 LATIN SMALL LETTER I +=6A U+006A LATIN SMALL LETTER J +=6B U+006B LATIN SMALL LETTER K +=6C U+006C LATIN SMALL LETTER L +=6D U+006D LATIN SMALL LETTER M +=6E U+006E LATIN SMALL LETTER N +=6F U+006F LATIN SMALL LETTER O +=70 U+0070 LATIN SMALL LETTER P +=71 U+0071 LATIN SMALL LETTER Q +=72 U+0072 LATIN SMALL LETTER R +=73 U+0073 LATIN SMALL LETTER S +=74 U+0074 LATIN SMALL LETTER T +=75 U+0075 LATIN SMALL LETTER U +=76 U+0076 LATIN SMALL LETTER V +=77 U+0077 LATIN SMALL LETTER W +=78 U+0078 LATIN SMALL LETTER X +=79 U+0079 LATIN SMALL LETTER Y +=7A U+007A LATIN SMALL LETTER Z +=7B U+007B LEFT CURLY BRACKET +=7C U+007C VERTICAL LINE +=7D U+007D RIGHT CURLY BRACKET +=7E U+007E TILDE +=A1 U+00A1 INVERTED EXCLAMATION MARK +=A2 U+00A2 CENT SIGN +=A3 U+00A3 POUND SIGN +=A4 U+2044 FRACTION SLASH +=A5 U+00A5 YEN SIGN +=A6 U+0192 LATIN SMALL LETTER F WITH HOOK +=A7 U+00A7 SECTION SIGN +=A8 U+00A4 CURRENCY SIGN +=A9 U+0027 APOSTROPHE +=AA U+201C LEFT DOUBLE QUOTATION MARK +=AB U+00AB LEFT-POINTING DOUBLE ANGLE QUOTATION MARK +=AC U+2039 SINGLE LEFT-POINTING ANGLE QUOTATION MARK +=AD U+203A SINGLE RIGHT-POINTING ANGLE QUOTATION MARK +=AE U+FB01 LATIN SMALL LIGATURE FI +=AF U+FB02 LATIN SMALL LIGATURE FL +=B1 U+2013 EN DASH +=B2 U+2020 DAGGER +=B3 U+2021 DOUBLE DAGGER +=B4 U+00B7 MIDDLE DOT +=B6 U+00B6 PILCROW SIGN +=B7 U+2022 BULLET +=B8 U+201A SINGLE LOW-9 QUOTATION MARK +=B9 U+201E DOUBLE LOW-9 QUOTATION MARK +=BA U+201D RIGHT DOUBLE QUOTATION MARK +=BB U+00BB RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK +=BC U+2026 HORIZONTAL ELLIPSIS +=BD U+2030 PER MILLE SIGN +=BF U+00BF INVERTED QUESTION MARK +=C1 U+0060 GRAVE ACCENT +=C2 U+00B4 ACUTE ACCENT +=C3 U+02C6 MODIFIER LETTER CIRCUMFLEX ACCENT +=C4 U+02DC SMALL TILDE +=C5 U+00AF MACRON +=C6 U+02D8 BREVE +=C7 U+02D9 DOT ABOVE +=C8 U+00A8 DIAERESIS +=CA U+02DA RING ABOVE +=CB U+00B8 CEDILLA +=CD U+02DD DOUBLE ACUTE ACCENT +=CE U+02DB OGONEK +=CF U+02C7 CARON +=D0 U+2014 EM DASH +=E1 U+00C6 LATIN CAPITAL LETTER AE +=E3 U+00AA FEMININE ORDINAL INDICATOR +=E8 U+0141 LATIN CAPITAL LETTER L WITH STROKE +=E9 U+00D8 LATIN CAPITAL LETTER O WITH STROKE +=EA U+0152 LATIN CAPITAL LIGATURE OE +=EB U+00BA MASCULINE ORDINAL INDICATOR +=F1 U+00E6 LATIN SMALL LETTER AE +=F5 U+0131 LATIN SMALL LETTER DOTLESS I +=F8 U+0142 LATIN SMALL LETTER L WITH STROKE +=F9 U+00F8 LATIN SMALL LETTER O WITH STROKE +=FA U+0153 LATIN SMALL LIGATURE OE +=FB U+00DF LATIN SMALL LETTER SHARP S + +// unencoded characters: +=100 U+00E7 LATIN SMALL LETTER C WITH CEDILLA +=101 U+00FF LATIN SMALL LETTER Y WITH DIAERESIS +=102 U+00E3 LATIN SMALL LETTER A WITH TILDE +=103 U+00EE LATIN SMALL LETTER I WITH CIRCUMFLEX +=104 U+00B3 SUPERSCRIPT THREE +=105 U+00EA LATIN SMALL LETTER E WITH CIRCUMFLEX +=106 U+00FE LATIN SMALL LETTER THORN +=107 U+00E8 LATIN SMALL LETTER E WITH GRAVE +=108 U+00B2 SUPERSCRIPT TWO +=109 U+00E9 LATIN SMALL LETTER E WITH ACUTE +=10A U+00F5 LATIN SMALL LETTER O WITH TILDE +=10B U+00C1 LATIN CAPITAL LETTER A WITH ACUTE +=10C U+00F4 LATIN SMALL LETTER O WITH CIRCUMFLEX +=10D U+00FD LATIN SMALL LETTER Y WITH ACUTE +=10E U+00FC LATIN SMALL LETTER U WITH DIAERESIS +=10F U+00BE VULGAR FRACTION THREE QUARTERS +=110 U+00E2 LATIN SMALL LETTER A WITH CIRCUMFLEX +=111 U+00D0 LATIN CAPITAL LETTER ETH +=112 U+00EB LATIN SMALL LETTER E WITH DIAERESIS +=113 U+00F9 LATIN SMALL LETTER U WITH GRAVE +=114 U+2122 TRADE MARK SIGN +=115 U+00F2 LATIN SMALL LETTER O WITH GRAVE +=116 U+0161 LATIN SMALL LETTER S WITH CARON +=117 U+00CF LATIN CAPITAL LETTER I WITH DIAERESIS +=118 U+00FA LATIN SMALL LETTER U WITH ACUTE +=119 U+00E0 LATIN SMALL LETTER A WITH GRAVE +=11A U+00F1 LATIN SMALL LETTER N WITH TILDE +=11B U+00E5 LATIN SMALL LETTER A WITH RING ABOVE +=11C U+017E LATIN SMALL LETTER Z WITH CARON +=11D U+00CE LATIN CAPITAL LETTER I WITH CIRCUMFLEX +=11E U+00D1 LATIN CAPITAL LETTER N WITH TILDE +=11F U+00FB LATIN SMALL LETTER U WITH CIRCUMFLEX +=120 U+00CA LATIN CAPITAL LETTER E WITH CIRCUMFLEX +=121 U+00CD LATIN CAPITAL LETTER I WITH ACUTE +=122 U+00C7 LATIN CAPITAL LETTER C WITH CEDILLA +=123 U+00D6 LATIN CAPITAL LETTER O WITH DIAERESIS +=124 U+0160 LATIN CAPITAL LETTER S WITH CARON +=125 U+00CC LATIN CAPITAL LETTER I WITH GRAVE +=126 U+00E4 LATIN SMALL LETTER A WITH DIAERESIS +=127 U+00D2 LATIN CAPITAL LETTER O WITH GRAVE +=128 U+00C8 LATIN CAPITAL LETTER E WITH GRAVE +=129 U+0178 LATIN CAPITAL LETTER Y WITH DIAERESIS +=12A U+00AE REGISTERED SIGN +=12B U+00D5 LATIN CAPITAL LETTER O WITH TILDE +=12C U+00BC VULGAR FRACTION ONE QUARTER +=12D U+00D9 LATIN CAPITAL LETTER U WITH GRAVE +=12E U+00DB LATIN CAPITAL LETTER U WITH CIRCUMFLEX +=12F U+00DE LATIN CAPITAL LETTER THORN +=130 U+00F7 DIVISION SIGN +=131 U+00C3 LATIN CAPITAL LETTER A WITH TILDE +=132 U+00DA LATIN CAPITAL LETTER U WITH ACUTE +=133 U+00D4 LATIN CAPITAL LETTER O WITH CIRCUMFLEX +=134 U+00AC NOT SIGN +=135 U+00C5 LATIN CAPITAL LETTER A WITH RING ABOVE +=136 U+00EF LATIN SMALL LETTER I WITH DIAERESIS +=137 U+00ED LATIN SMALL LETTER I WITH ACUTE +=138 U+00E1 LATIN SMALL LETTER A WITH ACUTE +=139 U+00B1 PLUS-MINUS SIGN +=13A U+00D7 MULTIPLICATION SIGN +=13B U+00DC LATIN CAPITAL LETTER U WITH DIAERESIS +=13C U+2212 MINUS SIGN +=13D U+00B9 SUPERSCRIPT ONE +=13E U+00C9 LATIN CAPITAL LETTER E WITH ACUTE +=13F U+00C2 LATIN CAPITAL LETTER A WITH CIRCUMFLEX +=140 U+00A9 COPYRIGHT SIGN +=141 U+00C0 LATIN CAPITAL LETTER A WITH GRAVE +=142 U+00F6 LATIN SMALL LETTER O WITH DIAERESIS +=143 U+00F3 LATIN SMALL LETTER O WITH ACUTE +=144 U+00B0 DEGREE SIGN +=145 U+00EC LATIN SMALL LETTER I WITH GRAVE +=146 U+00B5 MICRO SIGN +=147 U+00D3 LATIN CAPITAL LETTER O WITH ACUTE +=148 U+00F0 LATIN SMALL LETTER ETH +=149 U+00C4 LATIN CAPITAL LETTER A WITH DIAERESIS +=14A U+00DD LATIN CAPITAL LETTER Y WITH ACUTE +=14B U+00A6 BROKEN BAR +=14C U+00BD VULGAR FRACTION ONE HALF diff --git a/lib/dompdf/lib/php-font-lib/maps/cp1250.map b/lib/dompdf/lib/php-font-lib/maps/cp1250.map new file mode 100644 index 0000000..ec110af --- /dev/null +++ b/lib/dompdf/lib/php-font-lib/maps/cp1250.map @@ -0,0 +1,251 @@ +!00 U+0000 .notdef +!01 U+0001 .notdef +!02 U+0002 .notdef +!03 U+0003 .notdef +!04 U+0004 .notdef +!05 U+0005 .notdef +!06 U+0006 .notdef +!07 U+0007 .notdef +!08 U+0008 .notdef +!09 U+0009 .notdef +!0A U+000A .notdef +!0B U+000B .notdef +!0C U+000C .notdef +!0D U+000D .notdef +!0E U+000E .notdef +!0F U+000F .notdef +!10 U+0010 .notdef +!11 U+0011 .notdef +!12 U+0012 .notdef +!13 U+0013 .notdef +!14 U+0014 .notdef +!15 U+0015 .notdef +!16 U+0016 .notdef +!17 U+0017 .notdef +!18 U+0018 .notdef +!19 U+0019 .notdef +!1A U+001A .notdef +!1B U+001B .notdef +!1C U+001C .notdef +!1D U+001D .notdef +!1E U+001E .notdef +!1F U+001F .notdef +!20 U+0020 space +!21 U+0021 exclam +!22 U+0022 quotedbl +!23 U+0023 numbersign +!24 U+0024 dollar +!25 U+0025 percent +!26 U+0026 ampersand +!27 U+0027 quotesingle +!28 U+0028 parenleft +!29 U+0029 parenright +!2A U+002A asterisk +!2B U+002B plus +!2C U+002C comma +!2D U+002D hyphen +!2E U+002E period +!2F U+002F slash +!30 U+0030 zero +!31 U+0031 one +!32 U+0032 two +!33 U+0033 three +!34 U+0034 four +!35 U+0035 five +!36 U+0036 six +!37 U+0037 seven +!38 U+0038 eight +!39 U+0039 nine +!3A U+003A colon +!3B U+003B semicolon +!3C U+003C less +!3D U+003D equal +!3E U+003E greater +!3F U+003F question +!40 U+0040 at +!41 U+0041 A +!42 U+0042 B +!43 U+0043 C +!44 U+0044 D +!45 U+0045 E +!46 U+0046 F +!47 U+0047 G +!48 U+0048 H +!49 U+0049 I +!4A U+004A J +!4B U+004B K +!4C U+004C L +!4D U+004D M +!4E U+004E N +!4F U+004F O +!50 U+0050 P +!51 U+0051 Q +!52 U+0052 R +!53 U+0053 S +!54 U+0054 T +!55 U+0055 U +!56 U+0056 V +!57 U+0057 W +!58 U+0058 X +!59 U+0059 Y +!5A U+005A Z +!5B U+005B bracketleft +!5C U+005C backslash +!5D U+005D bracketright +!5E U+005E asciicircum +!5F U+005F underscore +!60 U+0060 grave +!61 U+0061 a +!62 U+0062 b +!63 U+0063 c +!64 U+0064 d +!65 U+0065 e +!66 U+0066 f +!67 U+0067 g +!68 U+0068 h +!69 U+0069 i +!6A U+006A j +!6B U+006B k +!6C U+006C l +!6D U+006D m +!6E U+006E n +!6F U+006F o +!70 U+0070 p +!71 U+0071 q +!72 U+0072 r +!73 U+0073 s +!74 U+0074 t +!75 U+0075 u +!76 U+0076 v +!77 U+0077 w +!78 U+0078 x +!79 U+0079 y +!7A U+007A z +!7B U+007B braceleft +!7C U+007C bar +!7D U+007D braceright +!7E U+007E asciitilde +!7F U+007F .notdef +!80 U+20AC Euro +!82 U+201A quotesinglbase +!84 U+201E quotedblbase +!85 U+2026 ellipsis +!86 U+2020 dagger +!87 U+2021 daggerdbl +!89 U+2030 perthousand +!8A U+0160 Scaron +!8B U+2039 guilsinglleft +!8C U+015A Sacute +!8D U+0164 Tcaron +!8E U+017D Zcaron +!8F U+0179 Zacute +!91 U+2018 quoteleft +!92 U+2019 quoteright +!93 U+201C quotedblleft +!94 U+201D quotedblright +!95 U+2022 bullet +!96 U+2013 endash +!97 U+2014 emdash +!99 U+2122 trademark +!9A U+0161 scaron +!9B U+203A guilsinglright +!9C U+015B sacute +!9D U+0165 tcaron +!9E U+017E zcaron +!9F U+017A zacute +!A0 U+00A0 space +!A1 U+02C7 caron +!A2 U+02D8 breve +!A3 U+0141 Lslash +!A4 U+00A4 currency +!A5 U+0104 Aogonek +!A6 U+00A6 brokenbar +!A7 U+00A7 section +!A8 U+00A8 dieresis +!A9 U+00A9 copyright +!AA U+015E Scedilla +!AB U+00AB guillemotleft +!AC U+00AC logicalnot +!AD U+00AD hyphen +!AE U+00AE registered +!AF U+017B Zdotaccent +!B0 U+00B0 degree +!B1 U+00B1 plusminus +!B2 U+02DB ogonek +!B3 U+0142 lslash +!B4 U+00B4 acute +!B5 U+00B5 mu +!B6 U+00B6 paragraph +!B7 U+00B7 periodcentered +!B8 U+00B8 cedilla +!B9 U+0105 aogonek +!BA U+015F scedilla +!BB U+00BB guillemotright +!BC U+013D Lcaron +!BD U+02DD hungarumlaut +!BE U+013E lcaron +!BF U+017C zdotaccent +!C0 U+0154 Racute +!C1 U+00C1 Aacute +!C2 U+00C2 Acircumflex +!C3 U+0102 Abreve +!C4 U+00C4 Adieresis +!C5 U+0139 Lacute +!C6 U+0106 Cacute +!C7 U+00C7 Ccedilla +!C8 U+010C Ccaron +!C9 U+00C9 Eacute +!CA U+0118 Eogonek +!CB U+00CB Edieresis +!CC U+011A Ecaron +!CD U+00CD Iacute +!CE U+00CE Icircumflex +!CF U+010E Dcaron +!D0 U+0110 Dcroat +!D1 U+0143 Nacute +!D2 U+0147 Ncaron +!D3 U+00D3 Oacute +!D4 U+00D4 Ocircumflex +!D5 U+0150 Ohungarumlaut +!D6 U+00D6 Odieresis +!D7 U+00D7 multiply +!D8 U+0158 Rcaron +!D9 U+016E Uring +!DA U+00DA Uacute +!DB U+0170 Uhungarumlaut +!DC U+00DC Udieresis +!DD U+00DD Yacute +!DE U+0162 Tcommaaccent +!DF U+00DF germandbls +!E0 U+0155 racute +!E1 U+00E1 aacute +!E2 U+00E2 acircumflex +!E3 U+0103 abreve +!E4 U+00E4 adieresis +!E5 U+013A lacute +!E6 U+0107 cacute +!E7 U+00E7 ccedilla +!E8 U+010D ccaron +!E9 U+00E9 eacute +!EA U+0119 eogonek +!EB U+00EB edieresis +!EC U+011B ecaron +!ED U+00ED iacute +!EE U+00EE icircumflex +!EF U+010F dcaron +!F0 U+0111 dcroat +!F1 U+0144 nacute +!F2 U+0148 ncaron +!F3 U+00F3 oacute +!F4 U+00F4 ocircumflex +!F5 U+0151 ohungarumlaut +!F6 U+00F6 odieresis +!F7 U+00F7 divide +!F8 U+0159 rcaron +!F9 U+016F uring +!FA U+00FA uacute +!FB U+0171 uhungarumlaut +!FC U+00FC udieresis +!FD U+00FD yacute +!FE U+0163 tcommaaccent +!FF U+02D9 dotaccent diff --git a/lib/dompdf/lib/php-font-lib/maps/cp1251.map b/lib/dompdf/lib/php-font-lib/maps/cp1251.map new file mode 100644 index 0000000..de6a198 --- /dev/null +++ b/lib/dompdf/lib/php-font-lib/maps/cp1251.map @@ -0,0 +1,255 @@ +!00 U+0000 .notdef +!01 U+0001 .notdef +!02 U+0002 .notdef +!03 U+0003 .notdef +!04 U+0004 .notdef +!05 U+0005 .notdef +!06 U+0006 .notdef +!07 U+0007 .notdef +!08 U+0008 .notdef +!09 U+0009 .notdef +!0A U+000A .notdef +!0B U+000B .notdef +!0C U+000C .notdef +!0D U+000D .notdef +!0E U+000E .notdef +!0F U+000F .notdef +!10 U+0010 .notdef +!11 U+0011 .notdef +!12 U+0012 .notdef +!13 U+0013 .notdef +!14 U+0014 .notdef +!15 U+0015 .notdef +!16 U+0016 .notdef +!17 U+0017 .notdef +!18 U+0018 .notdef +!19 U+0019 .notdef +!1A U+001A .notdef +!1B U+001B .notdef +!1C U+001C .notdef +!1D U+001D .notdef +!1E U+001E .notdef +!1F U+001F .notdef +!20 U+0020 space +!21 U+0021 exclam +!22 U+0022 quotedbl +!23 U+0023 numbersign +!24 U+0024 dollar +!25 U+0025 percent +!26 U+0026 ampersand +!27 U+0027 quotesingle +!28 U+0028 parenleft +!29 U+0029 parenright +!2A U+002A asterisk +!2B U+002B plus +!2C U+002C comma +!2D U+002D hyphen +!2E U+002E period +!2F U+002F slash +!30 U+0030 zero +!31 U+0031 one +!32 U+0032 two +!33 U+0033 three +!34 U+0034 four +!35 U+0035 five +!36 U+0036 six +!37 U+0037 seven +!38 U+0038 eight +!39 U+0039 nine +!3A U+003A colon +!3B U+003B semicolon +!3C U+003C less +!3D U+003D equal +!3E U+003E greater +!3F U+003F question +!40 U+0040 at +!41 U+0041 A +!42 U+0042 B +!43 U+0043 C +!44 U+0044 D +!45 U+0045 E +!46 U+0046 F +!47 U+0047 G +!48 U+0048 H +!49 U+0049 I +!4A U+004A J +!4B U+004B K +!4C U+004C L +!4D U+004D M +!4E U+004E N +!4F U+004F O +!50 U+0050 P +!51 U+0051 Q +!52 U+0052 R +!53 U+0053 S +!54 U+0054 T +!55 U+0055 U +!56 U+0056 V +!57 U+0057 W +!58 U+0058 X +!59 U+0059 Y +!5A U+005A Z +!5B U+005B bracketleft +!5C U+005C backslash +!5D U+005D bracketright +!5E U+005E asciicircum +!5F U+005F underscore +!60 U+0060 grave +!61 U+0061 a +!62 U+0062 b +!63 U+0063 c +!64 U+0064 d +!65 U+0065 e +!66 U+0066 f +!67 U+0067 g +!68 U+0068 h +!69 U+0069 i +!6A U+006A j +!6B U+006B k +!6C U+006C l +!6D U+006D m +!6E U+006E n +!6F U+006F o +!70 U+0070 p +!71 U+0071 q +!72 U+0072 r +!73 U+0073 s +!74 U+0074 t +!75 U+0075 u +!76 U+0076 v +!77 U+0077 w +!78 U+0078 x +!79 U+0079 y +!7A U+007A z +!7B U+007B braceleft +!7C U+007C bar +!7D U+007D braceright +!7E U+007E asciitilde +!7F U+007F .notdef +!80 U+0402 afii10051 +!81 U+0403 afii10052 +!82 U+201A quotesinglbase +!83 U+0453 afii10100 +!84 U+201E quotedblbase +!85 U+2026 ellipsis +!86 U+2020 dagger +!87 U+2021 daggerdbl +!88 U+20AC Euro +!89 U+2030 perthousand +!8A U+0409 afii10058 +!8B U+2039 guilsinglleft +!8C U+040A afii10059 +!8D U+040C afii10061 +!8E U+040B afii10060 +!8F U+040F afii10145 +!90 U+0452 afii10099 +!91 U+2018 quoteleft +!92 U+2019 quoteright +!93 U+201C quotedblleft +!94 U+201D quotedblright +!95 U+2022 bullet +!96 U+2013 endash +!97 U+2014 emdash +!99 U+2122 trademark +!9A U+0459 afii10106 +!9B U+203A guilsinglright +!9C U+045A afii10107 +!9D U+045C afii10109 +!9E U+045B afii10108 +!9F U+045F afii10193 +!A0 U+00A0 space +!A1 U+040E afii10062 +!A2 U+045E afii10110 +!A3 U+0408 afii10057 +!A4 U+00A4 currency +!A5 U+0490 afii10050 +!A6 U+00A6 brokenbar +!A7 U+00A7 section +!A8 U+0401 afii10023 +!A9 U+00A9 copyright +!AA U+0404 afii10053 +!AB U+00AB guillemotleft +!AC U+00AC logicalnot +!AD U+00AD hyphen +!AE U+00AE registered +!AF U+0407 afii10056 +!B0 U+00B0 degree +!B1 U+00B1 plusminus +!B2 U+0406 afii10055 +!B3 U+0456 afii10103 +!B4 U+0491 afii10098 +!B5 U+00B5 mu +!B6 U+00B6 paragraph +!B7 U+00B7 periodcentered +!B8 U+0451 afii10071 +!B9 U+2116 afii61352 +!BA U+0454 afii10101 +!BB U+00BB guillemotright +!BC U+0458 afii10105 +!BD U+0405 afii10054 +!BE U+0455 afii10102 +!BF U+0457 afii10104 +!C0 U+0410 afii10017 +!C1 U+0411 afii10018 +!C2 U+0412 afii10019 +!C3 U+0413 afii10020 +!C4 U+0414 afii10021 +!C5 U+0415 afii10022 +!C6 U+0416 afii10024 +!C7 U+0417 afii10025 +!C8 U+0418 afii10026 +!C9 U+0419 afii10027 +!CA U+041A afii10028 +!CB U+041B afii10029 +!CC U+041C afii10030 +!CD U+041D afii10031 +!CE U+041E afii10032 +!CF U+041F afii10033 +!D0 U+0420 afii10034 +!D1 U+0421 afii10035 +!D2 U+0422 afii10036 +!D3 U+0423 afii10037 +!D4 U+0424 afii10038 +!D5 U+0425 afii10039 +!D6 U+0426 afii10040 +!D7 U+0427 afii10041 +!D8 U+0428 afii10042 +!D9 U+0429 afii10043 +!DA U+042A afii10044 +!DB U+042B afii10045 +!DC U+042C afii10046 +!DD U+042D afii10047 +!DE U+042E afii10048 +!DF U+042F afii10049 +!E0 U+0430 afii10065 +!E1 U+0431 afii10066 +!E2 U+0432 afii10067 +!E3 U+0433 afii10068 +!E4 U+0434 afii10069 +!E5 U+0435 afii10070 +!E6 U+0436 afii10072 +!E7 U+0437 afii10073 +!E8 U+0438 afii10074 +!E9 U+0439 afii10075 +!EA U+043A afii10076 +!EB U+043B afii10077 +!EC U+043C afii10078 +!ED U+043D afii10079 +!EE U+043E afii10080 +!EF U+043F afii10081 +!F0 U+0440 afii10082 +!F1 U+0441 afii10083 +!F2 U+0442 afii10084 +!F3 U+0443 afii10085 +!F4 U+0444 afii10086 +!F5 U+0445 afii10087 +!F6 U+0446 afii10088 +!F7 U+0447 afii10089 +!F8 U+0448 afii10090 +!F9 U+0449 afii10091 +!FA U+044A afii10092 +!FB U+044B afii10093 +!FC U+044C afii10094 +!FD U+044D afii10095 +!FE U+044E afii10096 +!FF U+044F afii10097 diff --git a/lib/dompdf/lib/php-font-lib/maps/cp1252.map b/lib/dompdf/lib/php-font-lib/maps/cp1252.map new file mode 100644 index 0000000..dd490e5 --- /dev/null +++ b/lib/dompdf/lib/php-font-lib/maps/cp1252.map @@ -0,0 +1,251 @@ +!00 U+0000 .notdef +!01 U+0001 .notdef +!02 U+0002 .notdef +!03 U+0003 .notdef +!04 U+0004 .notdef +!05 U+0005 .notdef +!06 U+0006 .notdef +!07 U+0007 .notdef +!08 U+0008 .notdef +!09 U+0009 .notdef +!0A U+000A .notdef +!0B U+000B .notdef +!0C U+000C .notdef +!0D U+000D .notdef +!0E U+000E .notdef +!0F U+000F .notdef +!10 U+0010 .notdef +!11 U+0011 .notdef +!12 U+0012 .notdef +!13 U+0013 .notdef +!14 U+0014 .notdef +!15 U+0015 .notdef +!16 U+0016 .notdef +!17 U+0017 .notdef +!18 U+0018 .notdef +!19 U+0019 .notdef +!1A U+001A .notdef +!1B U+001B .notdef +!1C U+001C .notdef +!1D U+001D .notdef +!1E U+001E .notdef +!1F U+001F .notdef +!20 U+0020 space +!21 U+0021 exclam +!22 U+0022 quotedbl +!23 U+0023 numbersign +!24 U+0024 dollar +!25 U+0025 percent +!26 U+0026 ampersand +!27 U+0027 quotesingle +!28 U+0028 parenleft +!29 U+0029 parenright +!2A U+002A asterisk +!2B U+002B plus +!2C U+002C comma +!2D U+002D hyphen +!2E U+002E period +!2F U+002F slash +!30 U+0030 zero +!31 U+0031 one +!32 U+0032 two +!33 U+0033 three +!34 U+0034 four +!35 U+0035 five +!36 U+0036 six +!37 U+0037 seven +!38 U+0038 eight +!39 U+0039 nine +!3A U+003A colon +!3B U+003B semicolon +!3C U+003C less +!3D U+003D equal +!3E U+003E greater +!3F U+003F question +!40 U+0040 at +!41 U+0041 A +!42 U+0042 B +!43 U+0043 C +!44 U+0044 D +!45 U+0045 E +!46 U+0046 F +!47 U+0047 G +!48 U+0048 H +!49 U+0049 I +!4A U+004A J +!4B U+004B K +!4C U+004C L +!4D U+004D M +!4E U+004E N +!4F U+004F O +!50 U+0050 P +!51 U+0051 Q +!52 U+0052 R +!53 U+0053 S +!54 U+0054 T +!55 U+0055 U +!56 U+0056 V +!57 U+0057 W +!58 U+0058 X +!59 U+0059 Y +!5A U+005A Z +!5B U+005B bracketleft +!5C U+005C backslash +!5D U+005D bracketright +!5E U+005E asciicircum +!5F U+005F underscore +!60 U+0060 grave +!61 U+0061 a +!62 U+0062 b +!63 U+0063 c +!64 U+0064 d +!65 U+0065 e +!66 U+0066 f +!67 U+0067 g +!68 U+0068 h +!69 U+0069 i +!6A U+006A j +!6B U+006B k +!6C U+006C l +!6D U+006D m +!6E U+006E n +!6F U+006F o +!70 U+0070 p +!71 U+0071 q +!72 U+0072 r +!73 U+0073 s +!74 U+0074 t +!75 U+0075 u +!76 U+0076 v +!77 U+0077 w +!78 U+0078 x +!79 U+0079 y +!7A U+007A z +!7B U+007B braceleft +!7C U+007C bar +!7D U+007D braceright +!7E U+007E asciitilde +!7F U+007F .notdef +!80 U+20AC Euro +!82 U+201A quotesinglbase +!83 U+0192 florin +!84 U+201E quotedblbase +!85 U+2026 ellipsis +!86 U+2020 dagger +!87 U+2021 daggerdbl +!88 U+02C6 circumflex +!89 U+2030 perthousand +!8A U+0160 Scaron +!8B U+2039 guilsinglleft +!8C U+0152 OE +!8E U+017D Zcaron +!91 U+2018 quoteleft +!92 U+2019 quoteright +!93 U+201C quotedblleft +!94 U+201D quotedblright +!95 U+2022 bullet +!96 U+2013 endash +!97 U+2014 emdash +!98 U+02DC tilde +!99 U+2122 trademark +!9A U+0161 scaron +!9B U+203A guilsinglright +!9C U+0153 oe +!9E U+017E zcaron +!9F U+0178 Ydieresis +!A0 U+00A0 space +!A1 U+00A1 exclamdown +!A2 U+00A2 cent +!A3 U+00A3 sterling +!A4 U+00A4 currency +!A5 U+00A5 yen +!A6 U+00A6 brokenbar +!A7 U+00A7 section +!A8 U+00A8 dieresis +!A9 U+00A9 copyright +!AA U+00AA ordfeminine +!AB U+00AB guillemotleft +!AC U+00AC logicalnot +!AD U+00AD hyphen +!AE U+00AE registered +!AF U+00AF macron +!B0 U+00B0 degree +!B1 U+00B1 plusminus +!B2 U+00B2 twosuperior +!B3 U+00B3 threesuperior +!B4 U+00B4 acute +!B5 U+00B5 mu +!B6 U+00B6 paragraph +!B7 U+00B7 periodcentered +!B8 U+00B8 cedilla +!B9 U+00B9 onesuperior +!BA U+00BA ordmasculine +!BB U+00BB guillemotright +!BC U+00BC onequarter +!BD U+00BD onehalf +!BE U+00BE threequarters +!BF U+00BF questiondown +!C0 U+00C0 Agrave +!C1 U+00C1 Aacute +!C2 U+00C2 Acircumflex +!C3 U+00C3 Atilde +!C4 U+00C4 Adieresis +!C5 U+00C5 Aring +!C6 U+00C6 AE +!C7 U+00C7 Ccedilla +!C8 U+00C8 Egrave +!C9 U+00C9 Eacute +!CA U+00CA Ecircumflex +!CB U+00CB Edieresis +!CC U+00CC Igrave +!CD U+00CD Iacute +!CE U+00CE Icircumflex +!CF U+00CF Idieresis +!D0 U+00D0 Eth +!D1 U+00D1 Ntilde +!D2 U+00D2 Ograve +!D3 U+00D3 Oacute +!D4 U+00D4 Ocircumflex +!D5 U+00D5 Otilde +!D6 U+00D6 Odieresis +!D7 U+00D7 multiply +!D8 U+00D8 Oslash +!D9 U+00D9 Ugrave +!DA U+00DA Uacute +!DB U+00DB Ucircumflex +!DC U+00DC Udieresis +!DD U+00DD Yacute +!DE U+00DE Thorn +!DF U+00DF germandbls +!E0 U+00E0 agrave +!E1 U+00E1 aacute +!E2 U+00E2 acircumflex +!E3 U+00E3 atilde +!E4 U+00E4 adieresis +!E5 U+00E5 aring +!E6 U+00E6 ae +!E7 U+00E7 ccedilla +!E8 U+00E8 egrave +!E9 U+00E9 eacute +!EA U+00EA ecircumflex +!EB U+00EB edieresis +!EC U+00EC igrave +!ED U+00ED iacute +!EE U+00EE icircumflex +!EF U+00EF idieresis +!F0 U+00F0 eth +!F1 U+00F1 ntilde +!F2 U+00F2 ograve +!F3 U+00F3 oacute +!F4 U+00F4 ocircumflex +!F5 U+00F5 otilde +!F6 U+00F6 odieresis +!F7 U+00F7 divide +!F8 U+00F8 oslash +!F9 U+00F9 ugrave +!FA U+00FA uacute +!FB U+00FB ucircumflex +!FC U+00FC udieresis +!FD U+00FD yacute +!FE U+00FE thorn +!FF U+00FF ydieresis diff --git a/lib/dompdf/lib/php-font-lib/maps/cp1253.map b/lib/dompdf/lib/php-font-lib/maps/cp1253.map new file mode 100644 index 0000000..4bd826f --- /dev/null +++ b/lib/dompdf/lib/php-font-lib/maps/cp1253.map @@ -0,0 +1,239 @@ +!00 U+0000 .notdef +!01 U+0001 .notdef +!02 U+0002 .notdef +!03 U+0003 .notdef +!04 U+0004 .notdef +!05 U+0005 .notdef +!06 U+0006 .notdef +!07 U+0007 .notdef +!08 U+0008 .notdef +!09 U+0009 .notdef +!0A U+000A .notdef +!0B U+000B .notdef +!0C U+000C .notdef +!0D U+000D .notdef +!0E U+000E .notdef +!0F U+000F .notdef +!10 U+0010 .notdef +!11 U+0011 .notdef +!12 U+0012 .notdef +!13 U+0013 .notdef +!14 U+0014 .notdef +!15 U+0015 .notdef +!16 U+0016 .notdef +!17 U+0017 .notdef +!18 U+0018 .notdef +!19 U+0019 .notdef +!1A U+001A .notdef +!1B U+001B .notdef +!1C U+001C .notdef +!1D U+001D .notdef +!1E U+001E .notdef +!1F U+001F .notdef +!20 U+0020 space +!21 U+0021 exclam +!22 U+0022 quotedbl +!23 U+0023 numbersign +!24 U+0024 dollar +!25 U+0025 percent +!26 U+0026 ampersand +!27 U+0027 quotesingle +!28 U+0028 parenleft +!29 U+0029 parenright +!2A U+002A asterisk +!2B U+002B plus +!2C U+002C comma +!2D U+002D hyphen +!2E U+002E period +!2F U+002F slash +!30 U+0030 zero +!31 U+0031 one +!32 U+0032 two +!33 U+0033 three +!34 U+0034 four +!35 U+0035 five +!36 U+0036 six +!37 U+0037 seven +!38 U+0038 eight +!39 U+0039 nine +!3A U+003A colon +!3B U+003B semicolon +!3C U+003C less +!3D U+003D equal +!3E U+003E greater +!3F U+003F question +!40 U+0040 at +!41 U+0041 A +!42 U+0042 B +!43 U+0043 C +!44 U+0044 D +!45 U+0045 E +!46 U+0046 F +!47 U+0047 G +!48 U+0048 H +!49 U+0049 I +!4A U+004A J +!4B U+004B K +!4C U+004C L +!4D U+004D M +!4E U+004E N +!4F U+004F O +!50 U+0050 P +!51 U+0051 Q +!52 U+0052 R +!53 U+0053 S +!54 U+0054 T +!55 U+0055 U +!56 U+0056 V +!57 U+0057 W +!58 U+0058 X +!59 U+0059 Y +!5A U+005A Z +!5B U+005B bracketleft +!5C U+005C backslash +!5D U+005D bracketright +!5E U+005E asciicircum +!5F U+005F underscore +!60 U+0060 grave +!61 U+0061 a +!62 U+0062 b +!63 U+0063 c +!64 U+0064 d +!65 U+0065 e +!66 U+0066 f +!67 U+0067 g +!68 U+0068 h +!69 U+0069 i +!6A U+006A j +!6B U+006B k +!6C U+006C l +!6D U+006D m +!6E U+006E n +!6F U+006F o +!70 U+0070 p +!71 U+0071 q +!72 U+0072 r +!73 U+0073 s +!74 U+0074 t +!75 U+0075 u +!76 U+0076 v +!77 U+0077 w +!78 U+0078 x +!79 U+0079 y +!7A U+007A z +!7B U+007B braceleft +!7C U+007C bar +!7D U+007D braceright +!7E U+007E asciitilde +!7F U+007F .notdef +!80 U+20AC Euro +!82 U+201A quotesinglbase +!83 U+0192 florin +!84 U+201E quotedblbase +!85 U+2026 ellipsis +!86 U+2020 dagger +!87 U+2021 daggerdbl +!89 U+2030 perthousand +!8B U+2039 guilsinglleft +!91 U+2018 quoteleft +!92 U+2019 quoteright +!93 U+201C quotedblleft +!94 U+201D quotedblright +!95 U+2022 bullet +!96 U+2013 endash +!97 U+2014 emdash +!99 U+2122 trademark +!9B U+203A guilsinglright +!A0 U+00A0 space +!A1 U+0385 dieresistonos +!A2 U+0386 Alphatonos +!A3 U+00A3 sterling +!A4 U+00A4 currency +!A5 U+00A5 yen +!A6 U+00A6 brokenbar +!A7 U+00A7 section +!A8 U+00A8 dieresis +!A9 U+00A9 copyright +!AB U+00AB guillemotleft +!AC U+00AC logicalnot +!AD U+00AD hyphen +!AE U+00AE registered +!AF U+2015 afii00208 +!B0 U+00B0 degree +!B1 U+00B1 plusminus +!B2 U+00B2 twosuperior +!B3 U+00B3 threesuperior +!B4 U+0384 tonos +!B5 U+00B5 mu +!B6 U+00B6 paragraph +!B7 U+00B7 periodcentered +!B8 U+0388 Epsilontonos +!B9 U+0389 Etatonos +!BA U+038A Iotatonos +!BB U+00BB guillemotright +!BC U+038C Omicrontonos +!BD U+00BD onehalf +!BE U+038E Upsilontonos +!BF U+038F Omegatonos +!C0 U+0390 iotadieresistonos +!C1 U+0391 Alpha +!C2 U+0392 Beta +!C3 U+0393 Gamma +!C4 U+0394 Delta +!C5 U+0395 Epsilon +!C6 U+0396 Zeta +!C7 U+0397 Eta +!C8 U+0398 Theta +!C9 U+0399 Iota +!CA U+039A Kappa +!CB U+039B Lambda +!CC U+039C Mu +!CD U+039D Nu +!CE U+039E Xi +!CF U+039F Omicron +!D0 U+03A0 Pi +!D1 U+03A1 Rho +!D3 U+03A3 Sigma +!D4 U+03A4 Tau +!D5 U+03A5 Upsilon +!D6 U+03A6 Phi +!D7 U+03A7 Chi +!D8 U+03A8 Psi +!D9 U+03A9 Omega +!DA U+03AA Iotadieresis +!DB U+03AB Upsilondieresis +!DC U+03AC alphatonos +!DD U+03AD epsilontonos +!DE U+03AE etatonos +!DF U+03AF iotatonos +!E0 U+03B0 upsilondieresistonos +!E1 U+03B1 alpha +!E2 U+03B2 beta +!E3 U+03B3 gamma +!E4 U+03B4 delta +!E5 U+03B5 epsilon +!E6 U+03B6 zeta +!E7 U+03B7 eta +!E8 U+03B8 theta +!E9 U+03B9 iota +!EA U+03BA kappa +!EB U+03BB lambda +!EC U+03BC mu +!ED U+03BD nu +!EE U+03BE xi +!EF U+03BF omicron +!F0 U+03C0 pi +!F1 U+03C1 rho +!F2 U+03C2 sigma1 +!F3 U+03C3 sigma +!F4 U+03C4 tau +!F5 U+03C5 upsilon +!F6 U+03C6 phi +!F7 U+03C7 chi +!F8 U+03C8 psi +!F9 U+03C9 omega +!FA U+03CA iotadieresis +!FB U+03CB upsilondieresis +!FC U+03CC omicrontonos +!FD U+03CD upsilontonos +!FE U+03CE omegatonos diff --git a/lib/dompdf/lib/php-font-lib/maps/cp1254.map b/lib/dompdf/lib/php-font-lib/maps/cp1254.map new file mode 100644 index 0000000..829473b --- /dev/null +++ b/lib/dompdf/lib/php-font-lib/maps/cp1254.map @@ -0,0 +1,249 @@ +!00 U+0000 .notdef +!01 U+0001 .notdef +!02 U+0002 .notdef +!03 U+0003 .notdef +!04 U+0004 .notdef +!05 U+0005 .notdef +!06 U+0006 .notdef +!07 U+0007 .notdef +!08 U+0008 .notdef +!09 U+0009 .notdef +!0A U+000A .notdef +!0B U+000B .notdef +!0C U+000C .notdef +!0D U+000D .notdef +!0E U+000E .notdef +!0F U+000F .notdef +!10 U+0010 .notdef +!11 U+0011 .notdef +!12 U+0012 .notdef +!13 U+0013 .notdef +!14 U+0014 .notdef +!15 U+0015 .notdef +!16 U+0016 .notdef +!17 U+0017 .notdef +!18 U+0018 .notdef +!19 U+0019 .notdef +!1A U+001A .notdef +!1B U+001B .notdef +!1C U+001C .notdef +!1D U+001D .notdef +!1E U+001E .notdef +!1F U+001F .notdef +!20 U+0020 space +!21 U+0021 exclam +!22 U+0022 quotedbl +!23 U+0023 numbersign +!24 U+0024 dollar +!25 U+0025 percent +!26 U+0026 ampersand +!27 U+0027 quotesingle +!28 U+0028 parenleft +!29 U+0029 parenright +!2A U+002A asterisk +!2B U+002B plus +!2C U+002C comma +!2D U+002D hyphen +!2E U+002E period +!2F U+002F slash +!30 U+0030 zero +!31 U+0031 one +!32 U+0032 two +!33 U+0033 three +!34 U+0034 four +!35 U+0035 five +!36 U+0036 six +!37 U+0037 seven +!38 U+0038 eight +!39 U+0039 nine +!3A U+003A colon +!3B U+003B semicolon +!3C U+003C less +!3D U+003D equal +!3E U+003E greater +!3F U+003F question +!40 U+0040 at +!41 U+0041 A +!42 U+0042 B +!43 U+0043 C +!44 U+0044 D +!45 U+0045 E +!46 U+0046 F +!47 U+0047 G +!48 U+0048 H +!49 U+0049 I +!4A U+004A J +!4B U+004B K +!4C U+004C L +!4D U+004D M +!4E U+004E N +!4F U+004F O +!50 U+0050 P +!51 U+0051 Q +!52 U+0052 R +!53 U+0053 S +!54 U+0054 T +!55 U+0055 U +!56 U+0056 V +!57 U+0057 W +!58 U+0058 X +!59 U+0059 Y +!5A U+005A Z +!5B U+005B bracketleft +!5C U+005C backslash +!5D U+005D bracketright +!5E U+005E asciicircum +!5F U+005F underscore +!60 U+0060 grave +!61 U+0061 a +!62 U+0062 b +!63 U+0063 c +!64 U+0064 d +!65 U+0065 e +!66 U+0066 f +!67 U+0067 g +!68 U+0068 h +!69 U+0069 i +!6A U+006A j +!6B U+006B k +!6C U+006C l +!6D U+006D m +!6E U+006E n +!6F U+006F o +!70 U+0070 p +!71 U+0071 q +!72 U+0072 r +!73 U+0073 s +!74 U+0074 t +!75 U+0075 u +!76 U+0076 v +!77 U+0077 w +!78 U+0078 x +!79 U+0079 y +!7A U+007A z +!7B U+007B braceleft +!7C U+007C bar +!7D U+007D braceright +!7E U+007E asciitilde +!7F U+007F .notdef +!80 U+20AC Euro +!82 U+201A quotesinglbase +!83 U+0192 florin +!84 U+201E quotedblbase +!85 U+2026 ellipsis +!86 U+2020 dagger +!87 U+2021 daggerdbl +!88 U+02C6 circumflex +!89 U+2030 perthousand +!8A U+0160 Scaron +!8B U+2039 guilsinglleft +!8C U+0152 OE +!91 U+2018 quoteleft +!92 U+2019 quoteright +!93 U+201C quotedblleft +!94 U+201D quotedblright +!95 U+2022 bullet +!96 U+2013 endash +!97 U+2014 emdash +!98 U+02DC tilde +!99 U+2122 trademark +!9A U+0161 scaron +!9B U+203A guilsinglright +!9C U+0153 oe +!9F U+0178 Ydieresis +!A0 U+00A0 space +!A1 U+00A1 exclamdown +!A2 U+00A2 cent +!A3 U+00A3 sterling +!A4 U+00A4 currency +!A5 U+00A5 yen +!A6 U+00A6 brokenbar +!A7 U+00A7 section +!A8 U+00A8 dieresis +!A9 U+00A9 copyright +!AA U+00AA ordfeminine +!AB U+00AB guillemotleft +!AC U+00AC logicalnot +!AD U+00AD hyphen +!AE U+00AE registered +!AF U+00AF macron +!B0 U+00B0 degree +!B1 U+00B1 plusminus +!B2 U+00B2 twosuperior +!B3 U+00B3 threesuperior +!B4 U+00B4 acute +!B5 U+00B5 mu +!B6 U+00B6 paragraph +!B7 U+00B7 periodcentered +!B8 U+00B8 cedilla +!B9 U+00B9 onesuperior +!BA U+00BA ordmasculine +!BB U+00BB guillemotright +!BC U+00BC onequarter +!BD U+00BD onehalf +!BE U+00BE threequarters +!BF U+00BF questiondown +!C0 U+00C0 Agrave +!C1 U+00C1 Aacute +!C2 U+00C2 Acircumflex +!C3 U+00C3 Atilde +!C4 U+00C4 Adieresis +!C5 U+00C5 Aring +!C6 U+00C6 AE +!C7 U+00C7 Ccedilla +!C8 U+00C8 Egrave +!C9 U+00C9 Eacute +!CA U+00CA Ecircumflex +!CB U+00CB Edieresis +!CC U+00CC Igrave +!CD U+00CD Iacute +!CE U+00CE Icircumflex +!CF U+00CF Idieresis +!D0 U+011E Gbreve +!D1 U+00D1 Ntilde +!D2 U+00D2 Ograve +!D3 U+00D3 Oacute +!D4 U+00D4 Ocircumflex +!D5 U+00D5 Otilde +!D6 U+00D6 Odieresis +!D7 U+00D7 multiply +!D8 U+00D8 Oslash +!D9 U+00D9 Ugrave +!DA U+00DA Uacute +!DB U+00DB Ucircumflex +!DC U+00DC Udieresis +!DD U+0130 Idotaccent +!DE U+015E Scedilla +!DF U+00DF germandbls +!E0 U+00E0 agrave +!E1 U+00E1 aacute +!E2 U+00E2 acircumflex +!E3 U+00E3 atilde +!E4 U+00E4 adieresis +!E5 U+00E5 aring +!E6 U+00E6 ae +!E7 U+00E7 ccedilla +!E8 U+00E8 egrave +!E9 U+00E9 eacute +!EA U+00EA ecircumflex +!EB U+00EB edieresis +!EC U+00EC igrave +!ED U+00ED iacute +!EE U+00EE icircumflex +!EF U+00EF idieresis +!F0 U+011F gbreve +!F1 U+00F1 ntilde +!F2 U+00F2 ograve +!F3 U+00F3 oacute +!F4 U+00F4 ocircumflex +!F5 U+00F5 otilde +!F6 U+00F6 odieresis +!F7 U+00F7 divide +!F8 U+00F8 oslash +!F9 U+00F9 ugrave +!FA U+00FA uacute +!FB U+00FB ucircumflex +!FC U+00FC udieresis +!FD U+0131 dotlessi +!FE U+015F scedilla +!FF U+00FF ydieresis diff --git a/lib/dompdf/lib/php-font-lib/maps/cp1255.map b/lib/dompdf/lib/php-font-lib/maps/cp1255.map new file mode 100644 index 0000000..079e10c --- /dev/null +++ b/lib/dompdf/lib/php-font-lib/maps/cp1255.map @@ -0,0 +1,233 @@ +!00 U+0000 .notdef +!01 U+0001 .notdef +!02 U+0002 .notdef +!03 U+0003 .notdef +!04 U+0004 .notdef +!05 U+0005 .notdef +!06 U+0006 .notdef +!07 U+0007 .notdef +!08 U+0008 .notdef +!09 U+0009 .notdef +!0A U+000A .notdef +!0B U+000B .notdef +!0C U+000C .notdef +!0D U+000D .notdef +!0E U+000E .notdef +!0F U+000F .notdef +!10 U+0010 .notdef +!11 U+0011 .notdef +!12 U+0012 .notdef +!13 U+0013 .notdef +!14 U+0014 .notdef +!15 U+0015 .notdef +!16 U+0016 .notdef +!17 U+0017 .notdef +!18 U+0018 .notdef +!19 U+0019 .notdef +!1A U+001A .notdef +!1B U+001B .notdef +!1C U+001C .notdef +!1D U+001D .notdef +!1E U+001E .notdef +!1F U+001F .notdef +!20 U+0020 space +!21 U+0021 exclam +!22 U+0022 quotedbl +!23 U+0023 numbersign +!24 U+0024 dollar +!25 U+0025 percent +!26 U+0026 ampersand +!27 U+0027 quotesingle +!28 U+0028 parenleft +!29 U+0029 parenright +!2A U+002A asterisk +!2B U+002B plus +!2C U+002C comma +!2D U+002D hyphen +!2E U+002E period +!2F U+002F slash +!30 U+0030 zero +!31 U+0031 one +!32 U+0032 two +!33 U+0033 three +!34 U+0034 four +!35 U+0035 five +!36 U+0036 six +!37 U+0037 seven +!38 U+0038 eight +!39 U+0039 nine +!3A U+003A colon +!3B U+003B semicolon +!3C U+003C less +!3D U+003D equal +!3E U+003E greater +!3F U+003F question +!40 U+0040 at +!41 U+0041 A +!42 U+0042 B +!43 U+0043 C +!44 U+0044 D +!45 U+0045 E +!46 U+0046 F +!47 U+0047 G +!48 U+0048 H +!49 U+0049 I +!4A U+004A J +!4B U+004B K +!4C U+004C L +!4D U+004D M +!4E U+004E N +!4F U+004F O +!50 U+0050 P +!51 U+0051 Q +!52 U+0052 R +!53 U+0053 S +!54 U+0054 T +!55 U+0055 U +!56 U+0056 V +!57 U+0057 W +!58 U+0058 X +!59 U+0059 Y +!5A U+005A Z +!5B U+005B bracketleft +!5C U+005C backslash +!5D U+005D bracketright +!5E U+005E asciicircum +!5F U+005F underscore +!60 U+0060 grave +!61 U+0061 a +!62 U+0062 b +!63 U+0063 c +!64 U+0064 d +!65 U+0065 e +!66 U+0066 f +!67 U+0067 g +!68 U+0068 h +!69 U+0069 i +!6A U+006A j +!6B U+006B k +!6C U+006C l +!6D U+006D m +!6E U+006E n +!6F U+006F o +!70 U+0070 p +!71 U+0071 q +!72 U+0072 r +!73 U+0073 s +!74 U+0074 t +!75 U+0075 u +!76 U+0076 v +!77 U+0077 w +!78 U+0078 x +!79 U+0079 y +!7A U+007A z +!7B U+007B braceleft +!7C U+007C bar +!7D U+007D braceright +!7E U+007E asciitilde +!7F U+007F .notdef +!80 U+20AC Euro +!82 U+201A quotesinglbase +!83 U+0192 florin +!84 U+201E quotedblbase +!85 U+2026 ellipsis +!86 U+2020 dagger +!87 U+2021 daggerdbl +!88 U+02C6 circumflex +!89 U+2030 perthousand +!8B U+2039 guilsinglleft +!91 U+2018 quoteleft +!92 U+2019 quoteright +!93 U+201C quotedblleft +!94 U+201D quotedblright +!95 U+2022 bullet +!96 U+2013 endash +!97 U+2014 emdash +!98 U+02DC tilde +!99 U+2122 trademark +!9B U+203A guilsinglright +!A0 U+00A0 space +!A1 U+00A1 exclamdown +!A2 U+00A2 cent +!A3 U+00A3 sterling +!A4 U+20AA afii57636 +!A5 U+00A5 yen +!A6 U+00A6 brokenbar +!A7 U+00A7 section +!A8 U+00A8 dieresis +!A9 U+00A9 copyright +!AA U+00D7 multiply +!AB U+00AB guillemotleft +!AC U+00AC logicalnot +!AD U+00AD sfthyphen +!AE U+00AE registered +!AF U+00AF macron +!B0 U+00B0 degree +!B1 U+00B1 plusminus +!B2 U+00B2 twosuperior +!B3 U+00B3 threesuperior +!B4 U+00B4 acute +!B5 U+00B5 mu +!B6 U+00B6 paragraph +!B7 U+00B7 middot +!B8 U+00B8 cedilla +!B9 U+00B9 onesuperior +!BA U+00F7 divide +!BB U+00BB guillemotright +!BC U+00BC onequarter +!BD U+00BD onehalf +!BE U+00BE threequarters +!BF U+00BF questiondown +!C0 U+05B0 afii57799 +!C1 U+05B1 afii57801 +!C2 U+05B2 afii57800 +!C3 U+05B3 afii57802 +!C4 U+05B4 afii57793 +!C5 U+05B5 afii57794 +!C6 U+05B6 afii57795 +!C7 U+05B7 afii57798 +!C8 U+05B8 afii57797 +!C9 U+05B9 afii57806 +!CB U+05BB afii57796 +!CC U+05BC afii57807 +!CD U+05BD afii57839 +!CE U+05BE afii57645 +!CF U+05BF afii57841 +!D0 U+05C0 afii57842 +!D1 U+05C1 afii57804 +!D2 U+05C2 afii57803 +!D3 U+05C3 afii57658 +!D4 U+05F0 afii57716 +!D5 U+05F1 afii57717 +!D6 U+05F2 afii57718 +!D7 U+05F3 gereshhebrew +!D8 U+05F4 gershayimhebrew +!E0 U+05D0 afii57664 +!E1 U+05D1 afii57665 +!E2 U+05D2 afii57666 +!E3 U+05D3 afii57667 +!E4 U+05D4 afii57668 +!E5 U+05D5 afii57669 +!E6 U+05D6 afii57670 +!E7 U+05D7 afii57671 +!E8 U+05D8 afii57672 +!E9 U+05D9 afii57673 +!EA U+05DA afii57674 +!EB U+05DB afii57675 +!EC U+05DC afii57676 +!ED U+05DD afii57677 +!EE U+05DE afii57678 +!EF U+05DF afii57679 +!F0 U+05E0 afii57680 +!F1 U+05E1 afii57681 +!F2 U+05E2 afii57682 +!F3 U+05E3 afii57683 +!F4 U+05E4 afii57684 +!F5 U+05E5 afii57685 +!F6 U+05E6 afii57686 +!F7 U+05E7 afii57687 +!F8 U+05E8 afii57688 +!F9 U+05E9 afii57689 +!FA U+05EA afii57690 +!FD U+200E afii299 +!FE U+200F afii300 diff --git a/lib/dompdf/lib/php-font-lib/maps/cp1257.map b/lib/dompdf/lib/php-font-lib/maps/cp1257.map new file mode 100644 index 0000000..2f2ecfa --- /dev/null +++ b/lib/dompdf/lib/php-font-lib/maps/cp1257.map @@ -0,0 +1,244 @@ +!00 U+0000 .notdef +!01 U+0001 .notdef +!02 U+0002 .notdef +!03 U+0003 .notdef +!04 U+0004 .notdef +!05 U+0005 .notdef +!06 U+0006 .notdef +!07 U+0007 .notdef +!08 U+0008 .notdef +!09 U+0009 .notdef +!0A U+000A .notdef +!0B U+000B .notdef +!0C U+000C .notdef +!0D U+000D .notdef +!0E U+000E .notdef +!0F U+000F .notdef +!10 U+0010 .notdef +!11 U+0011 .notdef +!12 U+0012 .notdef +!13 U+0013 .notdef +!14 U+0014 .notdef +!15 U+0015 .notdef +!16 U+0016 .notdef +!17 U+0017 .notdef +!18 U+0018 .notdef +!19 U+0019 .notdef +!1A U+001A .notdef +!1B U+001B .notdef +!1C U+001C .notdef +!1D U+001D .notdef +!1E U+001E .notdef +!1F U+001F .notdef +!20 U+0020 space +!21 U+0021 exclam +!22 U+0022 quotedbl +!23 U+0023 numbersign +!24 U+0024 dollar +!25 U+0025 percent +!26 U+0026 ampersand +!27 U+0027 quotesingle +!28 U+0028 parenleft +!29 U+0029 parenright +!2A U+002A asterisk +!2B U+002B plus +!2C U+002C comma +!2D U+002D hyphen +!2E U+002E period +!2F U+002F slash +!30 U+0030 zero +!31 U+0031 one +!32 U+0032 two +!33 U+0033 three +!34 U+0034 four +!35 U+0035 five +!36 U+0036 six +!37 U+0037 seven +!38 U+0038 eight +!39 U+0039 nine +!3A U+003A colon +!3B U+003B semicolon +!3C U+003C less +!3D U+003D equal +!3E U+003E greater +!3F U+003F question +!40 U+0040 at +!41 U+0041 A +!42 U+0042 B +!43 U+0043 C +!44 U+0044 D +!45 U+0045 E +!46 U+0046 F +!47 U+0047 G +!48 U+0048 H +!49 U+0049 I +!4A U+004A J +!4B U+004B K +!4C U+004C L +!4D U+004D M +!4E U+004E N +!4F U+004F O +!50 U+0050 P +!51 U+0051 Q +!52 U+0052 R +!53 U+0053 S +!54 U+0054 T +!55 U+0055 U +!56 U+0056 V +!57 U+0057 W +!58 U+0058 X +!59 U+0059 Y +!5A U+005A Z +!5B U+005B bracketleft +!5C U+005C backslash +!5D U+005D bracketright +!5E U+005E asciicircum +!5F U+005F underscore +!60 U+0060 grave +!61 U+0061 a +!62 U+0062 b +!63 U+0063 c +!64 U+0064 d +!65 U+0065 e +!66 U+0066 f +!67 U+0067 g +!68 U+0068 h +!69 U+0069 i +!6A U+006A j +!6B U+006B k +!6C U+006C l +!6D U+006D m +!6E U+006E n +!6F U+006F o +!70 U+0070 p +!71 U+0071 q +!72 U+0072 r +!73 U+0073 s +!74 U+0074 t +!75 U+0075 u +!76 U+0076 v +!77 U+0077 w +!78 U+0078 x +!79 U+0079 y +!7A U+007A z +!7B U+007B braceleft +!7C U+007C bar +!7D U+007D braceright +!7E U+007E asciitilde +!7F U+007F .notdef +!80 U+20AC Euro +!82 U+201A quotesinglbase +!84 U+201E quotedblbase +!85 U+2026 ellipsis +!86 U+2020 dagger +!87 U+2021 daggerdbl +!89 U+2030 perthousand +!8B U+2039 guilsinglleft +!8D U+00A8 dieresis +!8E U+02C7 caron +!8F U+00B8 cedilla +!91 U+2018 quoteleft +!92 U+2019 quoteright +!93 U+201C quotedblleft +!94 U+201D quotedblright +!95 U+2022 bullet +!96 U+2013 endash +!97 U+2014 emdash +!99 U+2122 trademark +!9B U+203A guilsinglright +!9D U+00AF macron +!9E U+02DB ogonek +!A0 U+00A0 space +!A2 U+00A2 cent +!A3 U+00A3 sterling +!A4 U+00A4 currency +!A6 U+00A6 brokenbar +!A7 U+00A7 section +!A8 U+00D8 Oslash +!A9 U+00A9 copyright +!AA U+0156 Rcommaaccent +!AB U+00AB guillemotleft +!AC U+00AC logicalnot +!AD U+00AD hyphen +!AE U+00AE registered +!AF U+00C6 AE +!B0 U+00B0 degree +!B1 U+00B1 plusminus +!B2 U+00B2 twosuperior +!B3 U+00B3 threesuperior +!B4 U+00B4 acute +!B5 U+00B5 mu +!B6 U+00B6 paragraph +!B7 U+00B7 periodcentered +!B8 U+00F8 oslash +!B9 U+00B9 onesuperior +!BA U+0157 rcommaaccent +!BB U+00BB guillemotright +!BC U+00BC onequarter +!BD U+00BD onehalf +!BE U+00BE threequarters +!BF U+00E6 ae +!C0 U+0104 Aogonek +!C1 U+012E Iogonek +!C2 U+0100 Amacron +!C3 U+0106 Cacute +!C4 U+00C4 Adieresis +!C5 U+00C5 Aring +!C6 U+0118 Eogonek +!C7 U+0112 Emacron +!C8 U+010C Ccaron +!C9 U+00C9 Eacute +!CA U+0179 Zacute +!CB U+0116 Edotaccent +!CC U+0122 Gcommaaccent +!CD U+0136 Kcommaaccent +!CE U+012A Imacron +!CF U+013B Lcommaaccent +!D0 U+0160 Scaron +!D1 U+0143 Nacute +!D2 U+0145 Ncommaaccent +!D3 U+00D3 Oacute +!D4 U+014C Omacron +!D5 U+00D5 Otilde +!D6 U+00D6 Odieresis +!D7 U+00D7 multiply +!D8 U+0172 Uogonek +!D9 U+0141 Lslash +!DA U+015A Sacute +!DB U+016A Umacron +!DC U+00DC Udieresis +!DD U+017B Zdotaccent +!DE U+017D Zcaron +!DF U+00DF germandbls +!E0 U+0105 aogonek +!E1 U+012F iogonek +!E2 U+0101 amacron +!E3 U+0107 cacute +!E4 U+00E4 adieresis +!E5 U+00E5 aring +!E6 U+0119 eogonek +!E7 U+0113 emacron +!E8 U+010D ccaron +!E9 U+00E9 eacute +!EA U+017A zacute +!EB U+0117 edotaccent +!EC U+0123 gcommaaccent +!ED U+0137 kcommaaccent +!EE U+012B imacron +!EF U+013C lcommaaccent +!F0 U+0161 scaron +!F1 U+0144 nacute +!F2 U+0146 ncommaaccent +!F3 U+00F3 oacute +!F4 U+014D omacron +!F5 U+00F5 otilde +!F6 U+00F6 odieresis +!F7 U+00F7 divide +!F8 U+0173 uogonek +!F9 U+0142 lslash +!FA U+015B sacute +!FB U+016B umacron +!FC U+00FC udieresis +!FD U+017C zdotaccent +!FE U+017E zcaron +!FF U+02D9 dotaccent diff --git a/lib/dompdf/lib/php-font-lib/maps/cp1258.map b/lib/dompdf/lib/php-font-lib/maps/cp1258.map new file mode 100644 index 0000000..fed915f --- /dev/null +++ b/lib/dompdf/lib/php-font-lib/maps/cp1258.map @@ -0,0 +1,247 @@ +!00 U+0000 .notdef +!01 U+0001 .notdef +!02 U+0002 .notdef +!03 U+0003 .notdef +!04 U+0004 .notdef +!05 U+0005 .notdef +!06 U+0006 .notdef +!07 U+0007 .notdef +!08 U+0008 .notdef +!09 U+0009 .notdef +!0A U+000A .notdef +!0B U+000B .notdef +!0C U+000C .notdef +!0D U+000D .notdef +!0E U+000E .notdef +!0F U+000F .notdef +!10 U+0010 .notdef +!11 U+0011 .notdef +!12 U+0012 .notdef +!13 U+0013 .notdef +!14 U+0014 .notdef +!15 U+0015 .notdef +!16 U+0016 .notdef +!17 U+0017 .notdef +!18 U+0018 .notdef +!19 U+0019 .notdef +!1A U+001A .notdef +!1B U+001B .notdef +!1C U+001C .notdef +!1D U+001D .notdef +!1E U+001E .notdef +!1F U+001F .notdef +!20 U+0020 space +!21 U+0021 exclam +!22 U+0022 quotedbl +!23 U+0023 numbersign +!24 U+0024 dollar +!25 U+0025 percent +!26 U+0026 ampersand +!27 U+0027 quotesingle +!28 U+0028 parenleft +!29 U+0029 parenright +!2A U+002A asterisk +!2B U+002B plus +!2C U+002C comma +!2D U+002D hyphen +!2E U+002E period +!2F U+002F slash +!30 U+0030 zero +!31 U+0031 one +!32 U+0032 two +!33 U+0033 three +!34 U+0034 four +!35 U+0035 five +!36 U+0036 six +!37 U+0037 seven +!38 U+0038 eight +!39 U+0039 nine +!3A U+003A colon +!3B U+003B semicolon +!3C U+003C less +!3D U+003D equal +!3E U+003E greater +!3F U+003F question +!40 U+0040 at +!41 U+0041 A +!42 U+0042 B +!43 U+0043 C +!44 U+0044 D +!45 U+0045 E +!46 U+0046 F +!47 U+0047 G +!48 U+0048 H +!49 U+0049 I +!4A U+004A J +!4B U+004B K +!4C U+004C L +!4D U+004D M +!4E U+004E N +!4F U+004F O +!50 U+0050 P +!51 U+0051 Q +!52 U+0052 R +!53 U+0053 S +!54 U+0054 T +!55 U+0055 U +!56 U+0056 V +!57 U+0057 W +!58 U+0058 X +!59 U+0059 Y +!5A U+005A Z +!5B U+005B bracketleft +!5C U+005C backslash +!5D U+005D bracketright +!5E U+005E asciicircum +!5F U+005F underscore +!60 U+0060 grave +!61 U+0061 a +!62 U+0062 b +!63 U+0063 c +!64 U+0064 d +!65 U+0065 e +!66 U+0066 f +!67 U+0067 g +!68 U+0068 h +!69 U+0069 i +!6A U+006A j +!6B U+006B k +!6C U+006C l +!6D U+006D m +!6E U+006E n +!6F U+006F o +!70 U+0070 p +!71 U+0071 q +!72 U+0072 r +!73 U+0073 s +!74 U+0074 t +!75 U+0075 u +!76 U+0076 v +!77 U+0077 w +!78 U+0078 x +!79 U+0079 y +!7A U+007A z +!7B U+007B braceleft +!7C U+007C bar +!7D U+007D braceright +!7E U+007E asciitilde +!7F U+007F .notdef +!80 U+20AC Euro +!82 U+201A quotesinglbase +!83 U+0192 florin +!84 U+201E quotedblbase +!85 U+2026 ellipsis +!86 U+2020 dagger +!87 U+2021 daggerdbl +!88 U+02C6 circumflex +!89 U+2030 perthousand +!8B U+2039 guilsinglleft +!8C U+0152 OE +!91 U+2018 quoteleft +!92 U+2019 quoteright +!93 U+201C quotedblleft +!94 U+201D quotedblright +!95 U+2022 bullet +!96 U+2013 endash +!97 U+2014 emdash +!98 U+02DC tilde +!99 U+2122 trademark +!9B U+203A guilsinglright +!9C U+0153 oe +!9F U+0178 Ydieresis +!A0 U+00A0 space +!A1 U+00A1 exclamdown +!A2 U+00A2 cent +!A3 U+00A3 sterling +!A4 U+00A4 currency +!A5 U+00A5 yen +!A6 U+00A6 brokenbar +!A7 U+00A7 section +!A8 U+00A8 dieresis +!A9 U+00A9 copyright +!AA U+00AA ordfeminine +!AB U+00AB guillemotleft +!AC U+00AC logicalnot +!AD U+00AD hyphen +!AE U+00AE registered +!AF U+00AF macron +!B0 U+00B0 degree +!B1 U+00B1 plusminus +!B2 U+00B2 twosuperior +!B3 U+00B3 threesuperior +!B4 U+00B4 acute +!B5 U+00B5 mu +!B6 U+00B6 paragraph +!B7 U+00B7 periodcentered +!B8 U+00B8 cedilla +!B9 U+00B9 onesuperior +!BA U+00BA ordmasculine +!BB U+00BB guillemotright +!BC U+00BC onequarter +!BD U+00BD onehalf +!BE U+00BE threequarters +!BF U+00BF questiondown +!C0 U+00C0 Agrave +!C1 U+00C1 Aacute +!C2 U+00C2 Acircumflex +!C3 U+0102 Abreve +!C4 U+00C4 Adieresis +!C5 U+00C5 Aring +!C6 U+00C6 AE +!C7 U+00C7 Ccedilla +!C8 U+00C8 Egrave +!C9 U+00C9 Eacute +!CA U+00CA Ecircumflex +!CB U+00CB Edieresis +!CC U+0300 gravecomb +!CD U+00CD Iacute +!CE U+00CE Icircumflex +!CF U+00CF Idieresis +!D0 U+0110 Dcroat +!D1 U+00D1 Ntilde +!D2 U+0309 hookabovecomb +!D3 U+00D3 Oacute +!D4 U+00D4 Ocircumflex +!D5 U+01A0 Ohorn +!D6 U+00D6 Odieresis +!D7 U+00D7 multiply +!D8 U+00D8 Oslash +!D9 U+00D9 Ugrave +!DA U+00DA Uacute +!DB U+00DB Ucircumflex +!DC U+00DC Udieresis +!DD U+01AF Uhorn +!DE U+0303 tildecomb +!DF U+00DF germandbls +!E0 U+00E0 agrave +!E1 U+00E1 aacute +!E2 U+00E2 acircumflex +!E3 U+0103 abreve +!E4 U+00E4 adieresis +!E5 U+00E5 aring +!E6 U+00E6 ae +!E7 U+00E7 ccedilla +!E8 U+00E8 egrave +!E9 U+00E9 eacute +!EA U+00EA ecircumflex +!EB U+00EB edieresis +!EC U+0301 acutecomb +!ED U+00ED iacute +!EE U+00EE icircumflex +!EF U+00EF idieresis +!F0 U+0111 dcroat +!F1 U+00F1 ntilde +!F2 U+0323 dotbelowcomb +!F3 U+00F3 oacute +!F4 U+00F4 ocircumflex +!F5 U+01A1 ohorn +!F6 U+00F6 odieresis +!F7 U+00F7 divide +!F8 U+00F8 oslash +!F9 U+00F9 ugrave +!FA U+00FA uacute +!FB U+00FB ucircumflex +!FC U+00FC udieresis +!FD U+01B0 uhorn +!FE U+20AB dong +!FF U+00FF ydieresis diff --git a/lib/dompdf/lib/php-font-lib/maps/cp874.map b/lib/dompdf/lib/php-font-lib/maps/cp874.map new file mode 100644 index 0000000..1006e6b --- /dev/null +++ b/lib/dompdf/lib/php-font-lib/maps/cp874.map @@ -0,0 +1,225 @@ +!00 U+0000 .notdef +!01 U+0001 .notdef +!02 U+0002 .notdef +!03 U+0003 .notdef +!04 U+0004 .notdef +!05 U+0005 .notdef +!06 U+0006 .notdef +!07 U+0007 .notdef +!08 U+0008 .notdef +!09 U+0009 .notdef +!0A U+000A .notdef +!0B U+000B .notdef +!0C U+000C .notdef +!0D U+000D .notdef +!0E U+000E .notdef +!0F U+000F .notdef +!10 U+0010 .notdef +!11 U+0011 .notdef +!12 U+0012 .notdef +!13 U+0013 .notdef +!14 U+0014 .notdef +!15 U+0015 .notdef +!16 U+0016 .notdef +!17 U+0017 .notdef +!18 U+0018 .notdef +!19 U+0019 .notdef +!1A U+001A .notdef +!1B U+001B .notdef +!1C U+001C .notdef +!1D U+001D .notdef +!1E U+001E .notdef +!1F U+001F .notdef +!20 U+0020 space +!21 U+0021 exclam +!22 U+0022 quotedbl +!23 U+0023 numbersign +!24 U+0024 dollar +!25 U+0025 percent +!26 U+0026 ampersand +!27 U+0027 quotesingle +!28 U+0028 parenleft +!29 U+0029 parenright +!2A U+002A asterisk +!2B U+002B plus +!2C U+002C comma +!2D U+002D hyphen +!2E U+002E period +!2F U+002F slash +!30 U+0030 zero +!31 U+0031 one +!32 U+0032 two +!33 U+0033 three +!34 U+0034 four +!35 U+0035 five +!36 U+0036 six +!37 U+0037 seven +!38 U+0038 eight +!39 U+0039 nine +!3A U+003A colon +!3B U+003B semicolon +!3C U+003C less +!3D U+003D equal +!3E U+003E greater +!3F U+003F question +!40 U+0040 at +!41 U+0041 A +!42 U+0042 B +!43 U+0043 C +!44 U+0044 D +!45 U+0045 E +!46 U+0046 F +!47 U+0047 G +!48 U+0048 H +!49 U+0049 I +!4A U+004A J +!4B U+004B K +!4C U+004C L +!4D U+004D M +!4E U+004E N +!4F U+004F O +!50 U+0050 P +!51 U+0051 Q +!52 U+0052 R +!53 U+0053 S +!54 U+0054 T +!55 U+0055 U +!56 U+0056 V +!57 U+0057 W +!58 U+0058 X +!59 U+0059 Y +!5A U+005A Z +!5B U+005B bracketleft +!5C U+005C backslash +!5D U+005D bracketright +!5E U+005E asciicircum +!5F U+005F underscore +!60 U+0060 grave +!61 U+0061 a +!62 U+0062 b +!63 U+0063 c +!64 U+0064 d +!65 U+0065 e +!66 U+0066 f +!67 U+0067 g +!68 U+0068 h +!69 U+0069 i +!6A U+006A j +!6B U+006B k +!6C U+006C l +!6D U+006D m +!6E U+006E n +!6F U+006F o +!70 U+0070 p +!71 U+0071 q +!72 U+0072 r +!73 U+0073 s +!74 U+0074 t +!75 U+0075 u +!76 U+0076 v +!77 U+0077 w +!78 U+0078 x +!79 U+0079 y +!7A U+007A z +!7B U+007B braceleft +!7C U+007C bar +!7D U+007D braceright +!7E U+007E asciitilde +!7F U+007F .notdef +!80 U+20AC Euro +!85 U+2026 ellipsis +!91 U+2018 quoteleft +!92 U+2019 quoteright +!93 U+201C quotedblleft +!94 U+201D quotedblright +!95 U+2022 bullet +!96 U+2013 endash +!97 U+2014 emdash +!A0 U+00A0 space +!A1 U+0E01 kokaithai +!A2 U+0E02 khokhaithai +!A3 U+0E03 khokhuatthai +!A4 U+0E04 khokhwaithai +!A5 U+0E05 khokhonthai +!A6 U+0E06 khorakhangthai +!A7 U+0E07 ngonguthai +!A8 U+0E08 chochanthai +!A9 U+0E09 chochingthai +!AA U+0E0A chochangthai +!AB U+0E0B sosothai +!AC U+0E0C chochoethai +!AD U+0E0D yoyingthai +!AE U+0E0E dochadathai +!AF U+0E0F topatakthai +!B0 U+0E10 thothanthai +!B1 U+0E11 thonangmonthothai +!B2 U+0E12 thophuthaothai +!B3 U+0E13 nonenthai +!B4 U+0E14 dodekthai +!B5 U+0E15 totaothai +!B6 U+0E16 thothungthai +!B7 U+0E17 thothahanthai +!B8 U+0E18 thothongthai +!B9 U+0E19 nonuthai +!BA U+0E1A bobaimaithai +!BB U+0E1B poplathai +!BC U+0E1C phophungthai +!BD U+0E1D fofathai +!BE U+0E1E phophanthai +!BF U+0E1F fofanthai +!C0 U+0E20 phosamphaothai +!C1 U+0E21 momathai +!C2 U+0E22 yoyakthai +!C3 U+0E23 roruathai +!C4 U+0E24 ruthai +!C5 U+0E25 lolingthai +!C6 U+0E26 luthai +!C7 U+0E27 wowaenthai +!C8 U+0E28 sosalathai +!C9 U+0E29 sorusithai +!CA U+0E2A sosuathai +!CB U+0E2B hohipthai +!CC U+0E2C lochulathai +!CD U+0E2D oangthai +!CE U+0E2E honokhukthai +!CF U+0E2F paiyannoithai +!D0 U+0E30 saraathai +!D1 U+0E31 maihanakatthai +!D2 U+0E32 saraaathai +!D3 U+0E33 saraamthai +!D4 U+0E34 saraithai +!D5 U+0E35 saraiithai +!D6 U+0E36 sarauethai +!D7 U+0E37 saraueethai +!D8 U+0E38 sarauthai +!D9 U+0E39 sarauuthai +!DA U+0E3A phinthuthai +!DF U+0E3F bahtthai +!E0 U+0E40 saraethai +!E1 U+0E41 saraaethai +!E2 U+0E42 saraothai +!E3 U+0E43 saraaimaimuanthai +!E4 U+0E44 saraaimaimalaithai +!E5 U+0E45 lakkhangyaothai +!E6 U+0E46 maiyamokthai +!E7 U+0E47 maitaikhuthai +!E8 U+0E48 maiekthai +!E9 U+0E49 maithothai +!EA U+0E4A maitrithai +!EB U+0E4B maichattawathai +!EC U+0E4C thanthakhatthai +!ED U+0E4D nikhahitthai +!EE U+0E4E yamakkanthai +!EF U+0E4F fongmanthai +!F0 U+0E50 zerothai +!F1 U+0E51 onethai +!F2 U+0E52 twothai +!F3 U+0E53 threethai +!F4 U+0E54 fourthai +!F5 U+0E55 fivethai +!F6 U+0E56 sixthai +!F7 U+0E57 seventhai +!F8 U+0E58 eightthai +!F9 U+0E59 ninethai +!FA U+0E5A angkhankhuthai +!FB U+0E5B khomutthai diff --git a/lib/dompdf/lib/php-font-lib/maps/iso-8859-1.map b/lib/dompdf/lib/php-font-lib/maps/iso-8859-1.map new file mode 100644 index 0000000..61740a3 --- /dev/null +++ b/lib/dompdf/lib/php-font-lib/maps/iso-8859-1.map @@ -0,0 +1,256 @@ +!00 U+0000 .notdef +!01 U+0001 .notdef +!02 U+0002 .notdef +!03 U+0003 .notdef +!04 U+0004 .notdef +!05 U+0005 .notdef +!06 U+0006 .notdef +!07 U+0007 .notdef +!08 U+0008 .notdef +!09 U+0009 .notdef +!0A U+000A .notdef +!0B U+000B .notdef +!0C U+000C .notdef +!0D U+000D .notdef +!0E U+000E .notdef +!0F U+000F .notdef +!10 U+0010 .notdef +!11 U+0011 .notdef +!12 U+0012 .notdef +!13 U+0013 .notdef +!14 U+0014 .notdef +!15 U+0015 .notdef +!16 U+0016 .notdef +!17 U+0017 .notdef +!18 U+0018 .notdef +!19 U+0019 .notdef +!1A U+001A .notdef +!1B U+001B .notdef +!1C U+001C .notdef +!1D U+001D .notdef +!1E U+001E .notdef +!1F U+001F .notdef +!20 U+0020 space +!21 U+0021 exclam +!22 U+0022 quotedbl +!23 U+0023 numbersign +!24 U+0024 dollar +!25 U+0025 percent +!26 U+0026 ampersand +!27 U+0027 quotesingle +!28 U+0028 parenleft +!29 U+0029 parenright +!2A U+002A asterisk +!2B U+002B plus +!2C U+002C comma +!2D U+002D hyphen +!2E U+002E period +!2F U+002F slash +!30 U+0030 zero +!31 U+0031 one +!32 U+0032 two +!33 U+0033 three +!34 U+0034 four +!35 U+0035 five +!36 U+0036 six +!37 U+0037 seven +!38 U+0038 eight +!39 U+0039 nine +!3A U+003A colon +!3B U+003B semicolon +!3C U+003C less +!3D U+003D equal +!3E U+003E greater +!3F U+003F question +!40 U+0040 at +!41 U+0041 A +!42 U+0042 B +!43 U+0043 C +!44 U+0044 D +!45 U+0045 E +!46 U+0046 F +!47 U+0047 G +!48 U+0048 H +!49 U+0049 I +!4A U+004A J +!4B U+004B K +!4C U+004C L +!4D U+004D M +!4E U+004E N +!4F U+004F O +!50 U+0050 P +!51 U+0051 Q +!52 U+0052 R +!53 U+0053 S +!54 U+0054 T +!55 U+0055 U +!56 U+0056 V +!57 U+0057 W +!58 U+0058 X +!59 U+0059 Y +!5A U+005A Z +!5B U+005B bracketleft +!5C U+005C backslash +!5D U+005D bracketright +!5E U+005E asciicircum +!5F U+005F underscore +!60 U+0060 grave +!61 U+0061 a +!62 U+0062 b +!63 U+0063 c +!64 U+0064 d +!65 U+0065 e +!66 U+0066 f +!67 U+0067 g +!68 U+0068 h +!69 U+0069 i +!6A U+006A j +!6B U+006B k +!6C U+006C l +!6D U+006D m +!6E U+006E n +!6F U+006F o +!70 U+0070 p +!71 U+0071 q +!72 U+0072 r +!73 U+0073 s +!74 U+0074 t +!75 U+0075 u +!76 U+0076 v +!77 U+0077 w +!78 U+0078 x +!79 U+0079 y +!7A U+007A z +!7B U+007B braceleft +!7C U+007C bar +!7D U+007D braceright +!7E U+007E asciitilde +!7F U+007F .notdef +!80 U+0080 .notdef +!81 U+0081 .notdef +!82 U+0082 .notdef +!83 U+0083 .notdef +!84 U+0084 .notdef +!85 U+0085 .notdef +!86 U+0086 .notdef +!87 U+0087 .notdef +!88 U+0088 .notdef +!89 U+0089 .notdef +!8A U+008A .notdef +!8B U+008B .notdef +!8C U+008C .notdef +!8D U+008D .notdef +!8E U+008E .notdef +!8F U+008F .notdef +!90 U+0090 .notdef +!91 U+0091 .notdef +!92 U+0092 .notdef +!93 U+0093 .notdef +!94 U+0094 .notdef +!95 U+0095 .notdef +!96 U+0096 .notdef +!97 U+0097 .notdef +!98 U+0098 .notdef +!99 U+0099 .notdef +!9A U+009A .notdef +!9B U+009B .notdef +!9C U+009C .notdef +!9D U+009D .notdef +!9E U+009E .notdef +!9F U+009F .notdef +!A0 U+00A0 space +!A1 U+00A1 exclamdown +!A2 U+00A2 cent +!A3 U+00A3 sterling +!A4 U+00A4 currency +!A5 U+00A5 yen +!A6 U+00A6 brokenbar +!A7 U+00A7 section +!A8 U+00A8 dieresis +!A9 U+00A9 copyright +!AA U+00AA ordfeminine +!AB U+00AB guillemotleft +!AC U+00AC logicalnot +!AD U+00AD hyphen +!AE U+00AE registered +!AF U+00AF macron +!B0 U+00B0 degree +!B1 U+00B1 plusminus +!B2 U+00B2 twosuperior +!B3 U+00B3 threesuperior +!B4 U+00B4 acute +!B5 U+00B5 mu +!B6 U+00B6 paragraph +!B7 U+00B7 periodcentered +!B8 U+00B8 cedilla +!B9 U+00B9 onesuperior +!BA U+00BA ordmasculine +!BB U+00BB guillemotright +!BC U+00BC onequarter +!BD U+00BD onehalf +!BE U+00BE threequarters +!BF U+00BF questiondown +!C0 U+00C0 Agrave +!C1 U+00C1 Aacute +!C2 U+00C2 Acircumflex +!C3 U+00C3 Atilde +!C4 U+00C4 Adieresis +!C5 U+00C5 Aring +!C6 U+00C6 AE +!C7 U+00C7 Ccedilla +!C8 U+00C8 Egrave +!C9 U+00C9 Eacute +!CA U+00CA Ecircumflex +!CB U+00CB Edieresis +!CC U+00CC Igrave +!CD U+00CD Iacute +!CE U+00CE Icircumflex +!CF U+00CF Idieresis +!D0 U+00D0 Eth +!D1 U+00D1 Ntilde +!D2 U+00D2 Ograve +!D3 U+00D3 Oacute +!D4 U+00D4 Ocircumflex +!D5 U+00D5 Otilde +!D6 U+00D6 Odieresis +!D7 U+00D7 multiply +!D8 U+00D8 Oslash +!D9 U+00D9 Ugrave +!DA U+00DA Uacute +!DB U+00DB Ucircumflex +!DC U+00DC Udieresis +!DD U+00DD Yacute +!DE U+00DE Thorn +!DF U+00DF germandbls +!E0 U+00E0 agrave +!E1 U+00E1 aacute +!E2 U+00E2 acircumflex +!E3 U+00E3 atilde +!E4 U+00E4 adieresis +!E5 U+00E5 aring +!E6 U+00E6 ae +!E7 U+00E7 ccedilla +!E8 U+00E8 egrave +!E9 U+00E9 eacute +!EA U+00EA ecircumflex +!EB U+00EB edieresis +!EC U+00EC igrave +!ED U+00ED iacute +!EE U+00EE icircumflex +!EF U+00EF idieresis +!F0 U+00F0 eth +!F1 U+00F1 ntilde +!F2 U+00F2 ograve +!F3 U+00F3 oacute +!F4 U+00F4 ocircumflex +!F5 U+00F5 otilde +!F6 U+00F6 odieresis +!F7 U+00F7 divide +!F8 U+00F8 oslash +!F9 U+00F9 ugrave +!FA U+00FA uacute +!FB U+00FB ucircumflex +!FC U+00FC udieresis +!FD U+00FD yacute +!FE U+00FE thorn +!FF U+00FF ydieresis diff --git a/lib/dompdf/lib/php-font-lib/maps/iso-8859-11.map b/lib/dompdf/lib/php-font-lib/maps/iso-8859-11.map new file mode 100644 index 0000000..9168812 --- /dev/null +++ b/lib/dompdf/lib/php-font-lib/maps/iso-8859-11.map @@ -0,0 +1,248 @@ +!00 U+0000 .notdef +!01 U+0001 .notdef +!02 U+0002 .notdef +!03 U+0003 .notdef +!04 U+0004 .notdef +!05 U+0005 .notdef +!06 U+0006 .notdef +!07 U+0007 .notdef +!08 U+0008 .notdef +!09 U+0009 .notdef +!0A U+000A .notdef +!0B U+000B .notdef +!0C U+000C .notdef +!0D U+000D .notdef +!0E U+000E .notdef +!0F U+000F .notdef +!10 U+0010 .notdef +!11 U+0011 .notdef +!12 U+0012 .notdef +!13 U+0013 .notdef +!14 U+0014 .notdef +!15 U+0015 .notdef +!16 U+0016 .notdef +!17 U+0017 .notdef +!18 U+0018 .notdef +!19 U+0019 .notdef +!1A U+001A .notdef +!1B U+001B .notdef +!1C U+001C .notdef +!1D U+001D .notdef +!1E U+001E .notdef +!1F U+001F .notdef +!20 U+0020 space +!21 U+0021 exclam +!22 U+0022 quotedbl +!23 U+0023 numbersign +!24 U+0024 dollar +!25 U+0025 percent +!26 U+0026 ampersand +!27 U+0027 quotesingle +!28 U+0028 parenleft +!29 U+0029 parenright +!2A U+002A asterisk +!2B U+002B plus +!2C U+002C comma +!2D U+002D hyphen +!2E U+002E period +!2F U+002F slash +!30 U+0030 zero +!31 U+0031 one +!32 U+0032 two +!33 U+0033 three +!34 U+0034 four +!35 U+0035 five +!36 U+0036 six +!37 U+0037 seven +!38 U+0038 eight +!39 U+0039 nine +!3A U+003A colon +!3B U+003B semicolon +!3C U+003C less +!3D U+003D equal +!3E U+003E greater +!3F U+003F question +!40 U+0040 at +!41 U+0041 A +!42 U+0042 B +!43 U+0043 C +!44 U+0044 D +!45 U+0045 E +!46 U+0046 F +!47 U+0047 G +!48 U+0048 H +!49 U+0049 I +!4A U+004A J +!4B U+004B K +!4C U+004C L +!4D U+004D M +!4E U+004E N +!4F U+004F O +!50 U+0050 P +!51 U+0051 Q +!52 U+0052 R +!53 U+0053 S +!54 U+0054 T +!55 U+0055 U +!56 U+0056 V +!57 U+0057 W +!58 U+0058 X +!59 U+0059 Y +!5A U+005A Z +!5B U+005B bracketleft +!5C U+005C backslash +!5D U+005D bracketright +!5E U+005E asciicircum +!5F U+005F underscore +!60 U+0060 grave +!61 U+0061 a +!62 U+0062 b +!63 U+0063 c +!64 U+0064 d +!65 U+0065 e +!66 U+0066 f +!67 U+0067 g +!68 U+0068 h +!69 U+0069 i +!6A U+006A j +!6B U+006B k +!6C U+006C l +!6D U+006D m +!6E U+006E n +!6F U+006F o +!70 U+0070 p +!71 U+0071 q +!72 U+0072 r +!73 U+0073 s +!74 U+0074 t +!75 U+0075 u +!76 U+0076 v +!77 U+0077 w +!78 U+0078 x +!79 U+0079 y +!7A U+007A z +!7B U+007B braceleft +!7C U+007C bar +!7D U+007D braceright +!7E U+007E asciitilde +!7F U+007F .notdef +!80 U+0080 .notdef +!81 U+0081 .notdef +!82 U+0082 .notdef +!83 U+0083 .notdef +!84 U+0084 .notdef +!85 U+0085 .notdef +!86 U+0086 .notdef +!87 U+0087 .notdef +!88 U+0088 .notdef +!89 U+0089 .notdef +!8A U+008A .notdef +!8B U+008B .notdef +!8C U+008C .notdef +!8D U+008D .notdef +!8E U+008E .notdef +!8F U+008F .notdef +!90 U+0090 .notdef +!91 U+0091 .notdef +!92 U+0092 .notdef +!93 U+0093 .notdef +!94 U+0094 .notdef +!95 U+0095 .notdef +!96 U+0096 .notdef +!97 U+0097 .notdef +!98 U+0098 .notdef +!99 U+0099 .notdef +!9A U+009A .notdef +!9B U+009B .notdef +!9C U+009C .notdef +!9D U+009D .notdef +!9E U+009E .notdef +!9F U+009F .notdef +!A0 U+00A0 space +!A1 U+0E01 kokaithai +!A2 U+0E02 khokhaithai +!A3 U+0E03 khokhuatthai +!A4 U+0E04 khokhwaithai +!A5 U+0E05 khokhonthai +!A6 U+0E06 khorakhangthai +!A7 U+0E07 ngonguthai +!A8 U+0E08 chochanthai +!A9 U+0E09 chochingthai +!AA U+0E0A chochangthai +!AB U+0E0B sosothai +!AC U+0E0C chochoethai +!AD U+0E0D yoyingthai +!AE U+0E0E dochadathai +!AF U+0E0F topatakthai +!B0 U+0E10 thothanthai +!B1 U+0E11 thonangmonthothai +!B2 U+0E12 thophuthaothai +!B3 U+0E13 nonenthai +!B4 U+0E14 dodekthai +!B5 U+0E15 totaothai +!B6 U+0E16 thothungthai +!B7 U+0E17 thothahanthai +!B8 U+0E18 thothongthai +!B9 U+0E19 nonuthai +!BA U+0E1A bobaimaithai +!BB U+0E1B poplathai +!BC U+0E1C phophungthai +!BD U+0E1D fofathai +!BE U+0E1E phophanthai +!BF U+0E1F fofanthai +!C0 U+0E20 phosamphaothai +!C1 U+0E21 momathai +!C2 U+0E22 yoyakthai +!C3 U+0E23 roruathai +!C4 U+0E24 ruthai +!C5 U+0E25 lolingthai +!C6 U+0E26 luthai +!C7 U+0E27 wowaenthai +!C8 U+0E28 sosalathai +!C9 U+0E29 sorusithai +!CA U+0E2A sosuathai +!CB U+0E2B hohipthai +!CC U+0E2C lochulathai +!CD U+0E2D oangthai +!CE U+0E2E honokhukthai +!CF U+0E2F paiyannoithai +!D0 U+0E30 saraathai +!D1 U+0E31 maihanakatthai +!D2 U+0E32 saraaathai +!D3 U+0E33 saraamthai +!D4 U+0E34 saraithai +!D5 U+0E35 saraiithai +!D6 U+0E36 sarauethai +!D7 U+0E37 saraueethai +!D8 U+0E38 sarauthai +!D9 U+0E39 sarauuthai +!DA U+0E3A phinthuthai +!DF U+0E3F bahtthai +!E0 U+0E40 saraethai +!E1 U+0E41 saraaethai +!E2 U+0E42 saraothai +!E3 U+0E43 saraaimaimuanthai +!E4 U+0E44 saraaimaimalaithai +!E5 U+0E45 lakkhangyaothai +!E6 U+0E46 maiyamokthai +!E7 U+0E47 maitaikhuthai +!E8 U+0E48 maiekthai +!E9 U+0E49 maithothai +!EA U+0E4A maitrithai +!EB U+0E4B maichattawathai +!EC U+0E4C thanthakhatthai +!ED U+0E4D nikhahitthai +!EE U+0E4E yamakkanthai +!EF U+0E4F fongmanthai +!F0 U+0E50 zerothai +!F1 U+0E51 onethai +!F2 U+0E52 twothai +!F3 U+0E53 threethai +!F4 U+0E54 fourthai +!F5 U+0E55 fivethai +!F6 U+0E56 sixthai +!F7 U+0E57 seventhai +!F8 U+0E58 eightthai +!F9 U+0E59 ninethai +!FA U+0E5A angkhankhuthai +!FB U+0E5B khomutthai diff --git a/lib/dompdf/lib/php-font-lib/maps/iso-8859-15.map b/lib/dompdf/lib/php-font-lib/maps/iso-8859-15.map new file mode 100644 index 0000000..6c2b571 --- /dev/null +++ b/lib/dompdf/lib/php-font-lib/maps/iso-8859-15.map @@ -0,0 +1,256 @@ +!00 U+0000 .notdef +!01 U+0001 .notdef +!02 U+0002 .notdef +!03 U+0003 .notdef +!04 U+0004 .notdef +!05 U+0005 .notdef +!06 U+0006 .notdef +!07 U+0007 .notdef +!08 U+0008 .notdef +!09 U+0009 .notdef +!0A U+000A .notdef +!0B U+000B .notdef +!0C U+000C .notdef +!0D U+000D .notdef +!0E U+000E .notdef +!0F U+000F .notdef +!10 U+0010 .notdef +!11 U+0011 .notdef +!12 U+0012 .notdef +!13 U+0013 .notdef +!14 U+0014 .notdef +!15 U+0015 .notdef +!16 U+0016 .notdef +!17 U+0017 .notdef +!18 U+0018 .notdef +!19 U+0019 .notdef +!1A U+001A .notdef +!1B U+001B .notdef +!1C U+001C .notdef +!1D U+001D .notdef +!1E U+001E .notdef +!1F U+001F .notdef +!20 U+0020 space +!21 U+0021 exclam +!22 U+0022 quotedbl +!23 U+0023 numbersign +!24 U+0024 dollar +!25 U+0025 percent +!26 U+0026 ampersand +!27 U+0027 quotesingle +!28 U+0028 parenleft +!29 U+0029 parenright +!2A U+002A asterisk +!2B U+002B plus +!2C U+002C comma +!2D U+002D hyphen +!2E U+002E period +!2F U+002F slash +!30 U+0030 zero +!31 U+0031 one +!32 U+0032 two +!33 U+0033 three +!34 U+0034 four +!35 U+0035 five +!36 U+0036 six +!37 U+0037 seven +!38 U+0038 eight +!39 U+0039 nine +!3A U+003A colon +!3B U+003B semicolon +!3C U+003C less +!3D U+003D equal +!3E U+003E greater +!3F U+003F question +!40 U+0040 at +!41 U+0041 A +!42 U+0042 B +!43 U+0043 C +!44 U+0044 D +!45 U+0045 E +!46 U+0046 F +!47 U+0047 G +!48 U+0048 H +!49 U+0049 I +!4A U+004A J +!4B U+004B K +!4C U+004C L +!4D U+004D M +!4E U+004E N +!4F U+004F O +!50 U+0050 P +!51 U+0051 Q +!52 U+0052 R +!53 U+0053 S +!54 U+0054 T +!55 U+0055 U +!56 U+0056 V +!57 U+0057 W +!58 U+0058 X +!59 U+0059 Y +!5A U+005A Z +!5B U+005B bracketleft +!5C U+005C backslash +!5D U+005D bracketright +!5E U+005E asciicircum +!5F U+005F underscore +!60 U+0060 grave +!61 U+0061 a +!62 U+0062 b +!63 U+0063 c +!64 U+0064 d +!65 U+0065 e +!66 U+0066 f +!67 U+0067 g +!68 U+0068 h +!69 U+0069 i +!6A U+006A j +!6B U+006B k +!6C U+006C l +!6D U+006D m +!6E U+006E n +!6F U+006F o +!70 U+0070 p +!71 U+0071 q +!72 U+0072 r +!73 U+0073 s +!74 U+0074 t +!75 U+0075 u +!76 U+0076 v +!77 U+0077 w +!78 U+0078 x +!79 U+0079 y +!7A U+007A z +!7B U+007B braceleft +!7C U+007C bar +!7D U+007D braceright +!7E U+007E asciitilde +!7F U+007F .notdef +!80 U+0080 .notdef +!81 U+0081 .notdef +!82 U+0082 .notdef +!83 U+0083 .notdef +!84 U+0084 .notdef +!85 U+0085 .notdef +!86 U+0086 .notdef +!87 U+0087 .notdef +!88 U+0088 .notdef +!89 U+0089 .notdef +!8A U+008A .notdef +!8B U+008B .notdef +!8C U+008C .notdef +!8D U+008D .notdef +!8E U+008E .notdef +!8F U+008F .notdef +!90 U+0090 .notdef +!91 U+0091 .notdef +!92 U+0092 .notdef +!93 U+0093 .notdef +!94 U+0094 .notdef +!95 U+0095 .notdef +!96 U+0096 .notdef +!97 U+0097 .notdef +!98 U+0098 .notdef +!99 U+0099 .notdef +!9A U+009A .notdef +!9B U+009B .notdef +!9C U+009C .notdef +!9D U+009D .notdef +!9E U+009E .notdef +!9F U+009F .notdef +!A0 U+00A0 space +!A1 U+00A1 exclamdown +!A2 U+00A2 cent +!A3 U+00A3 sterling +!A4 U+20AC Euro +!A5 U+00A5 yen +!A6 U+0160 Scaron +!A7 U+00A7 section +!A8 U+0161 scaron +!A9 U+00A9 copyright +!AA U+00AA ordfeminine +!AB U+00AB guillemotleft +!AC U+00AC logicalnot +!AD U+00AD hyphen +!AE U+00AE registered +!AF U+00AF macron +!B0 U+00B0 degree +!B1 U+00B1 plusminus +!B2 U+00B2 twosuperior +!B3 U+00B3 threesuperior +!B4 U+017D Zcaron +!B5 U+00B5 mu +!B6 U+00B6 paragraph +!B7 U+00B7 periodcentered +!B8 U+017E zcaron +!B9 U+00B9 onesuperior +!BA U+00BA ordmasculine +!BB U+00BB guillemotright +!BC U+0152 OE +!BD U+0153 oe +!BE U+0178 Ydieresis +!BF U+00BF questiondown +!C0 U+00C0 Agrave +!C1 U+00C1 Aacute +!C2 U+00C2 Acircumflex +!C3 U+00C3 Atilde +!C4 U+00C4 Adieresis +!C5 U+00C5 Aring +!C6 U+00C6 AE +!C7 U+00C7 Ccedilla +!C8 U+00C8 Egrave +!C9 U+00C9 Eacute +!CA U+00CA Ecircumflex +!CB U+00CB Edieresis +!CC U+00CC Igrave +!CD U+00CD Iacute +!CE U+00CE Icircumflex +!CF U+00CF Idieresis +!D0 U+00D0 Eth +!D1 U+00D1 Ntilde +!D2 U+00D2 Ograve +!D3 U+00D3 Oacute +!D4 U+00D4 Ocircumflex +!D5 U+00D5 Otilde +!D6 U+00D6 Odieresis +!D7 U+00D7 multiply +!D8 U+00D8 Oslash +!D9 U+00D9 Ugrave +!DA U+00DA Uacute +!DB U+00DB Ucircumflex +!DC U+00DC Udieresis +!DD U+00DD Yacute +!DE U+00DE Thorn +!DF U+00DF germandbls +!E0 U+00E0 agrave +!E1 U+00E1 aacute +!E2 U+00E2 acircumflex +!E3 U+00E3 atilde +!E4 U+00E4 adieresis +!E5 U+00E5 aring +!E6 U+00E6 ae +!E7 U+00E7 ccedilla +!E8 U+00E8 egrave +!E9 U+00E9 eacute +!EA U+00EA ecircumflex +!EB U+00EB edieresis +!EC U+00EC igrave +!ED U+00ED iacute +!EE U+00EE icircumflex +!EF U+00EF idieresis +!F0 U+00F0 eth +!F1 U+00F1 ntilde +!F2 U+00F2 ograve +!F3 U+00F3 oacute +!F4 U+00F4 ocircumflex +!F5 U+00F5 otilde +!F6 U+00F6 odieresis +!F7 U+00F7 divide +!F8 U+00F8 oslash +!F9 U+00F9 ugrave +!FA U+00FA uacute +!FB U+00FB ucircumflex +!FC U+00FC udieresis +!FD U+00FD yacute +!FE U+00FE thorn +!FF U+00FF ydieresis diff --git a/lib/dompdf/lib/php-font-lib/maps/iso-8859-16.map b/lib/dompdf/lib/php-font-lib/maps/iso-8859-16.map new file mode 100644 index 0000000..202c8fe --- /dev/null +++ b/lib/dompdf/lib/php-font-lib/maps/iso-8859-16.map @@ -0,0 +1,256 @@ +!00 U+0000 .notdef +!01 U+0001 .notdef +!02 U+0002 .notdef +!03 U+0003 .notdef +!04 U+0004 .notdef +!05 U+0005 .notdef +!06 U+0006 .notdef +!07 U+0007 .notdef +!08 U+0008 .notdef +!09 U+0009 .notdef +!0A U+000A .notdef +!0B U+000B .notdef +!0C U+000C .notdef +!0D U+000D .notdef +!0E U+000E .notdef +!0F U+000F .notdef +!10 U+0010 .notdef +!11 U+0011 .notdef +!12 U+0012 .notdef +!13 U+0013 .notdef +!14 U+0014 .notdef +!15 U+0015 .notdef +!16 U+0016 .notdef +!17 U+0017 .notdef +!18 U+0018 .notdef +!19 U+0019 .notdef +!1A U+001A .notdef +!1B U+001B .notdef +!1C U+001C .notdef +!1D U+001D .notdef +!1E U+001E .notdef +!1F U+001F .notdef +!20 U+0020 space +!21 U+0021 exclam +!22 U+0022 quotedbl +!23 U+0023 numbersign +!24 U+0024 dollar +!25 U+0025 percent +!26 U+0026 ampersand +!27 U+0027 quotesingle +!28 U+0028 parenleft +!29 U+0029 parenright +!2A U+002A asterisk +!2B U+002B plus +!2C U+002C comma +!2D U+002D hyphen +!2E U+002E period +!2F U+002F slash +!30 U+0030 zero +!31 U+0031 one +!32 U+0032 two +!33 U+0033 three +!34 U+0034 four +!35 U+0035 five +!36 U+0036 six +!37 U+0037 seven +!38 U+0038 eight +!39 U+0039 nine +!3A U+003A colon +!3B U+003B semicolon +!3C U+003C less +!3D U+003D equal +!3E U+003E greater +!3F U+003F question +!40 U+0040 at +!41 U+0041 A +!42 U+0042 B +!43 U+0043 C +!44 U+0044 D +!45 U+0045 E +!46 U+0046 F +!47 U+0047 G +!48 U+0048 H +!49 U+0049 I +!4A U+004A J +!4B U+004B K +!4C U+004C L +!4D U+004D M +!4E U+004E N +!4F U+004F O +!50 U+0050 P +!51 U+0051 Q +!52 U+0052 R +!53 U+0053 S +!54 U+0054 T +!55 U+0055 U +!56 U+0056 V +!57 U+0057 W +!58 U+0058 X +!59 U+0059 Y +!5A U+005A Z +!5B U+005B bracketleft +!5C U+005C backslash +!5D U+005D bracketright +!5E U+005E asciicircum +!5F U+005F underscore +!60 U+0060 grave +!61 U+0061 a +!62 U+0062 b +!63 U+0063 c +!64 U+0064 d +!65 U+0065 e +!66 U+0066 f +!67 U+0067 g +!68 U+0068 h +!69 U+0069 i +!6A U+006A j +!6B U+006B k +!6C U+006C l +!6D U+006D m +!6E U+006E n +!6F U+006F o +!70 U+0070 p +!71 U+0071 q +!72 U+0072 r +!73 U+0073 s +!74 U+0074 t +!75 U+0075 u +!76 U+0076 v +!77 U+0077 w +!78 U+0078 x +!79 U+0079 y +!7A U+007A z +!7B U+007B braceleft +!7C U+007C bar +!7D U+007D braceright +!7E U+007E asciitilde +!7F U+007F .notdef +!80 U+0080 .notdef +!81 U+0081 .notdef +!82 U+0082 .notdef +!83 U+0083 .notdef +!84 U+0084 .notdef +!85 U+0085 .notdef +!86 U+0086 .notdef +!87 U+0087 .notdef +!88 U+0088 .notdef +!89 U+0089 .notdef +!8A U+008A .notdef +!8B U+008B .notdef +!8C U+008C .notdef +!8D U+008D .notdef +!8E U+008E .notdef +!8F U+008F .notdef +!90 U+0090 .notdef +!91 U+0091 .notdef +!92 U+0092 .notdef +!93 U+0093 .notdef +!94 U+0094 .notdef +!95 U+0095 .notdef +!96 U+0096 .notdef +!97 U+0097 .notdef +!98 U+0098 .notdef +!99 U+0099 .notdef +!9A U+009A .notdef +!9B U+009B .notdef +!9C U+009C .notdef +!9D U+009D .notdef +!9E U+009E .notdef +!9F U+009F .notdef +!A0 U+00A0 space +!A1 U+0104 Aogonek +!A2 U+0105 aogonek +!A3 U+0141 Lslash +!A4 U+20AC Euro +!A5 U+201E quotedblbase +!A6 U+0160 Scaron +!A7 U+00A7 section +!A8 U+0161 scaron +!A9 U+00A9 copyright +!AA U+0218 Scommaaccent +!AB U+00AB guillemotleft +!AC U+0179 Zacute +!AD U+00AD hyphen +!AE U+017A zacute +!AF U+017B Zdotaccent +!B0 U+00B0 degree +!B1 U+00B1 plusminus +!B2 U+010C Ccaron +!B3 U+0142 lslash +!B4 U+017D Zcaron +!B5 U+201D quotedblright +!B6 U+00B6 paragraph +!B7 U+00B7 periodcentered +!B8 U+017E zcaron +!B9 U+010D ccaron +!BA U+0219 scommaaccent +!BB U+00BB guillemotright +!BC U+0152 OE +!BD U+0153 oe +!BE U+0178 Ydieresis +!BF U+017C zdotaccent +!C0 U+00C0 Agrave +!C1 U+00C1 Aacute +!C2 U+00C2 Acircumflex +!C3 U+0102 Abreve +!C4 U+00C4 Adieresis +!C5 U+0106 Cacute +!C6 U+00C6 AE +!C7 U+00C7 Ccedilla +!C8 U+00C8 Egrave +!C9 U+00C9 Eacute +!CA U+00CA Ecircumflex +!CB U+00CB Edieresis +!CC U+00CC Igrave +!CD U+00CD Iacute +!CE U+00CE Icircumflex +!CF U+00CF Idieresis +!D0 U+0110 Dcroat +!D1 U+0143 Nacute +!D2 U+00D2 Ograve +!D3 U+00D3 Oacute +!D4 U+00D4 Ocircumflex +!D5 U+0150 Ohungarumlaut +!D6 U+00D6 Odieresis +!D7 U+015A Sacute +!D8 U+0170 Uhungarumlaut +!D9 U+00D9 Ugrave +!DA U+00DA Uacute +!DB U+00DB Ucircumflex +!DC U+00DC Udieresis +!DD U+0118 Eogonek +!DE U+021A Tcommaaccent +!DF U+00DF germandbls +!E0 U+00E0 agrave +!E1 U+00E1 aacute +!E2 U+00E2 acircumflex +!E3 U+0103 abreve +!E4 U+00E4 adieresis +!E5 U+0107 cacute +!E6 U+00E6 ae +!E7 U+00E7 ccedilla +!E8 U+00E8 egrave +!E9 U+00E9 eacute +!EA U+00EA ecircumflex +!EB U+00EB edieresis +!EC U+00EC igrave +!ED U+00ED iacute +!EE U+00EE icircumflex +!EF U+00EF idieresis +!F0 U+0111 dcroat +!F1 U+0144 nacute +!F2 U+00F2 ograve +!F3 U+00F3 oacute +!F4 U+00F4 ocircumflex +!F5 U+0151 ohungarumlaut +!F6 U+00F6 odieresis +!F7 U+015B sacute +!F8 U+0171 uhungarumlaut +!F9 U+00F9 ugrave +!FA U+00FA uacute +!FB U+00FB ucircumflex +!FC U+00FC udieresis +!FD U+0119 eogonek +!FE U+021B tcommaaccent +!FF U+00FF ydieresis diff --git a/lib/dompdf/lib/php-font-lib/maps/iso-8859-2.map b/lib/dompdf/lib/php-font-lib/maps/iso-8859-2.map new file mode 100644 index 0000000..65ae09f --- /dev/null +++ b/lib/dompdf/lib/php-font-lib/maps/iso-8859-2.map @@ -0,0 +1,256 @@ +!00 U+0000 .notdef +!01 U+0001 .notdef +!02 U+0002 .notdef +!03 U+0003 .notdef +!04 U+0004 .notdef +!05 U+0005 .notdef +!06 U+0006 .notdef +!07 U+0007 .notdef +!08 U+0008 .notdef +!09 U+0009 .notdef +!0A U+000A .notdef +!0B U+000B .notdef +!0C U+000C .notdef +!0D U+000D .notdef +!0E U+000E .notdef +!0F U+000F .notdef +!10 U+0010 .notdef +!11 U+0011 .notdef +!12 U+0012 .notdef +!13 U+0013 .notdef +!14 U+0014 .notdef +!15 U+0015 .notdef +!16 U+0016 .notdef +!17 U+0017 .notdef +!18 U+0018 .notdef +!19 U+0019 .notdef +!1A U+001A .notdef +!1B U+001B .notdef +!1C U+001C .notdef +!1D U+001D .notdef +!1E U+001E .notdef +!1F U+001F .notdef +!20 U+0020 space +!21 U+0021 exclam +!22 U+0022 quotedbl +!23 U+0023 numbersign +!24 U+0024 dollar +!25 U+0025 percent +!26 U+0026 ampersand +!27 U+0027 quotesingle +!28 U+0028 parenleft +!29 U+0029 parenright +!2A U+002A asterisk +!2B U+002B plus +!2C U+002C comma +!2D U+002D hyphen +!2E U+002E period +!2F U+002F slash +!30 U+0030 zero +!31 U+0031 one +!32 U+0032 two +!33 U+0033 three +!34 U+0034 four +!35 U+0035 five +!36 U+0036 six +!37 U+0037 seven +!38 U+0038 eight +!39 U+0039 nine +!3A U+003A colon +!3B U+003B semicolon +!3C U+003C less +!3D U+003D equal +!3E U+003E greater +!3F U+003F question +!40 U+0040 at +!41 U+0041 A +!42 U+0042 B +!43 U+0043 C +!44 U+0044 D +!45 U+0045 E +!46 U+0046 F +!47 U+0047 G +!48 U+0048 H +!49 U+0049 I +!4A U+004A J +!4B U+004B K +!4C U+004C L +!4D U+004D M +!4E U+004E N +!4F U+004F O +!50 U+0050 P +!51 U+0051 Q +!52 U+0052 R +!53 U+0053 S +!54 U+0054 T +!55 U+0055 U +!56 U+0056 V +!57 U+0057 W +!58 U+0058 X +!59 U+0059 Y +!5A U+005A Z +!5B U+005B bracketleft +!5C U+005C backslash +!5D U+005D bracketright +!5E U+005E asciicircum +!5F U+005F underscore +!60 U+0060 grave +!61 U+0061 a +!62 U+0062 b +!63 U+0063 c +!64 U+0064 d +!65 U+0065 e +!66 U+0066 f +!67 U+0067 g +!68 U+0068 h +!69 U+0069 i +!6A U+006A j +!6B U+006B k +!6C U+006C l +!6D U+006D m +!6E U+006E n +!6F U+006F o +!70 U+0070 p +!71 U+0071 q +!72 U+0072 r +!73 U+0073 s +!74 U+0074 t +!75 U+0075 u +!76 U+0076 v +!77 U+0077 w +!78 U+0078 x +!79 U+0079 y +!7A U+007A z +!7B U+007B braceleft +!7C U+007C bar +!7D U+007D braceright +!7E U+007E asciitilde +!7F U+007F .notdef +!80 U+0080 .notdef +!81 U+0081 .notdef +!82 U+0082 .notdef +!83 U+0083 .notdef +!84 U+0084 .notdef +!85 U+0085 .notdef +!86 U+0086 .notdef +!87 U+0087 .notdef +!88 U+0088 .notdef +!89 U+0089 .notdef +!8A U+008A .notdef +!8B U+008B .notdef +!8C U+008C .notdef +!8D U+008D .notdef +!8E U+008E .notdef +!8F U+008F .notdef +!90 U+0090 .notdef +!91 U+0091 .notdef +!92 U+0092 .notdef +!93 U+0093 .notdef +!94 U+0094 .notdef +!95 U+0095 .notdef +!96 U+0096 .notdef +!97 U+0097 .notdef +!98 U+0098 .notdef +!99 U+0099 .notdef +!9A U+009A .notdef +!9B U+009B .notdef +!9C U+009C .notdef +!9D U+009D .notdef +!9E U+009E .notdef +!9F U+009F .notdef +!A0 U+00A0 space +!A1 U+0104 Aogonek +!A2 U+02D8 breve +!A3 U+0141 Lslash +!A4 U+00A4 currency +!A5 U+013D Lcaron +!A6 U+015A Sacute +!A7 U+00A7 section +!A8 U+00A8 dieresis +!A9 U+0160 Scaron +!AA U+015E Scedilla +!AB U+0164 Tcaron +!AC U+0179 Zacute +!AD U+00AD hyphen +!AE U+017D Zcaron +!AF U+017B Zdotaccent +!B0 U+00B0 degree +!B1 U+0105 aogonek +!B2 U+02DB ogonek +!B3 U+0142 lslash +!B4 U+00B4 acute +!B5 U+013E lcaron +!B6 U+015B sacute +!B7 U+02C7 caron +!B8 U+00B8 cedilla +!B9 U+0161 scaron +!BA U+015F scedilla +!BB U+0165 tcaron +!BC U+017A zacute +!BD U+02DD hungarumlaut +!BE U+017E zcaron +!BF U+017C zdotaccent +!C0 U+0154 Racute +!C1 U+00C1 Aacute +!C2 U+00C2 Acircumflex +!C3 U+0102 Abreve +!C4 U+00C4 Adieresis +!C5 U+0139 Lacute +!C6 U+0106 Cacute +!C7 U+00C7 Ccedilla +!C8 U+010C Ccaron +!C9 U+00C9 Eacute +!CA U+0118 Eogonek +!CB U+00CB Edieresis +!CC U+011A Ecaron +!CD U+00CD Iacute +!CE U+00CE Icircumflex +!CF U+010E Dcaron +!D0 U+0110 Dcroat +!D1 U+0143 Nacute +!D2 U+0147 Ncaron +!D3 U+00D3 Oacute +!D4 U+00D4 Ocircumflex +!D5 U+0150 Ohungarumlaut +!D6 U+00D6 Odieresis +!D7 U+00D7 multiply +!D8 U+0158 Rcaron +!D9 U+016E Uring +!DA U+00DA Uacute +!DB U+0170 Uhungarumlaut +!DC U+00DC Udieresis +!DD U+00DD Yacute +!DE U+0162 Tcommaaccent +!DF U+00DF germandbls +!E0 U+0155 racute +!E1 U+00E1 aacute +!E2 U+00E2 acircumflex +!E3 U+0103 abreve +!E4 U+00E4 adieresis +!E5 U+013A lacute +!E6 U+0107 cacute +!E7 U+00E7 ccedilla +!E8 U+010D ccaron +!E9 U+00E9 eacute +!EA U+0119 eogonek +!EB U+00EB edieresis +!EC U+011B ecaron +!ED U+00ED iacute +!EE U+00EE icircumflex +!EF U+010F dcaron +!F0 U+0111 dcroat +!F1 U+0144 nacute +!F2 U+0148 ncaron +!F3 U+00F3 oacute +!F4 U+00F4 ocircumflex +!F5 U+0151 ohungarumlaut +!F6 U+00F6 odieresis +!F7 U+00F7 divide +!F8 U+0159 rcaron +!F9 U+016F uring +!FA U+00FA uacute +!FB U+0171 uhungarumlaut +!FC U+00FC udieresis +!FD U+00FD yacute +!FE U+0163 tcommaaccent +!FF U+02D9 dotaccent diff --git a/lib/dompdf/lib/php-font-lib/maps/iso-8859-4.map b/lib/dompdf/lib/php-font-lib/maps/iso-8859-4.map new file mode 100644 index 0000000..a7d87bf --- /dev/null +++ b/lib/dompdf/lib/php-font-lib/maps/iso-8859-4.map @@ -0,0 +1,256 @@ +!00 U+0000 .notdef +!01 U+0001 .notdef +!02 U+0002 .notdef +!03 U+0003 .notdef +!04 U+0004 .notdef +!05 U+0005 .notdef +!06 U+0006 .notdef +!07 U+0007 .notdef +!08 U+0008 .notdef +!09 U+0009 .notdef +!0A U+000A .notdef +!0B U+000B .notdef +!0C U+000C .notdef +!0D U+000D .notdef +!0E U+000E .notdef +!0F U+000F .notdef +!10 U+0010 .notdef +!11 U+0011 .notdef +!12 U+0012 .notdef +!13 U+0013 .notdef +!14 U+0014 .notdef +!15 U+0015 .notdef +!16 U+0016 .notdef +!17 U+0017 .notdef +!18 U+0018 .notdef +!19 U+0019 .notdef +!1A U+001A .notdef +!1B U+001B .notdef +!1C U+001C .notdef +!1D U+001D .notdef +!1E U+001E .notdef +!1F U+001F .notdef +!20 U+0020 space +!21 U+0021 exclam +!22 U+0022 quotedbl +!23 U+0023 numbersign +!24 U+0024 dollar +!25 U+0025 percent +!26 U+0026 ampersand +!27 U+0027 quotesingle +!28 U+0028 parenleft +!29 U+0029 parenright +!2A U+002A asterisk +!2B U+002B plus +!2C U+002C comma +!2D U+002D hyphen +!2E U+002E period +!2F U+002F slash +!30 U+0030 zero +!31 U+0031 one +!32 U+0032 two +!33 U+0033 three +!34 U+0034 four +!35 U+0035 five +!36 U+0036 six +!37 U+0037 seven +!38 U+0038 eight +!39 U+0039 nine +!3A U+003A colon +!3B U+003B semicolon +!3C U+003C less +!3D U+003D equal +!3E U+003E greater +!3F U+003F question +!40 U+0040 at +!41 U+0041 A +!42 U+0042 B +!43 U+0043 C +!44 U+0044 D +!45 U+0045 E +!46 U+0046 F +!47 U+0047 G +!48 U+0048 H +!49 U+0049 I +!4A U+004A J +!4B U+004B K +!4C U+004C L +!4D U+004D M +!4E U+004E N +!4F U+004F O +!50 U+0050 P +!51 U+0051 Q +!52 U+0052 R +!53 U+0053 S +!54 U+0054 T +!55 U+0055 U +!56 U+0056 V +!57 U+0057 W +!58 U+0058 X +!59 U+0059 Y +!5A U+005A Z +!5B U+005B bracketleft +!5C U+005C backslash +!5D U+005D bracketright +!5E U+005E asciicircum +!5F U+005F underscore +!60 U+0060 grave +!61 U+0061 a +!62 U+0062 b +!63 U+0063 c +!64 U+0064 d +!65 U+0065 e +!66 U+0066 f +!67 U+0067 g +!68 U+0068 h +!69 U+0069 i +!6A U+006A j +!6B U+006B k +!6C U+006C l +!6D U+006D m +!6E U+006E n +!6F U+006F o +!70 U+0070 p +!71 U+0071 q +!72 U+0072 r +!73 U+0073 s +!74 U+0074 t +!75 U+0075 u +!76 U+0076 v +!77 U+0077 w +!78 U+0078 x +!79 U+0079 y +!7A U+007A z +!7B U+007B braceleft +!7C U+007C bar +!7D U+007D braceright +!7E U+007E asciitilde +!7F U+007F .notdef +!80 U+0080 .notdef +!81 U+0081 .notdef +!82 U+0082 .notdef +!83 U+0083 .notdef +!84 U+0084 .notdef +!85 U+0085 .notdef +!86 U+0086 .notdef +!87 U+0087 .notdef +!88 U+0088 .notdef +!89 U+0089 .notdef +!8A U+008A .notdef +!8B U+008B .notdef +!8C U+008C .notdef +!8D U+008D .notdef +!8E U+008E .notdef +!8F U+008F .notdef +!90 U+0090 .notdef +!91 U+0091 .notdef +!92 U+0092 .notdef +!93 U+0093 .notdef +!94 U+0094 .notdef +!95 U+0095 .notdef +!96 U+0096 .notdef +!97 U+0097 .notdef +!98 U+0098 .notdef +!99 U+0099 .notdef +!9A U+009A .notdef +!9B U+009B .notdef +!9C U+009C .notdef +!9D U+009D .notdef +!9E U+009E .notdef +!9F U+009F .notdef +!A0 U+00A0 space +!A1 U+0104 Aogonek +!A2 U+0138 kgreenlandic +!A3 U+0156 Rcommaaccent +!A4 U+00A4 currency +!A5 U+0128 Itilde +!A6 U+013B Lcommaaccent +!A7 U+00A7 section +!A8 U+00A8 dieresis +!A9 U+0160 Scaron +!AA U+0112 Emacron +!AB U+0122 Gcommaaccent +!AC U+0166 Tbar +!AD U+00AD hyphen +!AE U+017D Zcaron +!AF U+00AF macron +!B0 U+00B0 degree +!B1 U+0105 aogonek +!B2 U+02DB ogonek +!B3 U+0157 rcommaaccent +!B4 U+00B4 acute +!B5 U+0129 itilde +!B6 U+013C lcommaaccent +!B7 U+02C7 caron +!B8 U+00B8 cedilla +!B9 U+0161 scaron +!BA U+0113 emacron +!BB U+0123 gcommaaccent +!BC U+0167 tbar +!BD U+014A Eng +!BE U+017E zcaron +!BF U+014B eng +!C0 U+0100 Amacron +!C1 U+00C1 Aacute +!C2 U+00C2 Acircumflex +!C3 U+00C3 Atilde +!C4 U+00C4 Adieresis +!C5 U+00C5 Aring +!C6 U+00C6 AE +!C7 U+012E Iogonek +!C8 U+010C Ccaron +!C9 U+00C9 Eacute +!CA U+0118 Eogonek +!CB U+00CB Edieresis +!CC U+0116 Edotaccent +!CD U+00CD Iacute +!CE U+00CE Icircumflex +!CF U+012A Imacron +!D0 U+0110 Dcroat +!D1 U+0145 Ncommaaccent +!D2 U+014C Omacron +!D3 U+0136 Kcommaaccent +!D4 U+00D4 Ocircumflex +!D5 U+00D5 Otilde +!D6 U+00D6 Odieresis +!D7 U+00D7 multiply +!D8 U+00D8 Oslash +!D9 U+0172 Uogonek +!DA U+00DA Uacute +!DB U+00DB Ucircumflex +!DC U+00DC Udieresis +!DD U+0168 Utilde +!DE U+016A Umacron +!DF U+00DF germandbls +!E0 U+0101 amacron +!E1 U+00E1 aacute +!E2 U+00E2 acircumflex +!E3 U+00E3 atilde +!E4 U+00E4 adieresis +!E5 U+00E5 aring +!E6 U+00E6 ae +!E7 U+012F iogonek +!E8 U+010D ccaron +!E9 U+00E9 eacute +!EA U+0119 eogonek +!EB U+00EB edieresis +!EC U+0117 edotaccent +!ED U+00ED iacute +!EE U+00EE icircumflex +!EF U+012B imacron +!F0 U+0111 dcroat +!F1 U+0146 ncommaaccent +!F2 U+014D omacron +!F3 U+0137 kcommaaccent +!F4 U+00F4 ocircumflex +!F5 U+00F5 otilde +!F6 U+00F6 odieresis +!F7 U+00F7 divide +!F8 U+00F8 oslash +!F9 U+0173 uogonek +!FA U+00FA uacute +!FB U+00FB ucircumflex +!FC U+00FC udieresis +!FD U+0169 utilde +!FE U+016B umacron +!FF U+02D9 dotaccent diff --git a/lib/dompdf/lib/php-font-lib/maps/iso-8859-5.map b/lib/dompdf/lib/php-font-lib/maps/iso-8859-5.map new file mode 100644 index 0000000..f9cd4ed --- /dev/null +++ b/lib/dompdf/lib/php-font-lib/maps/iso-8859-5.map @@ -0,0 +1,256 @@ +!00 U+0000 .notdef +!01 U+0001 .notdef +!02 U+0002 .notdef +!03 U+0003 .notdef +!04 U+0004 .notdef +!05 U+0005 .notdef +!06 U+0006 .notdef +!07 U+0007 .notdef +!08 U+0008 .notdef +!09 U+0009 .notdef +!0A U+000A .notdef +!0B U+000B .notdef +!0C U+000C .notdef +!0D U+000D .notdef +!0E U+000E .notdef +!0F U+000F .notdef +!10 U+0010 .notdef +!11 U+0011 .notdef +!12 U+0012 .notdef +!13 U+0013 .notdef +!14 U+0014 .notdef +!15 U+0015 .notdef +!16 U+0016 .notdef +!17 U+0017 .notdef +!18 U+0018 .notdef +!19 U+0019 .notdef +!1A U+001A .notdef +!1B U+001B .notdef +!1C U+001C .notdef +!1D U+001D .notdef +!1E U+001E .notdef +!1F U+001F .notdef +!20 U+0020 space +!21 U+0021 exclam +!22 U+0022 quotedbl +!23 U+0023 numbersign +!24 U+0024 dollar +!25 U+0025 percent +!26 U+0026 ampersand +!27 U+0027 quotesingle +!28 U+0028 parenleft +!29 U+0029 parenright +!2A U+002A asterisk +!2B U+002B plus +!2C U+002C comma +!2D U+002D hyphen +!2E U+002E period +!2F U+002F slash +!30 U+0030 zero +!31 U+0031 one +!32 U+0032 two +!33 U+0033 three +!34 U+0034 four +!35 U+0035 five +!36 U+0036 six +!37 U+0037 seven +!38 U+0038 eight +!39 U+0039 nine +!3A U+003A colon +!3B U+003B semicolon +!3C U+003C less +!3D U+003D equal +!3E U+003E greater +!3F U+003F question +!40 U+0040 at +!41 U+0041 A +!42 U+0042 B +!43 U+0043 C +!44 U+0044 D +!45 U+0045 E +!46 U+0046 F +!47 U+0047 G +!48 U+0048 H +!49 U+0049 I +!4A U+004A J +!4B U+004B K +!4C U+004C L +!4D U+004D M +!4E U+004E N +!4F U+004F O +!50 U+0050 P +!51 U+0051 Q +!52 U+0052 R +!53 U+0053 S +!54 U+0054 T +!55 U+0055 U +!56 U+0056 V +!57 U+0057 W +!58 U+0058 X +!59 U+0059 Y +!5A U+005A Z +!5B U+005B bracketleft +!5C U+005C backslash +!5D U+005D bracketright +!5E U+005E asciicircum +!5F U+005F underscore +!60 U+0060 grave +!61 U+0061 a +!62 U+0062 b +!63 U+0063 c +!64 U+0064 d +!65 U+0065 e +!66 U+0066 f +!67 U+0067 g +!68 U+0068 h +!69 U+0069 i +!6A U+006A j +!6B U+006B k +!6C U+006C l +!6D U+006D m +!6E U+006E n +!6F U+006F o +!70 U+0070 p +!71 U+0071 q +!72 U+0072 r +!73 U+0073 s +!74 U+0074 t +!75 U+0075 u +!76 U+0076 v +!77 U+0077 w +!78 U+0078 x +!79 U+0079 y +!7A U+007A z +!7B U+007B braceleft +!7C U+007C bar +!7D U+007D braceright +!7E U+007E asciitilde +!7F U+007F .notdef +!80 U+0080 .notdef +!81 U+0081 .notdef +!82 U+0082 .notdef +!83 U+0083 .notdef +!84 U+0084 .notdef +!85 U+0085 .notdef +!86 U+0086 .notdef +!87 U+0087 .notdef +!88 U+0088 .notdef +!89 U+0089 .notdef +!8A U+008A .notdef +!8B U+008B .notdef +!8C U+008C .notdef +!8D U+008D .notdef +!8E U+008E .notdef +!8F U+008F .notdef +!90 U+0090 .notdef +!91 U+0091 .notdef +!92 U+0092 .notdef +!93 U+0093 .notdef +!94 U+0094 .notdef +!95 U+0095 .notdef +!96 U+0096 .notdef +!97 U+0097 .notdef +!98 U+0098 .notdef +!99 U+0099 .notdef +!9A U+009A .notdef +!9B U+009B .notdef +!9C U+009C .notdef +!9D U+009D .notdef +!9E U+009E .notdef +!9F U+009F .notdef +!A0 U+00A0 space +!A1 U+0401 afii10023 +!A2 U+0402 afii10051 +!A3 U+0403 afii10052 +!A4 U+0404 afii10053 +!A5 U+0405 afii10054 +!A6 U+0406 afii10055 +!A7 U+0407 afii10056 +!A8 U+0408 afii10057 +!A9 U+0409 afii10058 +!AA U+040A afii10059 +!AB U+040B afii10060 +!AC U+040C afii10061 +!AD U+00AD hyphen +!AE U+040E afii10062 +!AF U+040F afii10145 +!B0 U+0410 afii10017 +!B1 U+0411 afii10018 +!B2 U+0412 afii10019 +!B3 U+0413 afii10020 +!B4 U+0414 afii10021 +!B5 U+0415 afii10022 +!B6 U+0416 afii10024 +!B7 U+0417 afii10025 +!B8 U+0418 afii10026 +!B9 U+0419 afii10027 +!BA U+041A afii10028 +!BB U+041B afii10029 +!BC U+041C afii10030 +!BD U+041D afii10031 +!BE U+041E afii10032 +!BF U+041F afii10033 +!C0 U+0420 afii10034 +!C1 U+0421 afii10035 +!C2 U+0422 afii10036 +!C3 U+0423 afii10037 +!C4 U+0424 afii10038 +!C5 U+0425 afii10039 +!C6 U+0426 afii10040 +!C7 U+0427 afii10041 +!C8 U+0428 afii10042 +!C9 U+0429 afii10043 +!CA U+042A afii10044 +!CB U+042B afii10045 +!CC U+042C afii10046 +!CD U+042D afii10047 +!CE U+042E afii10048 +!CF U+042F afii10049 +!D0 U+0430 afii10065 +!D1 U+0431 afii10066 +!D2 U+0432 afii10067 +!D3 U+0433 afii10068 +!D4 U+0434 afii10069 +!D5 U+0435 afii10070 +!D6 U+0436 afii10072 +!D7 U+0437 afii10073 +!D8 U+0438 afii10074 +!D9 U+0439 afii10075 +!DA U+043A afii10076 +!DB U+043B afii10077 +!DC U+043C afii10078 +!DD U+043D afii10079 +!DE U+043E afii10080 +!DF U+043F afii10081 +!E0 U+0440 afii10082 +!E1 U+0441 afii10083 +!E2 U+0442 afii10084 +!E3 U+0443 afii10085 +!E4 U+0444 afii10086 +!E5 U+0445 afii10087 +!E6 U+0446 afii10088 +!E7 U+0447 afii10089 +!E8 U+0448 afii10090 +!E9 U+0449 afii10091 +!EA U+044A afii10092 +!EB U+044B afii10093 +!EC U+044C afii10094 +!ED U+044D afii10095 +!EE U+044E afii10096 +!EF U+044F afii10097 +!F0 U+2116 afii61352 +!F1 U+0451 afii10071 +!F2 U+0452 afii10099 +!F3 U+0453 afii10100 +!F4 U+0454 afii10101 +!F5 U+0455 afii10102 +!F6 U+0456 afii10103 +!F7 U+0457 afii10104 +!F8 U+0458 afii10105 +!F9 U+0459 afii10106 +!FA U+045A afii10107 +!FB U+045B afii10108 +!FC U+045C afii10109 +!FD U+00A7 section +!FE U+045E afii10110 +!FF U+045F afii10193 diff --git a/lib/dompdf/lib/php-font-lib/maps/iso-8859-7.map b/lib/dompdf/lib/php-font-lib/maps/iso-8859-7.map new file mode 100644 index 0000000..e163796 --- /dev/null +++ b/lib/dompdf/lib/php-font-lib/maps/iso-8859-7.map @@ -0,0 +1,250 @@ +!00 U+0000 .notdef +!01 U+0001 .notdef +!02 U+0002 .notdef +!03 U+0003 .notdef +!04 U+0004 .notdef +!05 U+0005 .notdef +!06 U+0006 .notdef +!07 U+0007 .notdef +!08 U+0008 .notdef +!09 U+0009 .notdef +!0A U+000A .notdef +!0B U+000B .notdef +!0C U+000C .notdef +!0D U+000D .notdef +!0E U+000E .notdef +!0F U+000F .notdef +!10 U+0010 .notdef +!11 U+0011 .notdef +!12 U+0012 .notdef +!13 U+0013 .notdef +!14 U+0014 .notdef +!15 U+0015 .notdef +!16 U+0016 .notdef +!17 U+0017 .notdef +!18 U+0018 .notdef +!19 U+0019 .notdef +!1A U+001A .notdef +!1B U+001B .notdef +!1C U+001C .notdef +!1D U+001D .notdef +!1E U+001E .notdef +!1F U+001F .notdef +!20 U+0020 space +!21 U+0021 exclam +!22 U+0022 quotedbl +!23 U+0023 numbersign +!24 U+0024 dollar +!25 U+0025 percent +!26 U+0026 ampersand +!27 U+0027 quotesingle +!28 U+0028 parenleft +!29 U+0029 parenright +!2A U+002A asterisk +!2B U+002B plus +!2C U+002C comma +!2D U+002D hyphen +!2E U+002E period +!2F U+002F slash +!30 U+0030 zero +!31 U+0031 one +!32 U+0032 two +!33 U+0033 three +!34 U+0034 four +!35 U+0035 five +!36 U+0036 six +!37 U+0037 seven +!38 U+0038 eight +!39 U+0039 nine +!3A U+003A colon +!3B U+003B semicolon +!3C U+003C less +!3D U+003D equal +!3E U+003E greater +!3F U+003F question +!40 U+0040 at +!41 U+0041 A +!42 U+0042 B +!43 U+0043 C +!44 U+0044 D +!45 U+0045 E +!46 U+0046 F +!47 U+0047 G +!48 U+0048 H +!49 U+0049 I +!4A U+004A J +!4B U+004B K +!4C U+004C L +!4D U+004D M +!4E U+004E N +!4F U+004F O +!50 U+0050 P +!51 U+0051 Q +!52 U+0052 R +!53 U+0053 S +!54 U+0054 T +!55 U+0055 U +!56 U+0056 V +!57 U+0057 W +!58 U+0058 X +!59 U+0059 Y +!5A U+005A Z +!5B U+005B bracketleft +!5C U+005C backslash +!5D U+005D bracketright +!5E U+005E asciicircum +!5F U+005F underscore +!60 U+0060 grave +!61 U+0061 a +!62 U+0062 b +!63 U+0063 c +!64 U+0064 d +!65 U+0065 e +!66 U+0066 f +!67 U+0067 g +!68 U+0068 h +!69 U+0069 i +!6A U+006A j +!6B U+006B k +!6C U+006C l +!6D U+006D m +!6E U+006E n +!6F U+006F o +!70 U+0070 p +!71 U+0071 q +!72 U+0072 r +!73 U+0073 s +!74 U+0074 t +!75 U+0075 u +!76 U+0076 v +!77 U+0077 w +!78 U+0078 x +!79 U+0079 y +!7A U+007A z +!7B U+007B braceleft +!7C U+007C bar +!7D U+007D braceright +!7E U+007E asciitilde +!7F U+007F .notdef +!80 U+0080 .notdef +!81 U+0081 .notdef +!82 U+0082 .notdef +!83 U+0083 .notdef +!84 U+0084 .notdef +!85 U+0085 .notdef +!86 U+0086 .notdef +!87 U+0087 .notdef +!88 U+0088 .notdef +!89 U+0089 .notdef +!8A U+008A .notdef +!8B U+008B .notdef +!8C U+008C .notdef +!8D U+008D .notdef +!8E U+008E .notdef +!8F U+008F .notdef +!90 U+0090 .notdef +!91 U+0091 .notdef +!92 U+0092 .notdef +!93 U+0093 .notdef +!94 U+0094 .notdef +!95 U+0095 .notdef +!96 U+0096 .notdef +!97 U+0097 .notdef +!98 U+0098 .notdef +!99 U+0099 .notdef +!9A U+009A .notdef +!9B U+009B .notdef +!9C U+009C .notdef +!9D U+009D .notdef +!9E U+009E .notdef +!9F U+009F .notdef +!A0 U+00A0 space +!A1 U+2018 quoteleft +!A2 U+2019 quoteright +!A3 U+00A3 sterling +!A6 U+00A6 brokenbar +!A7 U+00A7 section +!A8 U+00A8 dieresis +!A9 U+00A9 copyright +!AB U+00AB guillemotleft +!AC U+00AC logicalnot +!AD U+00AD hyphen +!AF U+2015 afii00208 +!B0 U+00B0 degree +!B1 U+00B1 plusminus +!B2 U+00B2 twosuperior +!B3 U+00B3 threesuperior +!B4 U+0384 tonos +!B5 U+0385 dieresistonos +!B6 U+0386 Alphatonos +!B7 U+00B7 periodcentered +!B8 U+0388 Epsilontonos +!B9 U+0389 Etatonos +!BA U+038A Iotatonos +!BB U+00BB guillemotright +!BC U+038C Omicrontonos +!BD U+00BD onehalf +!BE U+038E Upsilontonos +!BF U+038F Omegatonos +!C0 U+0390 iotadieresistonos +!C1 U+0391 Alpha +!C2 U+0392 Beta +!C3 U+0393 Gamma +!C4 U+0394 Delta +!C5 U+0395 Epsilon +!C6 U+0396 Zeta +!C7 U+0397 Eta +!C8 U+0398 Theta +!C9 U+0399 Iota +!CA U+039A Kappa +!CB U+039B Lambda +!CC U+039C Mu +!CD U+039D Nu +!CE U+039E Xi +!CF U+039F Omicron +!D0 U+03A0 Pi +!D1 U+03A1 Rho +!D3 U+03A3 Sigma +!D4 U+03A4 Tau +!D5 U+03A5 Upsilon +!D6 U+03A6 Phi +!D7 U+03A7 Chi +!D8 U+03A8 Psi +!D9 U+03A9 Omega +!DA U+03AA Iotadieresis +!DB U+03AB Upsilondieresis +!DC U+03AC alphatonos +!DD U+03AD epsilontonos +!DE U+03AE etatonos +!DF U+03AF iotatonos +!E0 U+03B0 upsilondieresistonos +!E1 U+03B1 alpha +!E2 U+03B2 beta +!E3 U+03B3 gamma +!E4 U+03B4 delta +!E5 U+03B5 epsilon +!E6 U+03B6 zeta +!E7 U+03B7 eta +!E8 U+03B8 theta +!E9 U+03B9 iota +!EA U+03BA kappa +!EB U+03BB lambda +!EC U+03BC mu +!ED U+03BD nu +!EE U+03BE xi +!EF U+03BF omicron +!F0 U+03C0 pi +!F1 U+03C1 rho +!F2 U+03C2 sigma1 +!F3 U+03C3 sigma +!F4 U+03C4 tau +!F5 U+03C5 upsilon +!F6 U+03C6 phi +!F7 U+03C7 chi +!F8 U+03C8 psi +!F9 U+03C9 omega +!FA U+03CA iotadieresis +!FB U+03CB upsilondieresis +!FC U+03CC omicrontonos +!FD U+03CD upsilontonos +!FE U+03CE omegatonos diff --git a/lib/dompdf/lib/php-font-lib/maps/iso-8859-9.map b/lib/dompdf/lib/php-font-lib/maps/iso-8859-9.map new file mode 100644 index 0000000..48c123a --- /dev/null +++ b/lib/dompdf/lib/php-font-lib/maps/iso-8859-9.map @@ -0,0 +1,256 @@ +!00 U+0000 .notdef +!01 U+0001 .notdef +!02 U+0002 .notdef +!03 U+0003 .notdef +!04 U+0004 .notdef +!05 U+0005 .notdef +!06 U+0006 .notdef +!07 U+0007 .notdef +!08 U+0008 .notdef +!09 U+0009 .notdef +!0A U+000A .notdef +!0B U+000B .notdef +!0C U+000C .notdef +!0D U+000D .notdef +!0E U+000E .notdef +!0F U+000F .notdef +!10 U+0010 .notdef +!11 U+0011 .notdef +!12 U+0012 .notdef +!13 U+0013 .notdef +!14 U+0014 .notdef +!15 U+0015 .notdef +!16 U+0016 .notdef +!17 U+0017 .notdef +!18 U+0018 .notdef +!19 U+0019 .notdef +!1A U+001A .notdef +!1B U+001B .notdef +!1C U+001C .notdef +!1D U+001D .notdef +!1E U+001E .notdef +!1F U+001F .notdef +!20 U+0020 space +!21 U+0021 exclam +!22 U+0022 quotedbl +!23 U+0023 numbersign +!24 U+0024 dollar +!25 U+0025 percent +!26 U+0026 ampersand +!27 U+0027 quotesingle +!28 U+0028 parenleft +!29 U+0029 parenright +!2A U+002A asterisk +!2B U+002B plus +!2C U+002C comma +!2D U+002D hyphen +!2E U+002E period +!2F U+002F slash +!30 U+0030 zero +!31 U+0031 one +!32 U+0032 two +!33 U+0033 three +!34 U+0034 four +!35 U+0035 five +!36 U+0036 six +!37 U+0037 seven +!38 U+0038 eight +!39 U+0039 nine +!3A U+003A colon +!3B U+003B semicolon +!3C U+003C less +!3D U+003D equal +!3E U+003E greater +!3F U+003F question +!40 U+0040 at +!41 U+0041 A +!42 U+0042 B +!43 U+0043 C +!44 U+0044 D +!45 U+0045 E +!46 U+0046 F +!47 U+0047 G +!48 U+0048 H +!49 U+0049 I +!4A U+004A J +!4B U+004B K +!4C U+004C L +!4D U+004D M +!4E U+004E N +!4F U+004F O +!50 U+0050 P +!51 U+0051 Q +!52 U+0052 R +!53 U+0053 S +!54 U+0054 T +!55 U+0055 U +!56 U+0056 V +!57 U+0057 W +!58 U+0058 X +!59 U+0059 Y +!5A U+005A Z +!5B U+005B bracketleft +!5C U+005C backslash +!5D U+005D bracketright +!5E U+005E asciicircum +!5F U+005F underscore +!60 U+0060 grave +!61 U+0061 a +!62 U+0062 b +!63 U+0063 c +!64 U+0064 d +!65 U+0065 e +!66 U+0066 f +!67 U+0067 g +!68 U+0068 h +!69 U+0069 i +!6A U+006A j +!6B U+006B k +!6C U+006C l +!6D U+006D m +!6E U+006E n +!6F U+006F o +!70 U+0070 p +!71 U+0071 q +!72 U+0072 r +!73 U+0073 s +!74 U+0074 t +!75 U+0075 u +!76 U+0076 v +!77 U+0077 w +!78 U+0078 x +!79 U+0079 y +!7A U+007A z +!7B U+007B braceleft +!7C U+007C bar +!7D U+007D braceright +!7E U+007E asciitilde +!7F U+007F .notdef +!80 U+0080 .notdef +!81 U+0081 .notdef +!82 U+0082 .notdef +!83 U+0083 .notdef +!84 U+0084 .notdef +!85 U+0085 .notdef +!86 U+0086 .notdef +!87 U+0087 .notdef +!88 U+0088 .notdef +!89 U+0089 .notdef +!8A U+008A .notdef +!8B U+008B .notdef +!8C U+008C .notdef +!8D U+008D .notdef +!8E U+008E .notdef +!8F U+008F .notdef +!90 U+0090 .notdef +!91 U+0091 .notdef +!92 U+0092 .notdef +!93 U+0093 .notdef +!94 U+0094 .notdef +!95 U+0095 .notdef +!96 U+0096 .notdef +!97 U+0097 .notdef +!98 U+0098 .notdef +!99 U+0099 .notdef +!9A U+009A .notdef +!9B U+009B .notdef +!9C U+009C .notdef +!9D U+009D .notdef +!9E U+009E .notdef +!9F U+009F .notdef +!A0 U+00A0 space +!A1 U+00A1 exclamdown +!A2 U+00A2 cent +!A3 U+00A3 sterling +!A4 U+00A4 currency +!A5 U+00A5 yen +!A6 U+00A6 brokenbar +!A7 U+00A7 section +!A8 U+00A8 dieresis +!A9 U+00A9 copyright +!AA U+00AA ordfeminine +!AB U+00AB guillemotleft +!AC U+00AC logicalnot +!AD U+00AD hyphen +!AE U+00AE registered +!AF U+00AF macron +!B0 U+00B0 degree +!B1 U+00B1 plusminus +!B2 U+00B2 twosuperior +!B3 U+00B3 threesuperior +!B4 U+00B4 acute +!B5 U+00B5 mu +!B6 U+00B6 paragraph +!B7 U+00B7 periodcentered +!B8 U+00B8 cedilla +!B9 U+00B9 onesuperior +!BA U+00BA ordmasculine +!BB U+00BB guillemotright +!BC U+00BC onequarter +!BD U+00BD onehalf +!BE U+00BE threequarters +!BF U+00BF questiondown +!C0 U+00C0 Agrave +!C1 U+00C1 Aacute +!C2 U+00C2 Acircumflex +!C3 U+00C3 Atilde +!C4 U+00C4 Adieresis +!C5 U+00C5 Aring +!C6 U+00C6 AE +!C7 U+00C7 Ccedilla +!C8 U+00C8 Egrave +!C9 U+00C9 Eacute +!CA U+00CA Ecircumflex +!CB U+00CB Edieresis +!CC U+00CC Igrave +!CD U+00CD Iacute +!CE U+00CE Icircumflex +!CF U+00CF Idieresis +!D0 U+011E Gbreve +!D1 U+00D1 Ntilde +!D2 U+00D2 Ograve +!D3 U+00D3 Oacute +!D4 U+00D4 Ocircumflex +!D5 U+00D5 Otilde +!D6 U+00D6 Odieresis +!D7 U+00D7 multiply +!D8 U+00D8 Oslash +!D9 U+00D9 Ugrave +!DA U+00DA Uacute +!DB U+00DB Ucircumflex +!DC U+00DC Udieresis +!DD U+0130 Idotaccent +!DE U+015E Scedilla +!DF U+00DF germandbls +!E0 U+00E0 agrave +!E1 U+00E1 aacute +!E2 U+00E2 acircumflex +!E3 U+00E3 atilde +!E4 U+00E4 adieresis +!E5 U+00E5 aring +!E6 U+00E6 ae +!E7 U+00E7 ccedilla +!E8 U+00E8 egrave +!E9 U+00E9 eacute +!EA U+00EA ecircumflex +!EB U+00EB edieresis +!EC U+00EC igrave +!ED U+00ED iacute +!EE U+00EE icircumflex +!EF U+00EF idieresis +!F0 U+011F gbreve +!F1 U+00F1 ntilde +!F2 U+00F2 ograve +!F3 U+00F3 oacute +!F4 U+00F4 ocircumflex +!F5 U+00F5 otilde +!F6 U+00F6 odieresis +!F7 U+00F7 divide +!F8 U+00F8 oslash +!F9 U+00F9 ugrave +!FA U+00FA uacute +!FB U+00FB ucircumflex +!FC U+00FC udieresis +!FD U+0131 dotlessi +!FE U+015F scedilla +!FF U+00FF ydieresis diff --git a/lib/dompdf/lib/php-font-lib/maps/koi8-r.map b/lib/dompdf/lib/php-font-lib/maps/koi8-r.map new file mode 100644 index 0000000..6ad5d05 --- /dev/null +++ b/lib/dompdf/lib/php-font-lib/maps/koi8-r.map @@ -0,0 +1,256 @@ +!00 U+0000 .notdef +!01 U+0001 .notdef +!02 U+0002 .notdef +!03 U+0003 .notdef +!04 U+0004 .notdef +!05 U+0005 .notdef +!06 U+0006 .notdef +!07 U+0007 .notdef +!08 U+0008 .notdef +!09 U+0009 .notdef +!0A U+000A .notdef +!0B U+000B .notdef +!0C U+000C .notdef +!0D U+000D .notdef +!0E U+000E .notdef +!0F U+000F .notdef +!10 U+0010 .notdef +!11 U+0011 .notdef +!12 U+0012 .notdef +!13 U+0013 .notdef +!14 U+0014 .notdef +!15 U+0015 .notdef +!16 U+0016 .notdef +!17 U+0017 .notdef +!18 U+0018 .notdef +!19 U+0019 .notdef +!1A U+001A .notdef +!1B U+001B .notdef +!1C U+001C .notdef +!1D U+001D .notdef +!1E U+001E .notdef +!1F U+001F .notdef +!20 U+0020 space +!21 U+0021 exclam +!22 U+0022 quotedbl +!23 U+0023 numbersign +!24 U+0024 dollar +!25 U+0025 percent +!26 U+0026 ampersand +!27 U+0027 quotesingle +!28 U+0028 parenleft +!29 U+0029 parenright +!2A U+002A asterisk +!2B U+002B plus +!2C U+002C comma +!2D U+002D hyphen +!2E U+002E period +!2F U+002F slash +!30 U+0030 zero +!31 U+0031 one +!32 U+0032 two +!33 U+0033 three +!34 U+0034 four +!35 U+0035 five +!36 U+0036 six +!37 U+0037 seven +!38 U+0038 eight +!39 U+0039 nine +!3A U+003A colon +!3B U+003B semicolon +!3C U+003C less +!3D U+003D equal +!3E U+003E greater +!3F U+003F question +!40 U+0040 at +!41 U+0041 A +!42 U+0042 B +!43 U+0043 C +!44 U+0044 D +!45 U+0045 E +!46 U+0046 F +!47 U+0047 G +!48 U+0048 H +!49 U+0049 I +!4A U+004A J +!4B U+004B K +!4C U+004C L +!4D U+004D M +!4E U+004E N +!4F U+004F O +!50 U+0050 P +!51 U+0051 Q +!52 U+0052 R +!53 U+0053 S +!54 U+0054 T +!55 U+0055 U +!56 U+0056 V +!57 U+0057 W +!58 U+0058 X +!59 U+0059 Y +!5A U+005A Z +!5B U+005B bracketleft +!5C U+005C backslash +!5D U+005D bracketright +!5E U+005E asciicircum +!5F U+005F underscore +!60 U+0060 grave +!61 U+0061 a +!62 U+0062 b +!63 U+0063 c +!64 U+0064 d +!65 U+0065 e +!66 U+0066 f +!67 U+0067 g +!68 U+0068 h +!69 U+0069 i +!6A U+006A j +!6B U+006B k +!6C U+006C l +!6D U+006D m +!6E U+006E n +!6F U+006F o +!70 U+0070 p +!71 U+0071 q +!72 U+0072 r +!73 U+0073 s +!74 U+0074 t +!75 U+0075 u +!76 U+0076 v +!77 U+0077 w +!78 U+0078 x +!79 U+0079 y +!7A U+007A z +!7B U+007B braceleft +!7C U+007C bar +!7D U+007D braceright +!7E U+007E asciitilde +!7F U+007F .notdef +!80 U+2500 SF100000 +!81 U+2502 SF110000 +!82 U+250C SF010000 +!83 U+2510 SF030000 +!84 U+2514 SF020000 +!85 U+2518 SF040000 +!86 U+251C SF080000 +!87 U+2524 SF090000 +!88 U+252C SF060000 +!89 U+2534 SF070000 +!8A U+253C SF050000 +!8B U+2580 upblock +!8C U+2584 dnblock +!8D U+2588 block +!8E U+258C lfblock +!8F U+2590 rtblock +!90 U+2591 ltshade +!91 U+2592 shade +!92 U+2593 dkshade +!93 U+2320 integraltp +!94 U+25A0 filledbox +!95 U+2219 periodcentered +!96 U+221A radical +!97 U+2248 approxequal +!98 U+2264 lessequal +!99 U+2265 greaterequal +!9A U+00A0 space +!9B U+2321 integralbt +!9C U+00B0 degree +!9D U+00B2 twosuperior +!9E U+00B7 periodcentered +!9F U+00F7 divide +!A0 U+2550 SF430000 +!A1 U+2551 SF240000 +!A2 U+2552 SF510000 +!A3 U+0451 afii10071 +!A4 U+2553 SF520000 +!A5 U+2554 SF390000 +!A6 U+2555 SF220000 +!A7 U+2556 SF210000 +!A8 U+2557 SF250000 +!A9 U+2558 SF500000 +!AA U+2559 SF490000 +!AB U+255A SF380000 +!AC U+255B SF280000 +!AD U+255C SF270000 +!AE U+255D SF260000 +!AF U+255E SF360000 +!B0 U+255F SF370000 +!B1 U+2560 SF420000 +!B2 U+2561 SF190000 +!B3 U+0401 afii10023 +!B4 U+2562 SF200000 +!B5 U+2563 SF230000 +!B6 U+2564 SF470000 +!B7 U+2565 SF480000 +!B8 U+2566 SF410000 +!B9 U+2567 SF450000 +!BA U+2568 SF460000 +!BB U+2569 SF400000 +!BC U+256A SF540000 +!BD U+256B SF530000 +!BE U+256C SF440000 +!BF U+00A9 copyright +!C0 U+044E afii10096 +!C1 U+0430 afii10065 +!C2 U+0431 afii10066 +!C3 U+0446 afii10088 +!C4 U+0434 afii10069 +!C5 U+0435 afii10070 +!C6 U+0444 afii10086 +!C7 U+0433 afii10068 +!C8 U+0445 afii10087 +!C9 U+0438 afii10074 +!CA U+0439 afii10075 +!CB U+043A afii10076 +!CC U+043B afii10077 +!CD U+043C afii10078 +!CE U+043D afii10079 +!CF U+043E afii10080 +!D0 U+043F afii10081 +!D1 U+044F afii10097 +!D2 U+0440 afii10082 +!D3 U+0441 afii10083 +!D4 U+0442 afii10084 +!D5 U+0443 afii10085 +!D6 U+0436 afii10072 +!D7 U+0432 afii10067 +!D8 U+044C afii10094 +!D9 U+044B afii10093 +!DA U+0437 afii10073 +!DB U+0448 afii10090 +!DC U+044D afii10095 +!DD U+0449 afii10091 +!DE U+0447 afii10089 +!DF U+044A afii10092 +!E0 U+042E afii10048 +!E1 U+0410 afii10017 +!E2 U+0411 afii10018 +!E3 U+0426 afii10040 +!E4 U+0414 afii10021 +!E5 U+0415 afii10022 +!E6 U+0424 afii10038 +!E7 U+0413 afii10020 +!E8 U+0425 afii10039 +!E9 U+0418 afii10026 +!EA U+0419 afii10027 +!EB U+041A afii10028 +!EC U+041B afii10029 +!ED U+041C afii10030 +!EE U+041D afii10031 +!EF U+041E afii10032 +!F0 U+041F afii10033 +!F1 U+042F afii10049 +!F2 U+0420 afii10034 +!F3 U+0421 afii10035 +!F4 U+0422 afii10036 +!F5 U+0423 afii10037 +!F6 U+0416 afii10024 +!F7 U+0412 afii10019 +!F8 U+042C afii10046 +!F9 U+042B afii10045 +!FA U+0417 afii10025 +!FB U+0428 afii10042 +!FC U+042D afii10047 +!FD U+0429 afii10043 +!FE U+0427 afii10041 +!FF U+042A afii10044 diff --git a/lib/dompdf/lib/php-font-lib/maps/koi8-u.map b/lib/dompdf/lib/php-font-lib/maps/koi8-u.map new file mode 100644 index 0000000..40a7e4f --- /dev/null +++ b/lib/dompdf/lib/php-font-lib/maps/koi8-u.map @@ -0,0 +1,256 @@ +!00 U+0000 .notdef +!01 U+0001 .notdef +!02 U+0002 .notdef +!03 U+0003 .notdef +!04 U+0004 .notdef +!05 U+0005 .notdef +!06 U+0006 .notdef +!07 U+0007 .notdef +!08 U+0008 .notdef +!09 U+0009 .notdef +!0A U+000A .notdef +!0B U+000B .notdef +!0C U+000C .notdef +!0D U+000D .notdef +!0E U+000E .notdef +!0F U+000F .notdef +!10 U+0010 .notdef +!11 U+0011 .notdef +!12 U+0012 .notdef +!13 U+0013 .notdef +!14 U+0014 .notdef +!15 U+0015 .notdef +!16 U+0016 .notdef +!17 U+0017 .notdef +!18 U+0018 .notdef +!19 U+0019 .notdef +!1A U+001A .notdef +!1B U+001B .notdef +!1C U+001C .notdef +!1D U+001D .notdef +!1E U+001E .notdef +!1F U+001F .notdef +!20 U+0020 space +!21 U+0021 exclam +!22 U+0022 quotedbl +!23 U+0023 numbersign +!24 U+0024 dollar +!25 U+0025 percent +!26 U+0026 ampersand +!27 U+0027 quotesingle +!28 U+0028 parenleft +!29 U+0029 parenright +!2A U+002A asterisk +!2B U+002B plus +!2C U+002C comma +!2D U+002D hyphen +!2E U+002E period +!2F U+002F slash +!30 U+0030 zero +!31 U+0031 one +!32 U+0032 two +!33 U+0033 three +!34 U+0034 four +!35 U+0035 five +!36 U+0036 six +!37 U+0037 seven +!38 U+0038 eight +!39 U+0039 nine +!3A U+003A colon +!3B U+003B semicolon +!3C U+003C less +!3D U+003D equal +!3E U+003E greater +!3F U+003F question +!40 U+0040 at +!41 U+0041 A +!42 U+0042 B +!43 U+0043 C +!44 U+0044 D +!45 U+0045 E +!46 U+0046 F +!47 U+0047 G +!48 U+0048 H +!49 U+0049 I +!4A U+004A J +!4B U+004B K +!4C U+004C L +!4D U+004D M +!4E U+004E N +!4F U+004F O +!50 U+0050 P +!51 U+0051 Q +!52 U+0052 R +!53 U+0053 S +!54 U+0054 T +!55 U+0055 U +!56 U+0056 V +!57 U+0057 W +!58 U+0058 X +!59 U+0059 Y +!5A U+005A Z +!5B U+005B bracketleft +!5C U+005C backslash +!5D U+005D bracketright +!5E U+005E asciicircum +!5F U+005F underscore +!60 U+0060 grave +!61 U+0061 a +!62 U+0062 b +!63 U+0063 c +!64 U+0064 d +!65 U+0065 e +!66 U+0066 f +!67 U+0067 g +!68 U+0068 h +!69 U+0069 i +!6A U+006A j +!6B U+006B k +!6C U+006C l +!6D U+006D m +!6E U+006E n +!6F U+006F o +!70 U+0070 p +!71 U+0071 q +!72 U+0072 r +!73 U+0073 s +!74 U+0074 t +!75 U+0075 u +!76 U+0076 v +!77 U+0077 w +!78 U+0078 x +!79 U+0079 y +!7A U+007A z +!7B U+007B braceleft +!7C U+007C bar +!7D U+007D braceright +!7E U+007E asciitilde +!7F U+007F .notdef +!80 U+2500 SF100000 +!81 U+2502 SF110000 +!82 U+250C SF010000 +!83 U+2510 SF030000 +!84 U+2514 SF020000 +!85 U+2518 SF040000 +!86 U+251C SF080000 +!87 U+2524 SF090000 +!88 U+252C SF060000 +!89 U+2534 SF070000 +!8A U+253C SF050000 +!8B U+2580 upblock +!8C U+2584 dnblock +!8D U+2588 block +!8E U+258C lfblock +!8F U+2590 rtblock +!90 U+2591 ltshade +!91 U+2592 shade +!92 U+2593 dkshade +!93 U+2320 integraltp +!94 U+25A0 filledbox +!95 U+2022 bullet +!96 U+221A radical +!97 U+2248 approxequal +!98 U+2264 lessequal +!99 U+2265 greaterequal +!9A U+00A0 space +!9B U+2321 integralbt +!9C U+00B0 degree +!9D U+00B2 twosuperior +!9E U+00B7 periodcentered +!9F U+00F7 divide +!A0 U+2550 SF430000 +!A1 U+2551 SF240000 +!A2 U+2552 SF510000 +!A3 U+0451 afii10071 +!A4 U+0454 afii10101 +!A5 U+2554 SF390000 +!A6 U+0456 afii10103 +!A7 U+0457 afii10104 +!A8 U+2557 SF250000 +!A9 U+2558 SF500000 +!AA U+2559 SF490000 +!AB U+255A SF380000 +!AC U+255B SF280000 +!AD U+0491 afii10098 +!AE U+255D SF260000 +!AF U+255E SF360000 +!B0 U+255F SF370000 +!B1 U+2560 SF420000 +!B2 U+2561 SF190000 +!B3 U+0401 afii10023 +!B4 U+0404 afii10053 +!B5 U+2563 SF230000 +!B6 U+0406 afii10055 +!B7 U+0407 afii10056 +!B8 U+2566 SF410000 +!B9 U+2567 SF450000 +!BA U+2568 SF460000 +!BB U+2569 SF400000 +!BC U+256A SF540000 +!BD U+0490 afii10050 +!BE U+256C SF440000 +!BF U+00A9 copyright +!C0 U+044E afii10096 +!C1 U+0430 afii10065 +!C2 U+0431 afii10066 +!C3 U+0446 afii10088 +!C4 U+0434 afii10069 +!C5 U+0435 afii10070 +!C6 U+0444 afii10086 +!C7 U+0433 afii10068 +!C8 U+0445 afii10087 +!C9 U+0438 afii10074 +!CA U+0439 afii10075 +!CB U+043A afii10076 +!CC U+043B afii10077 +!CD U+043C afii10078 +!CE U+043D afii10079 +!CF U+043E afii10080 +!D0 U+043F afii10081 +!D1 U+044F afii10097 +!D2 U+0440 afii10082 +!D3 U+0441 afii10083 +!D4 U+0442 afii10084 +!D5 U+0443 afii10085 +!D6 U+0436 afii10072 +!D7 U+0432 afii10067 +!D8 U+044C afii10094 +!D9 U+044B afii10093 +!DA U+0437 afii10073 +!DB U+0448 afii10090 +!DC U+044D afii10095 +!DD U+0449 afii10091 +!DE U+0447 afii10089 +!DF U+044A afii10092 +!E0 U+042E afii10048 +!E1 U+0410 afii10017 +!E2 U+0411 afii10018 +!E3 U+0426 afii10040 +!E4 U+0414 afii10021 +!E5 U+0415 afii10022 +!E6 U+0424 afii10038 +!E7 U+0413 afii10020 +!E8 U+0425 afii10039 +!E9 U+0418 afii10026 +!EA U+0419 afii10027 +!EB U+041A afii10028 +!EC U+041B afii10029 +!ED U+041C afii10030 +!EE U+041D afii10031 +!EF U+041E afii10032 +!F0 U+041F afii10033 +!F1 U+042F afii10049 +!F2 U+0420 afii10034 +!F3 U+0421 afii10035 +!F4 U+0422 afii10036 +!F5 U+0423 afii10037 +!F6 U+0416 afii10024 +!F7 U+0412 afii10019 +!F8 U+042C afii10046 +!F9 U+042B afii10045 +!FA U+0417 afii10025 +!FB U+0428 afii10042 +!FC U+042D afii10047 +!FD U+0429 afii10043 +!FE U+0427 afii10041 +!FF U+042A afii10044 diff --git a/lib/dompdf/lib/php-font-lib/src/FontLib/AdobeFontMetrics.php b/lib/dompdf/lib/php-font-lib/src/FontLib/AdobeFontMetrics.php new file mode 100644 index 0000000..613117d --- /dev/null +++ b/lib/dompdf/lib/php-font-lib/src/FontLib/AdobeFontMetrics.php @@ -0,0 +1,253 @@ + + * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + */ + +namespace FontLib; + +use FontLib\Table\Type\name; +use FontLib\TrueType\File; + +/** + * Adobe Font Metrics file creation utility class. + * + * @package php-font-lib + */ +class AdobeFontMetrics { + private $f; + + /** + * @var File + */ + private $font; + + function __construct(File $font) { + $this->font = $font; + } + + function write($file, $encoding = null) { + $map_data = array(); + + if ($encoding) { + $encoding = preg_replace("/[^a-z0-9-_]/", "", $encoding); + $map_file = dirname(__FILE__) . "/../../maps/$encoding.map"; + if (!file_exists($map_file)) { + throw new \Exception("Unknown encoding ($encoding)"); + } + + $map = new EncodingMap($map_file); + $map_data = $map->parse(); + } + + $this->f = fopen($file, "w+"); + + $font = $this->font; + + $this->startSection("FontMetrics", 4.1); + $this->addPair("Notice", "Converted by PHP-font-lib"); + $this->addPair("Comment", "https://github.com/dompdf/php-font-lib"); + + $encoding_scheme = ($encoding ? $encoding : "FontSpecific"); + $this->addPair("EncodingScheme", $encoding_scheme); + + $records = $font->getData("name", "records"); + foreach ($records as $id => $record) { + if (!isset(name::$nameIdCodes[$id]) || preg_match("/[\r\n]/", $record->string)) { + continue; + } + + $this->addPair(name::$nameIdCodes[$id], $record->string); + } + + $os2 = $font->getData("OS/2"); + $this->addPair("Weight", ($os2["usWeightClass"] > 400 ? "Bold" : "Medium")); + + $post = $font->getData("post"); + $this->addPair("ItalicAngle", $post["italicAngle"]); + $this->addPair("IsFixedPitch", ($post["isFixedPitch"] ? "true" : "false")); + $this->addPair("UnderlineThickness", $font->normalizeFUnit($post["underlineThickness"])); + $this->addPair("UnderlinePosition", $font->normalizeFUnit($post["underlinePosition"])); + + $hhea = $font->getData("hhea"); + + if (isset($hhea["ascent"])) { + $this->addPair("FontHeightOffset", $font->normalizeFUnit($hhea["lineGap"])); + } + else { + $this->addPair("FontHeightOffset", $font->normalizeFUnit($os2["typoLineGap"])); + } + + $glyf = $font->getData("glyf"); + $glyphIndexArray = $font->getUnicodeCharMap(); + $hasGlyphs = $glyf instanceof glyf && is_array($glyphIndexArray); + + // capHeight is based on capital H + if ($hasGlyphs && \array_key_exists(72, $glyphIndexArray)) { + $upperH = $glyf[$glyphIndexArray[72]]; + $upperH->parseData(); + $this->addPair("CapHeight", $font->normalizeFUnit($upperH->yMax)); + } + + // xHeight is based on lowercase x + if ($hasGlyphs && \array_key_exists(120, $glyphIndexArray)) { + $lowerX = $glyf[$glyphIndexArray[120]]; + $lowerX->parseData(); + $this->addPair("XHeight", $font->normalizeFUnit($lowerX->yMax)); + } + + // ascender is based on lowercase d + if ($hasGlyphs && \array_key_exists(100, $glyphIndexArray)) { + $lowerD = $glyf[$glyphIndexArray[100]]; + $lowerD->parseData(); + $this->addPair("Ascender", $font->normalizeFUnit($lowerD->yMax)); + } elseif (isset($hhea["ascent"])) { + $this->addPair("Ascender", $font->normalizeFUnit($hhea["ascent"])); + } + else { + $this->addPair("Ascender", $font->normalizeFUnit($os2["typoAscender"])); + } + + // descender is based on lowercase p + if ($hasGlyphs && \array_key_exists(112, $glyphIndexArray)) { + $lowerP = $glyf[$glyphIndexArray[112]]; + $lowerP->parseData(); + $this->addPair("Descender", $font->normalizeFUnit($lowerP->yMin)); + } elseif (isset($hhea["descent"])) { + $this->addPair("Descender", $font->normalizeFUnit($hhea["descent"])); + } + else { + $this->addPair("Descender", -abs($font->normalizeFUnit($os2["typoDescender"]))); + } + + $head = $font->getData("head"); + $this->addArray("FontBBox", array( + $font->normalizeFUnit($head["xMin"]), + $font->normalizeFUnit($head["yMin"]), + $font->normalizeFUnit($head["xMax"]), + $font->normalizeFUnit($head["yMax"]), + )); + + if ($glyphIndexArray) { + $hmtx = $font->getData("hmtx"); + $names = $font->getData("post", "names"); + + $this->startSection("CharMetrics", count($hmtx)); + + if ($encoding) { + foreach ($map_data as $code => $value) { + list($c, $name) = $value; + + if (!isset($glyphIndexArray[$c])) { + continue; + } + + $g = $glyphIndexArray[$c]; + + if (!isset($hmtx[$g])) { + $hmtx[$g] = $hmtx[0]; + } + + $this->addMetric(array( + "C" => ($code > 255 ? -1 : $code), + "WX" => $font->normalizeFUnit($hmtx[$g][0]), + "N" => $name, + )); + } + } + else { + foreach ($glyphIndexArray as $c => $g) { + if (!isset($hmtx[$g])) { + $hmtx[$g] = $hmtx[0]; + } + + $this->addMetric(array( + "U" => $c, + "WX" => $font->normalizeFUnit($hmtx[$g][0]), + "N" => (isset($names[$g]) ? $names[$g] : sprintf("uni%04x", $c)), + "G" => $g, + )); + } + } + + $this->endSection("CharMetrics"); + + $kern = $font->getData("kern", "subtable"); + $tree = is_array($kern) ? $kern["tree"] : null; + + if (!$encoding && is_array($tree)) { + $this->startSection("KernData"); + $this->startSection("KernPairs", count($tree, COUNT_RECURSIVE) - count($tree)); + + foreach ($tree as $left => $values) { + if (!is_array($values)) { + continue; + } + if (!isset($glyphIndexArray[$left])) { + continue; + } + + $left_gid = $glyphIndexArray[$left]; + + if (!isset($names[$left_gid])) { + continue; + } + + $left_name = $names[$left_gid]; + + $this->addLine(""); + + foreach ($values as $right => $value) { + if (!isset($glyphIndexArray[$right])) { + continue; + } + + $right_gid = $glyphIndexArray[$right]; + + if (!isset($names[$right_gid])) { + continue; + } + + $right_name = $names[$right_gid]; + $this->addPair("KPX", "$left_name $right_name $value"); + } + } + + $this->endSection("KernPairs"); + $this->endSection("KernData"); + } + } + + $this->endSection("FontMetrics"); + } + + function addLine($line) { + fwrite($this->f, "$line\n"); + } + + function addPair($key, $value) { + $this->addLine("$key $value"); + } + + function addArray($key, $array) { + $this->addLine("$key " . implode(" ", $array)); + } + + function addMetric($data) { + $array = array(); + foreach ($data as $key => $value) { + $array[] = "$key $value"; + } + $this->addLine(implode(" ; ", $array)); + } + + function startSection($name, $value = "") { + $this->addLine("Start$name $value"); + } + + function endSection($name) { + $this->addLine("End$name"); + } +} diff --git a/lib/dompdf/lib/php-font-lib/src/FontLib/Autoloader.php b/lib/dompdf/lib/php-font-lib/src/FontLib/Autoloader.php new file mode 100644 index 0000000..cd30545 --- /dev/null +++ b/lib/dompdf/lib/php-font-lib/src/FontLib/Autoloader.php @@ -0,0 +1,43 @@ + + * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + */ + +namespace FontLib; + +/** + * Autoloads FontLib classes + * + * @package php-font-lib + */ +class Autoloader { + const PREFIX = 'FontLib'; + + /** + * Register the autoloader + */ + public static function register() { + spl_autoload_register(array(new self, 'autoload')); + } + + /** + * Autoloader + * + * @param string + */ + public static function autoload($class) { + $prefixLength = strlen(self::PREFIX); + if (0 === strncmp(self::PREFIX, $class, $prefixLength)) { + $file = str_replace('\\', DIRECTORY_SEPARATOR, substr($class, $prefixLength)); + $file = realpath(__DIR__ . (empty($file) ? '' : DIRECTORY_SEPARATOR) . $file . '.php'); + if (file_exists($file)) { + require_once $file; + } + } + } +} + +Autoloader::register(); \ No newline at end of file diff --git a/lib/dompdf/lib/php-font-lib/src/FontLib/BinaryStream.php b/lib/dompdf/lib/php-font-lib/src/FontLib/BinaryStream.php new file mode 100644 index 0000000..5e170c6 --- /dev/null +++ b/lib/dompdf/lib/php-font-lib/src/FontLib/BinaryStream.php @@ -0,0 +1,449 @@ + + * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + */ + +namespace FontLib; + +/** + * Generic font file binary stream. + * + * @package php-font-lib + */ +class BinaryStream { + /** + * @var resource The file pointer + */ + protected $f; + + const uint8 = 1; + const int8 = 2; + const uint16 = 3; + const int16 = 4; + const uint32 = 5; + const int32 = 6; + const shortFrac = 7; + const Fixed = 8; + const FWord = 9; + const uFWord = 10; + const F2Dot14 = 11; + const longDateTime = 12; + const char = 13; + + const modeRead = "rb"; + const modeWrite = "wb"; + const modeReadWrite = "rb+"; + + static function backtrace() { + var_dump(debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS)); + } + + /** + * Open a font file in read mode + * + * @param string $filename The file name of the font to open + * + * @return bool + */ + public function load($filename) { + return $this->open($filename, self::modeRead); + } + + /** + * Open a font file in a chosen mode + * + * @param string $filename The file name of the font to open + * @param string $mode The opening mode + * + * @throws \Exception + * @return bool + */ + public function open($filename, $mode = self::modeRead) { + if (!in_array($mode, array(self::modeRead, self::modeWrite, self::modeReadWrite))) { + throw new \Exception("Unknown file open mode"); + } + + $this->f = fopen($filename, $mode); + + return $this->f != false; + } + + /** + * Close the internal file pointer + */ + public function close() { + return fclose($this->f) != false; + } + + /** + * Change the internal file pointer + * + * @param resource $fp + * + * @throws \Exception + */ + public function setFile($fp) { + if (!is_resource($fp)) { + throw new \Exception('$fp is not a valid resource'); + } + + $this->f = $fp; + } + + /** + * Create a temporary file in write mode + * + * @param bool $allow_memory Allow in-memory files + * + * @return resource the temporary file pointer resource + */ + public static function getTempFile($allow_memory = true) { + $f = null; + + if ($allow_memory) { + $f = fopen("php://temp", "rb+"); + } + else { + $f = fopen(tempnam(sys_get_temp_dir(), "fnt"), "rb+"); + } + + return $f; + } + + /** + * Move the internal file pinter to $offset bytes + * + * @param int $offset + * + * @return bool True if the $offset position exists in the file + */ + public function seek($offset) { + return fseek($this->f, $offset, SEEK_SET) == 0; + } + + /** + * Gives the current position in the file + * + * @return int The current position + */ + public function pos() { + return ftell($this->f); + } + + public function skip($n) { + fseek($this->f, $n, SEEK_CUR); + } + + /** + * @param int $n The number of bytes to read + * + * @return string + */ + public function read($n) { + if ($n < 1) { + return ""; + } + + return (string) fread($this->f, $n); + } + + public function write($data, $length = null) { + if ($data === null || $data === "" || $data === false) { + return 0; + } + + return fwrite($this->f, $data, $length); + } + + public function readUInt8() { + return ord($this->read(1)); + } + + public function readUInt8Many($count) { + return array_values(unpack("C*", $this->read($count))); + } + + public function writeUInt8($data) { + return $this->write(chr($data), 1); + } + + public function readInt8() { + $v = $this->readUInt8(); + + if ($v >= 0x80) { + $v -= 0x100; + } + + return $v; + } + + public function readInt8Many($count) { + return array_values(unpack("c*", $this->read($count))); + } + + public function writeInt8($data) { + if ($data < 0) { + $data += 0x100; + } + + return $this->writeUInt8($data); + } + + public function readUInt16() { + $a = unpack("nn", $this->read(2)); + + return $a["n"]; + } + + public function readUInt16Many($count) { + return array_values(unpack("n*", $this->read($count * 2))); + } + + public function readUFWord() { + return $this->readUInt16(); + } + + public function writeUInt16($data) { + return $this->write(pack("n", $data), 2); + } + + public function writeUFWord($data) { + return $this->writeUInt16($data); + } + + public function readInt16() { + $a = unpack("nn", $this->read(2)); + $v = $a["n"]; + + if ($v >= 0x8000) { + $v -= 0x10000; + } + + return $v; + } + + public function readInt16Many($count) { + $vals = array_values(unpack("n*", $this->read($count * 2))); + foreach ($vals as &$v) { + if ($v >= 0x8000) { + $v -= 0x10000; + } + } + + return $vals; + } + + public function readFWord() { + return $this->readInt16(); + } + + public function writeInt16($data) { + if ($data < 0) { + $data += 0x10000; + } + + return $this->writeUInt16($data); + } + + public function writeFWord($data) { + return $this->writeInt16($data); + } + + public function readUInt32() { + $a = unpack("NN", $this->read(4)); + + return $a["N"]; + } + + public function writeUInt32($data) { + return $this->write(pack("N", $data), 4); + } + + public function readFixed() { + $d = $this->readInt16(); + $d2 = $this->readUInt16(); + + return round($d + $d2 / 0x10000, 4); + } + + public function writeFixed($data) { + $left = floor($data); + $right = ($data - $left) * 0x10000; + + return $this->writeInt16($left) + $this->writeUInt16($right); + } + + public function readLongDateTime() { + $this->readUInt32(); // ignored + $date = $this->readUInt32() - 2082844800; + + # PHP_INT_MIN isn't defined in PHP < 7.0 + $php_int_min = defined("PHP_INT_MIN") ? PHP_INT_MIN : ~PHP_INT_MAX; + + if (is_string($date) || $date > PHP_INT_MAX || $date < $php_int_min) { + $date = 0; + } + + return date("Y-m-d H:i:s", $date); + } + + public function writeLongDateTime($data) { + $date = strtotime($data); + $date += 2082844800; + + return $this->writeUInt32(0) + $this->writeUInt32($date); + } + + public function unpack($def) { + $d = array(); + foreach ($def as $name => $type) { + $d[$name] = $this->r($type); + } + + return $d; + } + + public function pack($def, $data) { + $bytes = 0; + foreach ($def as $name => $type) { + $bytes += $this->w($type, $data[$name]); + } + + return $bytes; + } + + /** + * Read a data of type $type in the file from the current position + * + * @param mixed $type The data type to read + * + * @return mixed The data that was read + */ + public function r($type) { + switch ($type) { + case self::uint8: + return $this->readUInt8(); + case self::int8: + return $this->readInt8(); + case self::uint16: + return $this->readUInt16(); + case self::int16: + return $this->readInt16(); + case self::uint32: + return $this->readUInt32(); + case self::int32: + return $this->readUInt32(); + case self::shortFrac: + return $this->readFixed(); + case self::Fixed: + return $this->readFixed(); + case self::FWord: + return $this->readInt16(); + case self::uFWord: + return $this->readUInt16(); + case self::F2Dot14: + return $this->readInt16(); + case self::longDateTime: + return $this->readLongDateTime(); + case self::char: + return $this->read(1); + default: + if (is_array($type)) { + if ($type[0] == self::char) { + return $this->read($type[1]); + } + if ($type[0] == self::uint16) { + return $this->readUInt16Many($type[1]); + } + if ($type[0] == self::int16) { + return $this->readInt16Many($type[1]); + } + if ($type[0] == self::uint8) { + return $this->readUInt8Many($type[1]); + } + if ($type[0] == self::int8) { + return $this->readInt8Many($type[1]); + } + + $ret = array(); + for ($i = 0; $i < $type[1]; $i++) { + $ret[] = $this->r($type[0]); + } + + return $ret; + } + + return null; + } + } + + /** + * Write $data of type $type in the file from the current position + * + * @param mixed $type The data type to write + * @param mixed $data The data to write + * + * @return int The number of bytes read + */ + public function w($type, $data) { + switch ($type) { + case self::uint8: + return $this->writeUInt8($data); + case self::int8: + return $this->writeInt8($data); + case self::uint16: + return $this->writeUInt16($data); + case self::int16: + return $this->writeInt16($data); + case self::uint32: + return $this->writeUInt32($data); + case self::int32: + return $this->writeUInt32($data); + case self::shortFrac: + return $this->writeFixed($data); + case self::Fixed: + return $this->writeFixed($data); + case self::FWord: + return $this->writeInt16($data); + case self::uFWord: + return $this->writeUInt16($data); + case self::F2Dot14: + return $this->writeInt16($data); + case self::longDateTime: + return $this->writeLongDateTime($data); + case self::char: + return $this->write($data, 1); + default: + if (is_array($type)) { + if ($type[0] == self::char) { + return $this->write($data, $type[1]); + } + + $ret = 0; + for ($i = 0; $i < $type[1]; $i++) { + if (isset($data[$i])) { + $ret += $this->w($type[0], $data[$i]); + } + } + + return $ret; + } + + return null; + } + } + + /** + * Converts a Uint32 value to string + * + * @param int $uint32 + * + * @return string The string + */ + public function convertUInt32ToStr($uint32) { + return chr(($uint32 >> 24) & 0xFF) . chr(($uint32 >> 16) & 0xFF) . chr(($uint32 >> 8) & 0xFF) . chr($uint32 & 0xFF); + } +} diff --git a/lib/dompdf/lib/php-font-lib/src/FontLib/EOT/File.php b/lib/dompdf/lib/php-font-lib/src/FontLib/EOT/File.php new file mode 100644 index 0000000..55933eb --- /dev/null +++ b/lib/dompdf/lib/php-font-lib/src/FontLib/EOT/File.php @@ -0,0 +1,159 @@ + + * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + */ + +namespace FontLib\EOT; + +/** + * EOT font file. + * + * @package php-font-lib + */ +class File extends \FontLib\TrueType\File { + const TTEMBED_SUBSET = 0x00000001; + const TTEMBED_TTCOMPRESSED = 0x00000004; + const TTEMBED_FAILIFVARIATIONSIMULATED = 0x00000010; + const TTMBED_EMBEDEUDC = 0x00000020; + const TTEMBED_VALIDATIONTESTS = 0x00000040; // Deprecated + const TTEMBED_WEBOBJECT = 0x00000080; + const TTEMBED_XORENCRYPTDATA = 0x10000000; + + /** + * @var Header + */ + public $header; + + function parseHeader() { + if (!empty($this->header)) { + return; + } + + $this->header = new Header($this); + $this->header->parse(); + } + + function parse() { + $this->parseHeader(); + + $flags = $this->header->data["Flags"]; + + if ($flags & self::TTEMBED_TTCOMPRESSED) { + $mtx_version = $this->readUInt8(); + $mtx_copy_limit = $this->readUInt8() << 16 | $this->readUInt8() << 8 | $this->readUInt8(); + $mtx_offset_1 = $this->readUInt8() << 16 | $this->readUInt8() << 8 | $this->readUInt8(); + $mtx_offset_2 = $this->readUInt8() << 16 | $this->readUInt8() << 8 | $this->readUInt8(); + /* + var_dump("$mtx_version $mtx_copy_limit $mtx_offset_1 $mtx_offset_2"); + + $pos = $this->pos(); + $size = $mtx_offset_1 - $pos; + var_dump("pos: $pos"); + var_dump("size: $size");*/ + } + + if ($flags & self::TTEMBED_XORENCRYPTDATA) { + // Process XOR + } + // TODO Read font data ... + } + + /** + * Little endian version of the read method + * + * @param int $n The number of bytes to read + * + * @return string + */ + public function read($n) { + if ($n < 1) { + return ""; + } + + $string = (string) fread($this->f, $n); + $chunks = mb_str_split($string, 2, '8bit'); + $chunks = array_map("strrev", $chunks); + return implode("", $chunks); + } + + public function readUInt32() { + $uint32 = parent::readUInt32(); + + return $uint32 >> 16 & 0x0000FFFF | $uint32 << 16 & 0xFFFF0000; + } + + /** + * Get font copyright + * + * @return string|null + */ + function getFontCopyright() { + return null; + } + + /** + * Get font name + * + * @return string|null + */ + function getFontName() { + return $this->header->data["FamilyName"]; + } + + /** + * Get font subfamily + * + * @return string|null + */ + function getFontSubfamily() { + return $this->header->data["StyleName"]; + } + + /** + * Get font subfamily ID + * + * @return string|null + */ + function getFontSubfamilyID() { + return $this->header->data["StyleName"]; + } + + /** + * Get font full name + * + * @return string|null + */ + function getFontFullName() { + return $this->header->data["FullName"]; + } + + /** + * Get font version + * + * @return string|null + */ + function getFontVersion() { + return $this->header->data["VersionName"]; + } + + /** + * Get font weight + * + * @return string|null + */ + function getFontWeight() { + return $this->header->data["Weight"]; + } + + /** + * Get font Postscript name + * + * @return string|null + */ + function getFontPostscriptName() { + return null; + } +} diff --git a/lib/dompdf/lib/php-font-lib/src/FontLib/EOT/Header.php b/lib/dompdf/lib/php-font-lib/src/FontLib/EOT/Header.php new file mode 100644 index 0000000..2730c80 --- /dev/null +++ b/lib/dompdf/lib/php-font-lib/src/FontLib/EOT/Header.php @@ -0,0 +1,113 @@ + + * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + */ + +namespace FontLib\EOT; + +use Exception; +use FontLib\Font; + +/** + * TrueType font file header. + * + * @package php-font-lib + * + * @property File $font + */ +class Header extends \FontLib\Header { + protected $def = array( + "format" => self::uint32, + "numTables" => self::uint16, + "searchRange" => self::uint16, + "entrySelector" => self::uint16, + "rangeShift" => self::uint16, + ); + + public function parse() { + $font = $this->font; + + $this->data = $font->unpack(array( + "EOTSize" => self::uint32, + "FontDataSize" => self::uint32, + "Version" => self::uint32, + "Flags" => self::uint32, + "FontPANOSE" => array(self::uint8, 10), + "Charset" => self::uint8, + "Italic" => self::uint8, + "Weight" => self::uint32, + "fsType" => self::uint16, + "MagicNumber" => self::uint16, + "UnicodeRange1" => self::uint32, + "UnicodeRange2" => self::uint32, + "UnicodeRange3" => self::uint32, + "UnicodeRange4" => self::uint32, + "CodePageRange1" => self::uint32, + "CodePageRange2" => self::uint32, + "CheckSumAdjustment" => self::uint32, + "Reserved1" => self::uint32, + "Reserved2" => self::uint32, + "Reserved3" => self::uint32, + "Reserved4" => self::uint32, + )); + + $this->data["Padding1"] = $font->readUInt16(); + $this->readString("FamilyName"); + + $this->data["Padding2"] = $font->readUInt16(); + $this->readString("StyleName"); + + $this->data["Padding3"] = $font->readUInt16(); + $this->readString("VersionName"); + + $this->data["Padding4"] = $font->readUInt16(); + $this->readString("FullName"); + + switch ($this->data["Version"]) { + default: + throw new Exception("Unknown EOT version " . $this->data["Version"]); + + case 0x00010000: + // Nothing to do more + break; + + case 0x00020001: + $this->data["Padding5"] = $font->readUInt16(); + $this->readString("RootString"); + break; + + case 0x00020002: + $this->data["Padding5"] = $font->readUInt16(); + $this->readString("RootString"); + + $this->data["RootStringCheckSum"] = $font->readUInt32(); + $this->data["EUDCCodePage"] = $font->readUInt32(); + + $this->data["Padding6"] = $font->readUInt16(); + $this->readString("Signature"); + + $this->data["EUDCFlags"] = $font->readUInt32(); + $this->data["EUDCFontSize"] = $font->readUInt32(); + break; + } + + if (!empty($this->data["RootString"])) { + $this->data["RootString"] = explode("\0", $this->data["RootString"]); + } + } + + private function readString($name) { + $font = $this->font; + $size = $font->readUInt16(); + + $this->data["{$name}Size"] = $size; + $this->data[$name] = Font::UTF16ToUTF8($font->read($size)); + } + + public function encode() { + //return $this->font->pack($this->def, $this->data); + } +} \ No newline at end of file diff --git a/lib/dompdf/lib/php-font-lib/src/FontLib/EncodingMap.php b/lib/dompdf/lib/php-font-lib/src/FontLib/EncodingMap.php new file mode 100644 index 0000000..02e7ca4 --- /dev/null +++ b/lib/dompdf/lib/php-font-lib/src/FontLib/EncodingMap.php @@ -0,0 +1,37 @@ + + * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + */ + +namespace FontLib; + +/** + * Encoding map used to map a code point to a Unicode char. + * + * @package php-font-lib + */ +class EncodingMap { + private $f; + + function __construct($file) { + $this->f = fopen($file, "r"); + } + + function parse() { + $map = array(); + + while ($line = fgets($this->f)) { + if (preg_match('/^[\!\=]([0-9A-F]{2,})\s+U\+([0-9A-F]{2})([0-9A-F]{2})\s+([^\s]+)/', $line, $matches)) { + $unicode = (hexdec($matches[2]) << 8) + hexdec($matches[3]); + $map[hexdec($matches[1])] = array($unicode, $matches[4]); + } + } + + ksort($map); + + return $map; + } +} diff --git a/lib/dompdf/lib/php-font-lib/src/FontLib/Exception/FontNotFoundException.php b/lib/dompdf/lib/php-font-lib/src/FontLib/Exception/FontNotFoundException.php new file mode 100644 index 0000000..d97f252 --- /dev/null +++ b/lib/dompdf/lib/php-font-lib/src/FontLib/Exception/FontNotFoundException.php @@ -0,0 +1,11 @@ +message = 'Font not found in: ' . $fontPath; + } +} \ No newline at end of file diff --git a/lib/dompdf/lib/php-font-lib/src/FontLib/Font.php b/lib/dompdf/lib/php-font-lib/src/FontLib/Font.php new file mode 100644 index 0000000..3f6a784 --- /dev/null +++ b/lib/dompdf/lib/php-font-lib/src/FontLib/Font.php @@ -0,0 +1,89 @@ + + * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + */ + +namespace FontLib; + +use FontLib\Exception\FontNotFoundException; + +/** + * Generic font file. + * + * @package php-font-lib + */ +class Font { + static $debug = false; + + /** + * @param string $file The font file + * + * @return TrueType\File|null $file + */ + public static function load($file) { + if(!file_exists($file)){ + throw new FontNotFoundException($file); + } + + $header = file_get_contents($file, false, null, 0, 4); + $class = null; + + switch ($header) { + case "\x00\x01\x00\x00": + case "true": + case "typ1": + $class = "TrueType\\File"; + break; + + case "OTTO": + $class = "OpenType\\File"; + break; + + case "wOFF": + $class = "WOFF\\File"; + break; + + case "ttcf": + $class = "TrueType\\Collection"; + break; + + // Unknown type or EOT + default: + $magicNumber = file_get_contents($file, false, null, 34, 2); + + if ($magicNumber === "LP") { + $class = "EOT\\File"; + } + } + + if ($class) { + $class = "FontLib\\$class"; + + /** @var TrueType\File $obj */ + $obj = new $class; + $obj->load($file); + + return $obj; + } + + return null; + } + + static function d($str) { + if (!self::$debug) { + return; + } + echo "$str\n"; + } + + static function UTF16ToUTF8($str) { + return mb_convert_encoding($str, "utf-8", "utf-16"); + } + + static function UTF8ToUTF16($str) { + return mb_convert_encoding($str, "utf-16", "utf-8"); + } +} diff --git a/lib/dompdf/lib/php-font-lib/src/FontLib/Glyph/Outline.php b/lib/dompdf/lib/php-font-lib/src/FontLib/Glyph/Outline.php new file mode 100644 index 0000000..efb2de5 --- /dev/null +++ b/lib/dompdf/lib/php-font-lib/src/FontLib/Glyph/Outline.php @@ -0,0 +1,109 @@ + + * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + * @version $Id: Font_Table_glyf.php 46 2012-04-02 20:22:38Z fabien.menager $ + */ +namespace FontLib\Glyph; + +use FontLib\Table\Type\glyf; +use FontLib\TrueType\File; +use FontLib\BinaryStream; + +/** + * `glyf` font table. + * + * @package php-font-lib + */ +class Outline extends BinaryStream { + /** + * @var \FontLib\Table\Type\glyf + */ + protected $table; + + protected $offset; + protected $size; + + // Data + public $numberOfContours; + public $xMin; + public $yMin; + public $xMax; + public $yMax; + + /** + * @var string|null + */ + public $raw; + + /** + * @param glyf $table + * @param $offset + * @param $size + * + * @return Outline + */ + static function init(glyf $table, $offset, $size, BinaryStream $font) { + $font->seek($offset); + + if ($size === 0 || $font->readInt16() > -1) { + /** @var OutlineSimple $glyph */ + $glyph = new OutlineSimple($table, $offset, $size); + } + else { + /** @var OutlineComposite $glyph */ + $glyph = new OutlineComposite($table, $offset, $size); + } + + $glyph->parse($font); + + return $glyph; + } + + /** + * @return File + */ + function getFont() { + return $this->table->getFont(); + } + + function __construct(glyf $table, $offset = null, $size = null) { + $this->table = $table; + $this->offset = $offset; + $this->size = $size; + } + + function parse(BinaryStream $font) { + $font->seek($this->offset); + + $this->raw = $font->read($this->size); + } + + function parseData() { + $font = $this->getFont(); + $font->seek($this->offset); + + $this->numberOfContours = $font->readInt16(); + $this->xMin = $font->readFWord(); + $this->yMin = $font->readFWord(); + $this->xMax = $font->readFWord(); + $this->yMax = $font->readFWord(); + } + + function encode() { + $font = $this->getFont(); + + return $font->write($this->raw, mb_strlen((string) $this->raw, '8bit')); + } + + function getSVGContours() { + // Inherit + } + + function getGlyphIDs() { + return array(); + } +} + diff --git a/lib/dompdf/lib/php-font-lib/src/FontLib/Glyph/OutlineComponent.php b/lib/dompdf/lib/php-font-lib/src/FontLib/Glyph/OutlineComponent.php new file mode 100644 index 0000000..fa75c2a --- /dev/null +++ b/lib/dompdf/lib/php-font-lib/src/FontLib/Glyph/OutlineComponent.php @@ -0,0 +1,31 @@ + + * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + * @version $Id: Font_Table_glyf.php 46 2012-04-02 20:22:38Z fabien.menager $ + */ + +namespace FontLib\Glyph; +/** + * Glyph outline component + * + * @package php-font-lib + */ +class OutlineComponent { + public $flags; + public $glyphIndex; + public $a, $b, $c, $d, $e, $f; + public $point_compound; + public $point_component; + public $instructions; + + function getMatrix() { + return array( + $this->a, $this->b, + $this->c, $this->d, + $this->e, $this->f, + ); + } +} \ No newline at end of file diff --git a/lib/dompdf/lib/php-font-lib/src/FontLib/Glyph/OutlineComposite.php b/lib/dompdf/lib/php-font-lib/src/FontLib/Glyph/OutlineComposite.php new file mode 100644 index 0000000..eb3da91 --- /dev/null +++ b/lib/dompdf/lib/php-font-lib/src/FontLib/Glyph/OutlineComposite.php @@ -0,0 +1,253 @@ + + * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + * @version $Id: Font_Table_glyf.php 46 2012-04-02 20:22:38Z fabien.menager $ + */ + +namespace FontLib\Glyph; + +/** + * Composite glyph outline + * + * @package php-font-lib + */ +class OutlineComposite extends Outline { + const ARG_1_AND_2_ARE_WORDS = 0x0001; + const ARGS_ARE_XY_VALUES = 0x0002; + const ROUND_XY_TO_GRID = 0x0004; + const WE_HAVE_A_SCALE = 0x0008; + const MORE_COMPONENTS = 0x0020; + const WE_HAVE_AN_X_AND_Y_SCALE = 0x0040; + const WE_HAVE_A_TWO_BY_TWO = 0x0080; + const WE_HAVE_INSTRUCTIONS = 0x0100; + const USE_MY_METRICS = 0x0200; + const OVERLAP_COMPOUND = 0x0400; + + /** + * @var OutlineComponent[] + */ + public $components = array(); + + function getGlyphIDs() { + if (empty($this->components)) { + $this->parseData(); + } + + $glyphIDs = array(); + foreach ($this->components as $_component) { + $glyphIDs[] = $_component->glyphIndex; + + $_glyph = $this->table->data[$_component->glyphIndex]; + + if ($_glyph !== $this) { + $glyphIDs = array_merge($glyphIDs, $_glyph->getGlyphIDs()); + } + } + + return $glyphIDs; + } + + /*function parse() { + //$this->parseData(); + }*/ + + function parseData() { + parent::parseData(); + + $font = $this->getFont(); + + do { + $flags = $font->readUInt16(); + $glyphIndex = $font->readUInt16(); + + $a = 1.0; + $b = 0.0; + $c = 0.0; + $d = 1.0; + $e = 0.0; + $f = 0.0; + + $point_compound = null; + $point_component = null; + + $instructions = null; + + if ($flags & self::ARG_1_AND_2_ARE_WORDS) { + if ($flags & self::ARGS_ARE_XY_VALUES) { + $e = $font->readInt16(); + $f = $font->readInt16(); + } + else { + $point_compound = $font->readUInt16(); + $point_component = $font->readUInt16(); + } + } + else { + if ($flags & self::ARGS_ARE_XY_VALUES) { + $e = $font->readInt8(); + $f = $font->readInt8(); + } + else { + $point_compound = $font->readUInt8(); + $point_component = $font->readUInt8(); + } + } + + if ($flags & self::WE_HAVE_A_SCALE) { + $a = $d = $font->readInt16(); + } + elseif ($flags & self::WE_HAVE_AN_X_AND_Y_SCALE) { + $a = $font->readInt16(); + $d = $font->readInt16(); + } + elseif ($flags & self::WE_HAVE_A_TWO_BY_TWO) { + $a = $font->readInt16(); + $b = $font->readInt16(); + $c = $font->readInt16(); + $d = $font->readInt16(); + } + + //if ($flags & self::WE_HAVE_INSTRUCTIONS) { + // + //} + + $component = new OutlineComponent(); + $component->flags = $flags; + $component->glyphIndex = $glyphIndex; + $component->a = $a; + $component->b = $b; + $component->c = $c; + $component->d = $d; + $component->e = $e; + $component->f = $f; + $component->point_compound = $point_compound; + $component->point_component = $point_component; + $component->instructions = $instructions; + + $this->components[] = $component; + } while ($flags & self::MORE_COMPONENTS); + if ($flags & self::WE_HAVE_INSTRUCTIONS) { + $numInstr = $font->readUInt16(); + $instr = $font->read($numInstr); + $this->components[count($this->components) - 1]->instructions = pack('n', $numInstr) . $instr; + } + } + + function encode() { + $font = $this->getFont(); + + $gids = $font->getSubset(); + + $size = $font->writeInt16(-1); + $size += $font->writeFWord($this->xMin); + $size += $font->writeFWord($this->yMin); + $size += $font->writeFWord($this->xMax); + $size += $font->writeFWord($this->yMax); + + foreach ($this->components as $_i => $_component) { + $flags = 0; + if ($_component->point_component === null && $_component->point_compound === null) { + $flags |= self::ARGS_ARE_XY_VALUES; + + if (abs($_component->e) > 0x7F || abs($_component->f) > 0x7F) { + $flags |= self::ARG_1_AND_2_ARE_WORDS; + } + } + elseif ($_component->point_component > 0xFF || $_component->point_compound > 0xFF) { + $flags |= self::ARG_1_AND_2_ARE_WORDS; + } + + if ($_component->b == 0 && $_component->c == 0) { + if ($_component->a == $_component->d) { + if ($_component->a != 1.0) { + $flags |= self::WE_HAVE_A_SCALE; + } + } + else { + $flags |= self::WE_HAVE_AN_X_AND_Y_SCALE; + } + } + else { + $flags |= self::WE_HAVE_A_TWO_BY_TWO; + } + + if ($_i < count($this->components) - 1) { + $flags |= self::MORE_COMPONENTS; + } elseif($_component->instructions !== null) { + $flags |= self::WE_HAVE_INSTRUCTIONS; + } + + $size += $font->writeUInt16($flags); + + $new_gid = array_search($_component->glyphIndex, $gids); + $size += $font->writeUInt16($new_gid); + + if ($flags & self::ARG_1_AND_2_ARE_WORDS) { + if ($flags & self::ARGS_ARE_XY_VALUES) { + $size += $font->writeInt16($_component->e); + $size += $font->writeInt16($_component->f); + } + else { + $size += $font->writeUInt16($_component->point_compound); + $size += $font->writeUInt16($_component->point_component); + } + } + else { + if ($flags & self::ARGS_ARE_XY_VALUES) { + $size += $font->writeInt8($_component->e); + $size += $font->writeInt8($_component->f); + } + else { + $size += $font->writeUInt8($_component->point_compound); + $size += $font->writeUInt8($_component->point_component); + } + } + + if ($flags & self::WE_HAVE_A_SCALE) { + $size += $font->writeInt16($_component->a); + } + elseif ($flags & self::WE_HAVE_AN_X_AND_Y_SCALE) { + $size += $font->writeInt16($_component->a); + $size += $font->writeInt16($_component->d); + } + elseif ($flags & self::WE_HAVE_A_TWO_BY_TWO) { + $size += $font->writeInt16($_component->a); + $size += $font->writeInt16($_component->b); + $size += $font->writeInt16($_component->c); + $size += $font->writeInt16($_component->d); + } + } + + if($_component->instructions !== null) { + $size += $font->write($_component->instructions, strlen($_component->instructions)); + } + + return $size; + } + + public function getSVGContours() { + $contours = array(); + + /** @var \FontLib\Table\Type\glyf $glyph_data */ + $glyph_data = $this->getFont()->getTableObject("glyf"); + + /** @var Outline[] $glyphs */ + $glyphs = $glyph_data->data; + + foreach ($this->components as $component) { + $_glyph = $glyphs[$component->glyphIndex]; + + if ($_glyph !== $this) { + $contours[] = array( + "contours" => $_glyph->getSVGContours(), + "transform" => $component->getMatrix(), + ); + } + } + + return $contours; + } +} \ No newline at end of file diff --git a/lib/dompdf/lib/php-font-lib/src/FontLib/Glyph/OutlineSimple.php b/lib/dompdf/lib/php-font-lib/src/FontLib/Glyph/OutlineSimple.php new file mode 100644 index 0000000..c0c5c85 --- /dev/null +++ b/lib/dompdf/lib/php-font-lib/src/FontLib/Glyph/OutlineSimple.php @@ -0,0 +1,335 @@ + + * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + * @version $Id: Font_Table_glyf.php 46 2012-04-02 20:22:38Z fabien.menager $ + */ + +namespace FontLib\Glyph; + +/** + * `glyf` font table. + * + * @package php-font-lib + */ +class OutlineSimple extends Outline { + const ON_CURVE = 0x01; + const X_SHORT_VECTOR = 0x02; + const Y_SHORT_VECTOR = 0x04; + const REPEAT = 0x08; + const THIS_X_IS_SAME = 0x10; + const THIS_Y_IS_SAME = 0x20; + + public $instructions; + public $points; + + function parseData() { + parent::parseData(); + + if (!$this->size) { + return; + } + + $font = $this->getFont(); + + $noc = $this->numberOfContours; + + if ($noc == 0) { + return; + } + + $endPtsOfContours = $font->r(array(self::uint16, $noc)); + + $instructionLength = $font->readUInt16(); + $this->instructions = $font->r(array(self::uint8, $instructionLength)); + + $count = $endPtsOfContours[$noc - 1] + 1; + + // Flags + $flags = array(); + for ($index = 0; $index < $count; $index++) { + $flags[$index] = $font->readUInt8(); + + if ($flags[$index] & self::REPEAT) { + $repeats = $font->readUInt8(); + + for ($i = 1; $i <= $repeats; $i++) { + $flags[$index + $i] = $flags[$index]; + } + + $index += $repeats; + } + } + + $points = array(); + foreach ($flags as $i => $flag) { + $points[$i]["onCurve"] = $flag & self::ON_CURVE; + $points[$i]["endOfContour"] = in_array($i, $endPtsOfContours); + } + + // X Coords + $x = 0; + for ($i = 0; $i < $count; $i++) { + $flag = $flags[$i]; + + if ($flag & self::THIS_X_IS_SAME) { + if ($flag & self::X_SHORT_VECTOR) { + $x += $font->readUInt8(); + } + } + else { + if ($flag & self::X_SHORT_VECTOR) { + $x -= $font->readUInt8(); + } + else { + $x += $font->readInt16(); + } + } + + $points[$i]["x"] = $x; + } + + // Y Coords + $y = 0; + for ($i = 0; $i < $count; $i++) { + $flag = $flags[$i]; + + if ($flag & self::THIS_Y_IS_SAME) { + if ($flag & self::Y_SHORT_VECTOR) { + $y += $font->readUInt8(); + } + } + else { + if ($flag & self::Y_SHORT_VECTOR) { + $y -= $font->readUInt8(); + } + else { + $y += $font->readInt16(); + } + } + + $points[$i]["y"] = $y; + } + + $this->points = $points; + } + + public function splitSVGPath($path) { + preg_match_all('/([a-z])|(-?\d+(?:\.\d+)?)/i', $path, $matches, PREG_PATTERN_ORDER); + + return $matches[0]; + } + + public function makePoints($path) { + $path = $this->splitSVGPath($path); + $l = count($path); + $i = 0; + + $points = array(); + + while ($i < $l) { + switch ($path[$i]) { + // moveTo + case "M": + $points[] = array( + "onCurve" => true, + "x" => $path[++$i], + "y" => $path[++$i], + "endOfContour" => false, + ); + break; + + // lineTo + case "L": + $points[] = array( + "onCurve" => true, + "x" => $path[++$i], + "y" => $path[++$i], + "endOfContour" => false, + ); + break; + + // quadraticCurveTo + case "Q": + $points[] = array( + "onCurve" => false, + "x" => $path[++$i], + "y" => $path[++$i], + "endOfContour" => false, + ); + $points[] = array( + "onCurve" => true, + "x" => $path[++$i], + "y" => $path[++$i], + "endOfContour" => false, + ); + break; + + // closePath + /** @noinspection PhpMissingBreakStatementInspection */ + case "z": + $points[count($points) - 1]["endOfContour"] = true; + + default: + $i++; + break; + } + } + + return $points; + } + + function encode() { + if (empty($this->points)) { + return parent::encode(); + } + + return $this->size = $this->encodePoints($this->points); + } + + public function encodePoints($points) { + $endPtsOfContours = array(); + $flags = array(); + $coords_x = array(); + $coords_y = array(); + + $last_x = 0; + $last_y = 0; + $xMin = $yMin = 0xFFFF; + $xMax = $yMax = -0xFFFF; + foreach ($points as $i => $point) { + $flag = 0; + if ($point["onCurve"]) { + $flag |= self::ON_CURVE; + } + + if ($point["endOfContour"]) { + $endPtsOfContours[] = $i; + } + + // Simplified, we could do some optimizations + if ($point["x"] == $last_x) { + $flag |= self::THIS_X_IS_SAME; + } + else { + $x = intval($point["x"]); + $xMin = min($x, $xMin); + $xMax = max($x, $xMax); + $coords_x[] = $x - $last_x; // int16 + } + + // Simplified, we could do some optimizations + if ($point["y"] == $last_y) { + $flag |= self::THIS_Y_IS_SAME; + } + else { + $y = intval($point["y"]); + $yMin = min($y, $yMin); + $yMax = max($y, $yMax); + $coords_y[] = $y - $last_y; // int16 + } + + $flags[] = $flag; + $last_x = $point["x"]; + $last_y = $point["y"]; + } + + $font = $this->getFont(); + + $l = 0; + $l += $font->writeInt16(count($endPtsOfContours)); // endPtsOfContours + $l += $font->writeFWord(isset($this->xMin) ? $this->xMin : $xMin); // xMin + $l += $font->writeFWord(isset($this->yMin) ? $this->yMin : $yMin); // yMin + $l += $font->writeFWord(isset($this->xMax) ? $this->xMax : $xMax); // xMax + $l += $font->writeFWord(isset($this->yMax) ? $this->yMax : $yMax); // yMax + + // Simple glyf + $l += $font->w(array(self::uint16, count($endPtsOfContours)), $endPtsOfContours); // endPtsOfContours + $l += $font->writeUInt16(0); // instructionLength + $l += $font->w(array(self::uint8, count($flags)), $flags); // flags + $l += $font->w(array(self::int16, count($coords_x)), $coords_x); // xCoordinates + $l += $font->w(array(self::int16, count($coords_y)), $coords_y); // yCoordinates + return $l; + } + + public function getSVGContours($points = null) { + $path = ""; + + if (!$points) { + if (empty($this->points)) { + $this->parseData(); + } + + $points = $this->points; + } + + $length = (empty($points) ? 0 : count($points)); + $firstIndex = 0; + $count = 0; + + for ($i = 0; $i < $length; $i++) { + $count++; + + if ($points[$i]["endOfContour"]) { + $path .= $this->getSVGPath($points, $firstIndex, $count); + $firstIndex = $i + 1; + $count = 0; + } + } + + return $path; + } + + protected function getSVGPath($points, $startIndex, $count) { + $offset = 0; + $path = ""; + + while ($offset < $count) { + $point = $points[$startIndex + $offset % $count]; + $point_p1 = $points[$startIndex + ($offset + 1) % $count]; + + if ($offset == 0) { + $path .= "M{$point['x']},{$point['y']} "; + } + + if ($point["onCurve"]) { + if ($point_p1["onCurve"]) { + $path .= "L{$point_p1['x']},{$point_p1['y']} "; + $offset++; + } + else { + $point_p2 = $points[$startIndex + ($offset + 2) % $count]; + + if ($point_p2["onCurve"]) { + $path .= "Q{$point_p1['x']},{$point_p1['y']},{$point_p2['x']},{$point_p2['y']} "; + } + else { + $path .= "Q{$point_p1['x']},{$point_p1['y']}," . $this->midValue($point_p1['x'], $point_p2['x']) . "," . $this->midValue($point_p1['y'], $point_p2['y']) . " "; + } + + $offset += 2; + } + } + else { + if ($point_p1["onCurve"]) { + $path .= "Q{$point['x']},{$point['y']},{$point_p1['x']},{$point_p1['y']} "; + } + else { + $path .= "Q{$point['x']},{$point['y']}," . $this->midValue($point['x'], $point_p1['x']) . "," . $this->midValue($point['y'], $point_p1['y']) . " "; + } + + $offset++; + } + } + + $path .= "z "; + + return $path; + } + + function midValue($a, $b) { + return $a + ($b - $a) / 2; + } +} diff --git a/lib/dompdf/lib/php-font-lib/src/FontLib/Header.php b/lib/dompdf/lib/php-font-lib/src/FontLib/Header.php new file mode 100644 index 0000000..df308b3 --- /dev/null +++ b/lib/dompdf/lib/php-font-lib/src/FontLib/Header.php @@ -0,0 +1,37 @@ + + * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + */ +namespace FontLib; + +use FontLib\TrueType\File; + +/** + * Font header container. + * + * @package php-font-lib + */ +abstract class Header extends BinaryStream { + /** + * @var File + */ + protected $font; + protected $def = array(); + + public $data; + + public function __construct(File $font) { + $this->font = $font; + } + + public function encode() { + return $this->font->pack($this->def, $this->data); + } + + public function parse() { + $this->data = $this->font->unpack($this->def); + } +} \ No newline at end of file diff --git a/lib/dompdf/lib/php-font-lib/src/FontLib/OpenType/File.php b/lib/dompdf/lib/php-font-lib/src/FontLib/OpenType/File.php new file mode 100644 index 0000000..0b46df9 --- /dev/null +++ b/lib/dompdf/lib/php-font-lib/src/FontLib/OpenType/File.php @@ -0,0 +1,18 @@ + + * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + */ + +namespace FontLib\OpenType; + +/** + * Open Type font, the same as a TrueType one. + * + * @package php-font-lib + */ +class File extends \FontLib\TrueType\File { + // +} diff --git a/lib/dompdf/lib/php-font-lib/src/FontLib/OpenType/TableDirectoryEntry.php b/lib/dompdf/lib/php-font-lib/src/FontLib/OpenType/TableDirectoryEntry.php new file mode 100644 index 0000000..d8f0f6e --- /dev/null +++ b/lib/dompdf/lib/php-font-lib/src/FontLib/OpenType/TableDirectoryEntry.php @@ -0,0 +1,18 @@ + + * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + */ + +namespace FontLib\OpenType; + +/** + * Open Type Table directory entry, the same as a TrueType one. + * + * @package php-font-lib + */ +class TableDirectoryEntry extends \FontLib\TrueType\TableDirectoryEntry { + +} diff --git a/lib/dompdf/lib/php-font-lib/src/FontLib/Table/DirectoryEntry.php b/lib/dompdf/lib/php-font-lib/src/FontLib/Table/DirectoryEntry.php new file mode 100644 index 0000000..b41fdd0 --- /dev/null +++ b/lib/dompdf/lib/php-font-lib/src/FontLib/Table/DirectoryEntry.php @@ -0,0 +1,130 @@ + + * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + */ +namespace FontLib\Table; + +use FontLib\TrueType\File; +use FontLib\Font; +use FontLib\BinaryStream; + +/** + * Generic Font table directory entry. + * + * @package php-font-lib + */ +class DirectoryEntry extends BinaryStream { + /** + * @var File + */ + protected $font; + + /** + * @var Table + */ + protected $font_table; + + public $entryLength = 4; + + public $tag; + public $checksum; + public $offset; + public $length; + + protected $origF; + + /** + * @param string $data + * + * @return int + */ + static function computeChecksum($data) { + $len = mb_strlen($data, '8bit'); + $mod = $len % 4; + + if ($mod) { + $data = str_pad($data, $len + (4 - $mod), "\0"); + } + + $table = unpack("N*", $data); + return array_sum($table); + } + + function __construct(File $font) { + $this->font = $font; + $this->f = $font->f; + } + + function parse() { + $this->tag = $this->font->read(4); + } + + function open($filename, $mode = self::modeRead) { + // void + } + + function setTable(Table $font_table) { + $this->font_table = $font_table; + } + + function encode($entry_offset) { + Font::d("\n==== $this->tag ===="); + //Font::d("Entry offset = $entry_offset"); + + $data = $this->font_table; + $font = $this->font; + + $table_offset = $font->pos(); + $this->offset = $table_offset; + $table_length = $data->encode(); + + $font->seek($table_offset + $table_length); + $pad = 0; + $mod = $table_length % 4; + if ($mod != 0) { + $pad = 4 - $mod; + $font->write(str_pad("", $pad, "\0"), $pad); + } + + $font->seek($table_offset); + $table_data = $font->read($table_length); + + $font->seek($entry_offset); + + $font->write($this->tag, 4); + $font->writeUInt32(self::computeChecksum($table_data)); + $font->writeUInt32($table_offset); + $font->writeUInt32($table_length); + + Font::d("Bytes written = $table_length"); + + $font->seek($table_offset + $table_length + $pad); + } + + /** + * @return File + */ + function getFont() { + return $this->font; + } + + function startRead() { + $this->font->seek($this->offset); + } + + function endRead() { + // + } + + function startWrite() { + $this->font->seek($this->offset); + } + + function endWrite() { + // + } +} + diff --git a/lib/dompdf/lib/php-font-lib/src/FontLib/Table/Table.php b/lib/dompdf/lib/php-font-lib/src/FontLib/Table/Table.php new file mode 100644 index 0000000..57328dd --- /dev/null +++ b/lib/dompdf/lib/php-font-lib/src/FontLib/Table/Table.php @@ -0,0 +1,93 @@ + + * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + */ +namespace FontLib\Table; + +use FontLib\TrueType\File; +use FontLib\Font; +use FontLib\BinaryStream; + +/** + * Generic font table. + * + * @package php-font-lib + */ +class Table extends BinaryStream { + /** + * @var DirectoryEntry + */ + protected $entry; + protected $def = array(); + + public $data; + + final public function __construct(DirectoryEntry $entry) { + $this->entry = $entry; + $entry->setTable($this); + } + + /** + * @return File + */ + public function getFont() { + return $this->entry->getFont(); + } + + protected function _encode() { + if (empty($this->data)) { + Font::d(" >> Table is empty"); + + return 0; + } + + return $this->getFont()->pack($this->def, $this->data); + } + + protected function _parse() { + $this->data = $this->getFont()->unpack($this->def); + } + + protected function _parseRaw() { + $this->data = $this->getFont()->read($this->entry->length); + } + + protected function _encodeRaw() { + return $this->getFont()->write($this->data, $this->entry->length); + } + + public function toHTML() { + return " " . var_export($this->data, true) . ""; + } + + final public function encode() { + $this->entry->startWrite(); + + if (false && empty($this->def)) { + $length = $this->_encodeRaw(); + } + else { + $length = $this->_encode(); + } + + $this->entry->endWrite(); + + return $length; + } + + final public function parse() { + $this->entry->startRead(); + + if (false && empty($this->def)) { + $this->_parseRaw(); + } + else { + $this->_parse(); + } + + $this->entry->endRead(); + } +} \ No newline at end of file diff --git a/lib/dompdf/lib/php-font-lib/src/FontLib/Table/Type/cmap.php b/lib/dompdf/lib/php-font-lib/src/FontLib/Table/Type/cmap.php new file mode 100644 index 0000000..02788ef --- /dev/null +++ b/lib/dompdf/lib/php-font-lib/src/FontLib/Table/Type/cmap.php @@ -0,0 +1,381 @@ + + * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + */ + +namespace FontLib\Table\Type; +use FontLib\Table\Table; + +/** + * `cmap` font table. + * + * @package php-font-lib + */ +class cmap extends Table { + private static $header_format = array( + "version" => self::uint16, + "numberSubtables" => self::uint16, + ); + + private static $subtable_header_format = array( + "platformID" => self::uint16, + "platformSpecificID" => self::uint16, + "offset" => self::uint32, + ); + + private static $subtable_v2_format = array( + "length" => self::uint16, + "language" => self::uint16 + ); + + private static $subtable_v2_format_subheader = array( + "firstCode" => self::uint16, + "entryCount" => self::uint16, + "idDelta" => self::int16, + "idRangeOffset" => self::uint16 + ); + + private static $subtable_v4_format = array( + "length" => self::uint16, + "language" => self::uint16, + "segCountX2" => self::uint16, + "searchRange" => self::uint16, + "entrySelector" => self::uint16, + "rangeShift" => self::uint16, + ); + + private static $subtable_v12_format = array( + "length" => self::uint32, + "language" => self::uint32, + "ngroups" => self::uint32 + ); + + protected function _parse() { + $font = $this->getFont(); + + $cmap_offset = $font->pos(); + + $data = $font->unpack(self::$header_format); + + $subtables = array(); + for ($i = 0; $i < $data["numberSubtables"]; $i++) { + $subtables[] = $font->unpack(self::$subtable_header_format); + } + + $data["subtables"] = $subtables; + + foreach ($data["subtables"] as $i => &$subtable) { + $font->seek($cmap_offset + $subtable["offset"]); + + $subtable["format"] = $font->readUInt16(); + + switch ($subtable["format"]) { + case 0: + case 6: + case 8: + case 10: + case 13: + case 14: + unset($data["subtables"][$i]); + $data["numberSubtables"]--; + continue 2; + + case 2: + $subtable += $font->unpack(self::$subtable_v2_format); + + $subHeaderKeys = array_map(function($val) { return $val / 8; }, $font->readUInt16Many(256)); + $subHeaders = array(); + + $glyphIdArray = array(); + $maxSubHeaderIndex = max($subHeaderKeys); + for ($i = 0; $i <= $maxSubHeaderIndex; $i++) { + $subHeader = $font->unpack(self::$subtable_v2_format_subheader); + $offset = $font->pos(); + $subHeader["glyphIdArrayOffset"] = $offset + $subHeader["idRangeOffset"] - 2; + $subHeaders[$i] = $subHeader; + + if (!\array_key_exists($subHeader["glyphIdArrayOffset"], $glyphIdArray) || count($glyphIdArray[$subHeader["glyphIdArrayOffset"]]) < $subHeader["entryCount"]) { + $font->seek($subHeader["glyphIdArrayOffset"]); + $glyphIdArray[$subHeader["glyphIdArrayOffset"]] = $font->readUInt16Many($subHeader["entryCount"]); + $font->seek($offset); + } + } + + $glyphIndexArray = array(); + foreach ($subHeaderKeys as $highByte => $subHeaderKey) { + $subHeader = $subHeaders[$subHeaderKey]; + if ($subHeaderKey === 0) { + $c = $highByte; + if ($c < $subHeader["firstCode"] || $c >= ($subHeader["firstCode"] + $subHeader["entryCount"])) { + $glyphIndexArray[$c] = 0; + continue; + } + $c = $highByte; + $index = $c - $subHeader["firstCode"]; + $glyphId = $glyphIdArray[$subHeader["glyphIdArrayOffset"]][$index]; + if ($glyphId === 0) { + $glyphIndexArray[$c] = 0; + } else { + $glyphIndexArray[$c] = ($glyphId + $subHeader["idDelta"]) & 0xFFFF; + } + } else { + for ($index = 0; $index < $subHeader["entryCount"]; $index++) { + $c = null; + $lowByte = $subHeader["firstCode"] + $index; + $c = (($highByte & 0xFF) << 8) | ($lowByte & 0xFF); + $glyphId = $glyphIdArray[$subHeader["glyphIdArrayOffset"]][$index]; + if ($glyphId === 0) { + $glyphIndexArray[$c] = 0; + } else { + $glyphIndexArray[$c] = ($glyphId + $subHeader["idDelta"]) & 0xFFFF; + } + } + } + } + + $subtable += array( + "subHeaderKeys" => $subHeaderKeys, + "subHeaders" => $subHeaders, + "glyphIdArray" => $glyphIdArray, + "glyphIndexArray" => $glyphIndexArray + ); + + break; + + case 4: + $subtable += $font->unpack(self::$subtable_v4_format); + + $segCount = $subtable["segCountX2"] / 2; + $subtable["segCount"] = $segCount; + + $endCode = $font->readUInt16Many($segCount); + + $font->readUInt16(); // reservedPad + + $startCode = $font->readUInt16Many($segCount); + $idDelta = $font->readInt16Many($segCount); + + $ro_start = $font->pos(); + $idRangeOffset = $font->readUInt16Many($segCount); + + $glyphIndexArray = array(); + for ($i = 0; $i < $segCount; $i++) { + $c1 = $startCode[$i]; + $c2 = $endCode[$i]; + $d = $idDelta[$i]; + $ro = $idRangeOffset[$i]; + + if ($ro > 0) { + $font->seek($subtable["offset"] + 2 * $i + $ro); + } + + for ($c = $c1; $c <= $c2; $c++) { + if ($c === 0xFFFF) { + continue; + } + + if ($ro == 0) { + $gid = ($c + $d) & 0xFFFF; + } + else { + $offset = ($c - $c1) * 2 + $ro; + $offset = $ro_start + 2 * $i + $offset; + + $gid = 0; + if ($font->seek($offset) === true) { + $gid = $font->readUInt16(); + } + + if ($gid != 0) { + $gid = ($gid + $d) & 0xFFFF; + } + } + + if ($gid >= 0) { + $glyphIndexArray[$c] = $gid; + } + } + } + + $subtable += array( + "endCode" => $endCode, + "startCode" => $startCode, + "idDelta" => $idDelta, + "idRangeOffset" => $idRangeOffset, + "glyphIndexArray" => $glyphIndexArray + ); + break; + + case 12: + $font->readUInt16(); + + $subtable += $font->unpack(self::$subtable_v12_format); + + $glyphIndexArray = array(); + $endCodes = array(); + $startCodes = array(); + + for ($p = 0; $p < $subtable['ngroups']; $p++) { + + $startCode = $startCodes[] = $font->readUInt32(); + $endCode = $endCodes[] = $font->readUInt32(); + $startGlyphCode = $font->readUInt32(); + + for ($c = $startCode; $c <= $endCode; $c++) { + $glyphIndexArray[$c] = $startGlyphCode; + $startGlyphCode++; + } + } + + $subtable += array( + "startCode" => $startCodes, + "endCode" => $endCodes, + "glyphIndexArray" => $glyphIndexArray, + ); + break; + } + } + + $this->data = $data; + } + + function _encode() { + $font = $this->getFont(); + + $subset = $font->getSubset(); + $glyphIndexArray = $font->getUnicodeCharMap(); + + $newGlyphIndexArray = array(); + foreach ($glyphIndexArray as $code => $gid) { + $new_gid = array_search($gid, $subset); + if ($new_gid !== false) { + $newGlyphIndexArray[$code] = $new_gid; + } + } + + ksort($newGlyphIndexArray); // Sort by char code + + $segments = array(); + + $i = -1; + $prevCode = 0xFFFF; + $prevGid = 0xFFFF; + + foreach ($newGlyphIndexArray as $code => $gid) { + if ( + $prevCode + 1 != $code || + $prevGid + 1 != $gid + ) { + $i++; + $segments[$i] = array(); + } + + $segments[$i][] = array($code, $gid); + + $prevCode = $code; + $prevGid = $gid; + } + + $segments[][] = array(0xFFFF, null); + + $startCode = array(); + $endCode = array(); + $idDelta = array(); + + foreach ($segments as $codes) { + $start = reset($codes); + $end = end($codes); + + $startCode[] = $start[0]; + $endCode[] = $end[0]; + $idDelta[] = $start[1] - $start[0]; + } + + $segCount = count($startCode); + $idRangeOffset = array_fill(0, $segCount, 0); + + $searchRange = 1; + $entrySelector = 0; + while ($searchRange * 2 <= $segCount) { + $searchRange *= 2; + $entrySelector++; + } + $searchRange *= 2; + $rangeShift = $segCount * 2 - $searchRange; + + $subtables = array( + array( + // header + "platformID" => 3, // Unicode + "platformSpecificID" => 1, + "offset" => null, + + // subtable + "format" => 4, + "length" => null, + "language" => 0, + "segCount" => $segCount, + "segCountX2" => $segCount * 2, + "searchRange" => $searchRange, + "entrySelector" => $entrySelector, + "rangeShift" => $rangeShift, + "startCode" => $startCode, + "endCode" => $endCode, + "idDelta" => $idDelta, + "idRangeOffset" => $idRangeOffset, + "glyphIndexArray" => $newGlyphIndexArray, + ) + ); + + $data = array( + "version" => 0, + "numberSubtables" => count($subtables), + "subtables" => $subtables, + ); + + $length = $font->pack(self::$header_format, $data); + + $subtable_headers_size = $data["numberSubtables"] * 8; // size of self::$subtable_header_format + $subtable_headers_offset = $font->pos(); + + $length += $font->write(str_repeat("\0", $subtable_headers_size), $subtable_headers_size); + + // write subtables data + foreach ($data["subtables"] as $i => $subtable) { + $length_before = $length; + $data["subtables"][$i]["offset"] = $length; + + $length += $font->writeUInt16($subtable["format"]); + + $before_subheader = $font->pos(); + $length += $font->pack(self::$subtable_v4_format, $subtable); + + $segCount = $subtable["segCount"]; + $length += $font->w(array(self::uint16, $segCount), $subtable["endCode"]); + $length += $font->writeUInt16(0); // reservedPad + $length += $font->w(array(self::uint16, $segCount), $subtable["startCode"]); + $length += $font->w(array(self::int16, $segCount), $subtable["idDelta"]); + $length += $font->w(array(self::uint16, $segCount), $subtable["idRangeOffset"]); + $length += $font->w(array(self::uint16, $segCount), array_values($subtable["glyphIndexArray"])); + + $after_subtable = $font->pos(); + + $subtable["length"] = $length - $length_before; + $font->seek($before_subheader); + $font->pack(self::$subtable_v4_format, $subtable); + + $font->seek($after_subtable); + } + + // write subtables headers + $font->seek($subtable_headers_offset); + foreach ($data["subtables"] as $subtable) { + $font->pack(self::$subtable_header_format, $subtable); + } + + return $length; + } +} diff --git a/lib/dompdf/lib/php-font-lib/src/FontLib/Table/Type/cvt.php b/lib/dompdf/lib/php-font-lib/src/FontLib/Table/Type/cvt.php new file mode 100644 index 0000000..cec9ee4 --- /dev/null +++ b/lib/dompdf/lib/php-font-lib/src/FontLib/Table/Type/cvt.php @@ -0,0 +1,27 @@ + + * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + */ + +namespace FontLib\Table\Type; +use FontLib\Table\Table; + +/** + * `cvt ` font table. + * + * @package php-font-lib + */ +class cvt extends Table { + private $rawData; + protected function _parse() { + $font = $this->getFont(); + $font->seek($this->entry->offset); + $this->rawData = $font->read($this->entry->length); + } + function _encode() { + return $this->getFont()->write($this->rawData, $this->entry->length); + } +} \ No newline at end of file diff --git a/lib/dompdf/lib/php-font-lib/src/FontLib/Table/Type/fpgm.php b/lib/dompdf/lib/php-font-lib/src/FontLib/Table/Type/fpgm.php new file mode 100644 index 0000000..3c37c18 --- /dev/null +++ b/lib/dompdf/lib/php-font-lib/src/FontLib/Table/Type/fpgm.php @@ -0,0 +1,27 @@ + + * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + */ + +namespace FontLib\Table\Type; +use FontLib\Table\Table; + +/** + * `fpgm` font table. + * + * @package php-font-lib + */ +class fpgm extends Table { + private $rawData; + protected function _parse() { + $font = $this->getFont(); + $font->seek($this->entry->offset); + $this->rawData = $font->read($this->entry->length); + } + function _encode() { + return $this->getFont()->write($this->rawData, $this->entry->length); + } +} \ No newline at end of file diff --git a/lib/dompdf/lib/php-font-lib/src/FontLib/Table/Type/glyf.php b/lib/dompdf/lib/php-font-lib/src/FontLib/Table/Type/glyf.php new file mode 100644 index 0000000..8e47f14 --- /dev/null +++ b/lib/dompdf/lib/php-font-lib/src/FontLib/Table/Type/glyf.php @@ -0,0 +1,166 @@ + + * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + */ + +namespace FontLib\Table\Type; + +use FontLib\Table\Table; +use FontLib\Glyph\Outline; +use FontLib\Glyph\OutlineSimple; + +/** + * `glyf` font table. + * + * @package php-font-lib + * @property Outline[] $data + */ +class glyf extends Table { + protected function _parse() { + $font = $this->getFont(); + $offset = $font->pos(); + + $loca = $font->getData("loca"); + $real_loca = array_slice($loca, 0, -1); // Not the last dummy loca entry + + $data = array(); + + foreach ($real_loca as $gid => $location) { + $_offset = $offset + $loca[$gid]; + $_size = $loca[$gid + 1] - $loca[$gid]; + $data[$gid] = Outline::init($this, $_offset, $_size, $font); + } + + $this->data = $data; + } + + public function getGlyphIDs($gids = array()) { + $glyphIDs = array(); + + foreach ($gids as $_gid) { + $_glyph = $this->data[$_gid]; + $glyphIDs = array_merge($glyphIDs, $_glyph->getGlyphIDs()); + } + + return array_unique(array_merge($gids, $glyphIDs)); + } + + public function toHTML($n = 500) { + $max = 160; + $font = $this->getFont(); + + $head = $font->getData("head"); + $head_json = json_encode($head); + + $os2 = $font->getData("OS/2"); + $os2_json = json_encode($os2); + + $hmtx = $font->getData("hmtx"); + $hmtx_json = json_encode($hmtx); + + $names = $font->getData("post", "names"); + $glyphIndexArray = array_flip($font->getUnicodeCharMap()); + + $width = (abs($head["xMin"]) + $head["xMax"]); + $height = (abs($head["yMin"]) + $head["yMax"]); + + $ratio = 1; + if ($width > $max || $height > $max) { + $ratio = max($width, $height) / $max; + $width = round($width / $ratio); + $height = round($height / $ratio); + } + + $s = "" . "Only the first $n simple glyphs are shown (" . count($this->data) . " total) +
+ "; + + foreach ($this->data as $g => $glyph) { + if ($n-- <= 0) { + break; + } + + $glyph->parseData(); + + $shape = array( + "SVGContours" => $glyph->getSVGContours(), + "xMin" => $glyph->xMin, + "yMin" => $glyph->yMin, + "xMax" => $glyph->xMax, + "yMax" => $glyph->yMax, + ); + $shape_json = json_encode($shape); + + $type = ($glyph instanceof OutlineSimple ? "simple" : "composite"); + $char = isset($glyphIndexArray[$g]) ? $glyphIndexArray[$g] : 0; + $name = isset($names[$g]) ? $names[$g] : sprintf("uni%04x", $char); + $char = $char ? "{$glyphIndexArray[$g]};" : ""; + + if ($char === "" && empty($shape["SVGContours"])) { + $n++; + continue; + } + + $s .= "Simple glyph+Composite glyph+ Zoom: ++ $g + $char + $name + "; + + if ($type == "composite") { + foreach ($glyph->getGlyphIDs() as $_id) { + $s .= "$_id "; + } + } + + $s .= "+ "; + } + + return $s; + } + + + protected function _encode() { + $font = $this->getFont(); + $subset = $font->getSubset(); + $data = $this->data; + + $loca = array(); + + $length = 0; + foreach ($subset as $gid) { + $loca[] = $length; + + $bytes = $data[$gid]->encode(); + + $pad = 0; + $mod = $bytes % 4; + if ($mod != 0) { + $pad = 4 - $mod; + $font->write(str_pad("", $pad, "\0"), $pad); + } + $length += $bytes + $pad; + } + + $loca[] = $length; // dummy loca + $font->getTableObject("loca")->data = $loca; + + return $length; + } +} \ No newline at end of file diff --git a/lib/dompdf/lib/php-font-lib/src/FontLib/Table/Type/head.php b/lib/dompdf/lib/php-font-lib/src/FontLib/Table/Type/head.php new file mode 100644 index 0000000..0686508 --- /dev/null +++ b/lib/dompdf/lib/php-font-lib/src/FontLib/Table/Type/head.php @@ -0,0 +1,51 @@ + + * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + */ + +namespace FontLib\Table\Type; +use FontLib\Table\Table; +use Exception; + +/** + * `head` font table. + * + * @package php-font-lib + */ +class head extends Table { + protected $def = array( + "tableVersion" => self::Fixed, + "fontRevision" => self::Fixed, + "checkSumAdjustment" => self::uint32, + "magicNumber" => self::uint32, + "flags" => self::uint16, + "unitsPerEm" => self::uint16, + "created" => self::longDateTime, + "modified" => self::longDateTime, + "xMin" => self::FWord, + "yMin" => self::FWord, + "xMax" => self::FWord, + "yMax" => self::FWord, + "macStyle" => self::uint16, + "lowestRecPPEM" => self::uint16, + "fontDirectionHint" => self::int16, + "indexToLocFormat" => self::int16, + "glyphDataFormat" => self::int16, + ); + + protected function _parse() { + parent::_parse(); + + if ($this->data["magicNumber"] != 0x5F0F3CF5) { + throw new Exception("Incorrect magic number (" . dechex($this->data["magicNumber"]) . ")"); + } + } + + function _encode() { + $this->data["checkSumAdjustment"] = 0; + return parent::_encode(); + } +} \ No newline at end of file diff --git a/lib/dompdf/lib/php-font-lib/src/FontLib/Table/Type/hhea.php b/lib/dompdf/lib/php-font-lib/src/FontLib/Table/Type/hhea.php new file mode 100644 index 0000000..cd69040 --- /dev/null +++ b/lib/dompdf/lib/php-font-lib/src/FontLib/Table/Type/hhea.php @@ -0,0 +1,44 @@ + + * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + */ + +namespace FontLib\Table\Type; +use FontLib\Table\Table; + +/** + * `hhea` font table. + * + * @package php-font-lib + */ +class hhea extends Table { + protected $def = array( + "version" => self::Fixed, + "ascent" => self::FWord, + "descent" => self::FWord, + "lineGap" => self::FWord, + "advanceWidthMax" => self::uFWord, + "minLeftSideBearing" => self::FWord, + "minRightSideBearing" => self::FWord, + "xMaxExtent" => self::FWord, + "caretSlopeRise" => self::int16, + "caretSlopeRun" => self::int16, + "caretOffset" => self::FWord, + self::int16, + self::int16, + self::int16, + self::int16, + "metricDataFormat" => self::int16, + "numOfLongHorMetrics" => self::uint16, + ); + + function _encode() { + $font = $this->getFont(); + $this->data["numOfLongHorMetrics"] = count($font->getSubset()); + + return parent::_encode(); + } +} \ No newline at end of file diff --git a/lib/dompdf/lib/php-font-lib/src/FontLib/Table/Type/hmtx.php b/lib/dompdf/lib/php-font-lib/src/FontLib/Table/Type/hmtx.php new file mode 100644 index 0000000..ef985bb --- /dev/null +++ b/lib/dompdf/lib/php-font-lib/src/FontLib/Table/Type/hmtx.php @@ -0,0 +1,65 @@ + + * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + */ + +namespace FontLib\Table\Type; +use FontLib\Table\Table; + +/** + * `hmtx` font table. + * + * @package php-font-lib + */ +class hmtx extends Table { + protected function _parse() { + $font = $this->getFont(); + $offset = $font->pos(); + + $numOfLongHorMetrics = $font->getData("hhea", "numOfLongHorMetrics"); + $numGlyphs = $font->getData("maxp", "numGlyphs"); + + $font->seek($offset); + + $data = array(); + $metrics = $font->readUInt16Many($numOfLongHorMetrics * 2); + for ($gid = 0, $mid = 0; $gid < $numOfLongHorMetrics; $gid++) { + $advanceWidth = isset($metrics[$mid]) ? $metrics[$mid] : 0; + $mid += 1; + $leftSideBearing = isset($metrics[$mid]) ? $metrics[$mid] : 0; + $mid += 1; + $data[$gid] = array($advanceWidth, $leftSideBearing); + } + + if ($numOfLongHorMetrics < $numGlyphs) { + $lastWidth = end($data)[0]; + $numLeft = $numGlyphs - $numOfLongHorMetrics; + $metrics = $font->readUInt16Many($numLeft); + for($i = 0; $i < $numLeft; $i++) { + $gid = $numOfLongHorMetrics + $i; + $leftSideBearing = isset($metrics[$i]) ? $metrics[$i] : 0; + $data[$gid] = array($lastWidth, $leftSideBearing); + } + } + + $this->data = $data; + } + + protected function _encode() { + $font = $this->getFont(); + $subset = $font->getSubset(); + $data = $this->data; + + $length = 0; + + foreach ($subset as $gid) { + $length += $font->writeUInt16($data[$gid][0]); + $length += $font->writeUInt16($data[$gid][1]); + } + + return $length; + } +} \ No newline at end of file diff --git a/lib/dompdf/lib/php-font-lib/src/FontLib/Table/Type/kern.php b/lib/dompdf/lib/php-font-lib/src/FontLib/Table/Type/kern.php new file mode 100644 index 0000000..538d8b2 --- /dev/null +++ b/lib/dompdf/lib/php-font-lib/src/FontLib/Table/Type/kern.php @@ -0,0 +1,80 @@ + + * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + */ + +namespace FontLib\Table\Type; +use FontLib\Table\Table; + +/** + * `kern` font table. + * + * @package php-font-lib + */ +class kern extends Table { + protected function _parse() { + $font = $this->getFont(); + + $data = $font->unpack(array( + "version" => self::uint16, + "nTables" => self::uint16, + + // only the first subtable will be parsed + "subtableVersion" => self::uint16, + "length" => self::uint16, + "coverage" => self::uint16, + )); + + $data["format"] = ($data["coverage"] >> 8); + + $subtable = array(); + + switch ($data["format"]) { + case 0: + $subtable = $font->unpack(array( + "nPairs" => self::uint16, + "searchRange" => self::uint16, + "entrySelector" => self::uint16, + "rangeShift" => self::uint16, + )); + + $pairs = array(); + $tree = array(); + + $values = $font->readUInt16Many($subtable["nPairs"] * 3); + for ($i = 0, $idx = 0; $i < $subtable["nPairs"]; $i++) { + $left = $values[$idx++]; + $right = $values[$idx++]; + $value = $values[$idx++]; + + if ($value >= 0x8000) { + $value -= 0x10000; + } + + $pairs[] = array( + "left" => $left, + "right" => $right, + "value" => $value, + ); + + $tree[$left][$right] = $value; + } + + //$subtable["pairs"] = $pairs; + $subtable["tree"] = $tree; + break; + + case 1: + case 2: + case 3: + break; + } + + $data["subtable"] = $subtable; + + $this->data = $data; + } +} \ No newline at end of file diff --git a/lib/dompdf/lib/php-font-lib/src/FontLib/Table/Type/loca.php b/lib/dompdf/lib/php-font-lib/src/FontLib/Table/Type/loca.php new file mode 100644 index 0000000..25453f7 --- /dev/null +++ b/lib/dompdf/lib/php-font-lib/src/FontLib/Table/Type/loca.php @@ -0,0 +1,80 @@ + + * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + */ + +namespace FontLib\Table\Type; +use FontLib\Table\Table; + +/** + * `loca` font table. + * + * @package php-font-lib + */ +class loca extends Table { + protected function _parse() { + $font = $this->getFont(); + $offset = $font->pos(); + + $indexToLocFormat = $font->getData("head", "indexToLocFormat"); + $numGlyphs = $font->getData("maxp", "numGlyphs"); + + $font->seek($offset); + + $data = array(); + + // 2 bytes + if ($indexToLocFormat == 0) { + $d = $font->read(($numGlyphs + 1) * 2); + $loc = unpack("n*", $d); + + for ($i = 0; $i <= $numGlyphs; $i++) { + $data[] = isset($loc[$i + 1]) ? $loc[$i + 1] * 2 : 0; + } + } + + // 4 bytes + else { + if ($indexToLocFormat == 1) { + $d = $font->read(($numGlyphs + 1) * 4); + $loc = unpack("N*", $d); + + for ($i = 0; $i <= $numGlyphs; $i++) { + $data[] = isset($loc[$i + 1]) ? $loc[$i + 1] : 0; + } + } + } + + $this->data = $data; + } + + function _encode() { + $font = $this->getFont(); + $data = $this->data; + + $indexToLocFormat = $font->getData("head", "indexToLocFormat"); + $numGlyphs = $font->getData("maxp", "numGlyphs"); + $length = 0; + + // 2 bytes + if ($indexToLocFormat == 0) { + for ($i = 0; $i <= $numGlyphs; $i++) { + $length += $font->writeUInt16($data[$i] / 2); + } + } + + // 4 bytes + else { + if ($indexToLocFormat == 1) { + for ($i = 0; $i <= $numGlyphs; $i++) { + $length += $font->writeUInt32($data[$i]); + } + } + } + + return $length; + } +} \ No newline at end of file diff --git a/lib/dompdf/lib/php-font-lib/src/FontLib/Table/Type/maxp.php b/lib/dompdf/lib/php-font-lib/src/FontLib/Table/Type/maxp.php new file mode 100644 index 0000000..c69da3c --- /dev/null +++ b/lib/dompdf/lib/php-font-lib/src/FontLib/Table/Type/maxp.php @@ -0,0 +1,42 @@ + + * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + */ + +namespace FontLib\Table\Type; +use FontLib\Table\Table; + +/** + * `maxp` font table. + * + * @package php-font-lib + */ +class maxp extends Table { + protected $def = array( + "version" => self::Fixed, + "numGlyphs" => self::uint16, + "maxPoints" => self::uint16, + "maxContours" => self::uint16, + "maxComponentPoints" => self::uint16, + "maxComponentContours" => self::uint16, + "maxZones" => self::uint16, + "maxTwilightPoints" => self::uint16, + "maxStorage" => self::uint16, + "maxFunctionDefs" => self::uint16, + "maxInstructionDefs" => self::uint16, + "maxStackElements" => self::uint16, + "maxSizeOfInstructions" => self::uint16, + "maxComponentElements" => self::uint16, + "maxComponentDepth" => self::uint16, + ); + + function _encode() { + $font = $this->getFont(); + $this->data["numGlyphs"] = count($font->getSubset()); + + return parent::_encode(); + } +} \ No newline at end of file diff --git a/lib/dompdf/lib/php-font-lib/src/FontLib/Table/Type/name.php b/lib/dompdf/lib/php-font-lib/src/FontLib/Table/Type/name.php new file mode 100644 index 0000000..acdda7a --- /dev/null +++ b/lib/dompdf/lib/php-font-lib/src/FontLib/Table/Type/name.php @@ -0,0 +1,242 @@ + + * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + */ + +namespace FontLib\Table\Type; + +use FontLib\Table\Table; +use FontLib\Font; + +/** + * `name` font table. + * + * @package php-font-lib + */ +class name extends Table { + private static $header_format = array( + "format" => self::uint16, + "count" => self::uint16, + "stringOffset" => self::uint16, + ); + + const NAME_COPYRIGHT = 0; + const NAME_NAME = 1; + const NAME_SUBFAMILY = 2; + const NAME_SUBFAMILY_ID = 3; + const NAME_FULL_NAME = 4; + const NAME_VERSION = 5; + const NAME_POSTSCRIPT_NAME = 6; + const NAME_TRADEMARK = 7; + const NAME_MANUFACTURER = 8; + const NAME_DESIGNER = 9; + const NAME_DESCRIPTION = 10; + const NAME_VENDOR_URL = 11; + const NAME_DESIGNER_URL = 12; + const NAME_LICENSE = 13; + const NAME_LICENSE_URL = 14; + const NAME_PREFERRE_FAMILY = 16; + const NAME_PREFERRE_SUBFAMILY = 17; + const NAME_COMPAT_FULL_NAME = 18; + const NAME_SAMPLE_TEXT = 19; + + static $nameIdCodes = array( + 0 => "Copyright", + 1 => "FontName", + 2 => "FontSubfamily", + 3 => "UniqueID", + 4 => "FullName", + 5 => "Version", + 6 => "PostScriptName", + 7 => "Trademark", + 8 => "Manufacturer", + 9 => "Designer", + 10 => "Description", + 11 => "FontVendorURL", + 12 => "FontDesignerURL", + 13 => "LicenseDescription", + 14 => "LicenseURL", + // 15 + 16 => "PreferredFamily", + 17 => "PreferredSubfamily", + 18 => "CompatibleFullName", + 19 => "SampleText", + ); + + static $platforms = array( + 0 => "Unicode", + 1 => "Macintosh", + // 2 => Reserved + 3 => "Microsoft", + ); + + static $platformSpecific = array( + // Unicode + 0 => array( + 0 => "Default semantics", + 1 => "Version 1.1 semantics", + 2 => "ISO 10646 1993 semantics (deprecated)", + 3 => "Unicode 2.0 or later semantics", + ), + + // Macintosh + 1 => array( + 0 => "Roman", + 1 => "Japanese", + 2 => "Traditional Chinese", + 3 => "Korean", + 4 => "Arabic", + 5 => "Hebrew", + 6 => "Greek", + 7 => "Russian", + 8 => "RSymbol", + 9 => "Devanagari", + 10 => "Gurmukhi", + 11 => "Gujarati", + 12 => "Oriya", + 13 => "Bengali", + 14 => "Tamil", + 15 => "Telugu", + 16 => "Kannada", + 17 => "Malayalam", + 18 => "Sinhalese", + 19 => "Burmese", + 20 => "Khmer", + 21 => "Thai", + 22 => "Laotian", + 23 => "Georgian", + 24 => "Armenian", + 25 => "Simplified Chinese", + 26 => "Tibetan", + 27 => "Mongolian", + 28 => "Geez", + 29 => "Slavic", + 30 => "Vietnamese", + 31 => "Sindhi", + ), + + // Microsoft + 3 => array( + 0 => "Symbol", + 1 => "Unicode BMP (UCS-2)", + 2 => "ShiftJIS", + 3 => "PRC", + 4 => "Big5", + 5 => "Wansung", + 6 => "Johab", + // 7 => Reserved + // 8 => Reserved + // 9 => Reserved + 10 => "Unicode UCS-4", + ), + ); + + protected function _parse() { + $font = $this->getFont(); + + $tableOffset = $font->pos(); + + $data = $font->unpack(self::$header_format); + + $records = array(); + for ($i = 0; $i < $data["count"]; $i++) { + $record = new nameRecord(); + $record_data = $font->unpack(nameRecord::$format); + $record->map($record_data); + + $records[] = $record; + } + + $system_encodings = mb_list_encodings(); + $system_encodings = array_change_key_case(array_fill_keys($system_encodings, true), CASE_UPPER); + + $names = array(); + foreach ($records as $record) { + $font->seek($tableOffset + $data["stringOffset"] + $record->offset); + $record->stringRaw = $font->read($record->length); + + $encoding = null; + switch ($record->platformID) { + case 3: + switch ($record->platformSpecificID) { + case 2: + if (\array_key_exists("SJIS", $system_encodings)) { + $encoding = "SJIS"; + } + break; + case 3: + if (\array_key_exists("GB18030", $system_encodings)) { + $encoding = "GB18030"; + } + break; + case 4: + if (\array_key_exists("BIG-5", $system_encodings)) { + $encoding = "BIG-5"; + } + break; + case 5: + if (\array_key_exists("UHC", $system_encodings)) { + $encoding = "UHC"; + } + break; + } + break; + } + if ($encoding === null) { + $encoding = "UTF-16"; + } + + $record->string = mb_convert_encoding($record->stringRaw, "UTF-8", $encoding); + if (strpos($record->string, "\0") !== false) { + $record->string = str_replace("\0", "", $record->string); + } + $names[$record->nameID] = $record; + } + + $data["records"] = $names; + + $this->data = $data; + } + + protected function _encode() { + $font = $this->getFont(); + + /** @var nameRecord[] $records */ + $records = $this->data["records"]; + $count_records = \count($records); + + $this->data["count"] = $count_records; + $this->data["stringOffset"] = 6 + ($count_records * 12); // 6 => uint16 * 3, 12 => sizeof self::$record_format + + $length = $font->pack(self::$header_format, $this->data); + + $offset = 0; + + /** @var nameRecord[] $records_to_encode */ + $records_to_encode = array(); + foreach ($records as $record) { + $encoded_record = new nameRecord(); + $encoded_record->platformID = 3; + $encoded_record->platformSpecificID = 1; + $encoded_record->languageID = $record->languageID; + $encoded_record->nameID = $record->nameID; + $encoded_record->offset = $offset; + $encoded_record->string = $record->string; + $encoded_record->length = mb_strlen($encoded_record->getUTF16(), "8bit"); + $records_to_encode[] = $encoded_record; + + $offset += $encoded_record->length; + $length += $font->pack(nameRecord::$format, (array)$encoded_record); + } + + foreach ($records_to_encode as $record) { + $str = $record->getUTF16(); + $length += $font->write($str, mb_strlen($str, "8bit")); + } + + return $length; + } +} diff --git a/lib/dompdf/lib/php-font-lib/src/FontLib/Table/Type/nameRecord.php b/lib/dompdf/lib/php-font-lib/src/FontLib/Table/Type/nameRecord.php new file mode 100644 index 0000000..fe22ba3 --- /dev/null +++ b/lib/dompdf/lib/php-font-lib/src/FontLib/Table/Type/nameRecord.php @@ -0,0 +1,54 @@ + + * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + */ +namespace FontLib\Table\Type; + +use FontLib\Font; +use FontLib\BinaryStream; + +/** + * Font table name record. + * + * @package php-font-lib + */ +class nameRecord extends BinaryStream { + public $platformID; + public $platformSpecificID; + public $languageID; + public $nameID; + public $length; + public $offset; + public $string; + public $stringRaw; + + public static $format = array( + "platformID" => self::uint16, + "platformSpecificID" => self::uint16, + "languageID" => self::uint16, + "nameID" => self::uint16, + "length" => self::uint16, + "offset" => self::uint16, + ); + + public function map($data) { + foreach ($data as $key => $value) { + $this->$key = $value; + } + } + + public function getUTF8() { + return $this->string; + } + + public function getUTF16() { + return Font::UTF8ToUTF16($this->string); + } + + function __toString() { + return $this->string; + } +} \ No newline at end of file diff --git a/lib/dompdf/lib/php-font-lib/src/FontLib/Table/Type/os2.php b/lib/dompdf/lib/php-font-lib/src/FontLib/Table/Type/os2.php new file mode 100644 index 0000000..276de0d --- /dev/null +++ b/lib/dompdf/lib/php-font-lib/src/FontLib/Table/Type/os2.php @@ -0,0 +1,47 @@ + + * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + */ + +namespace FontLib\Table\Type; +use FontLib\Table\Table; + +/** + * `OS/2` font table. + * + * @package php-font-lib + */ +class os2 extends Table { + protected $def = array( + "version" => self::uint16, + "xAvgCharWidth" => self::int16, + "usWeightClass" => self::uint16, + "usWidthClass" => self::uint16, + "fsType" => self::int16, + "ySubscriptXSize" => self::int16, + "ySubscriptYSize" => self::int16, + "ySubscriptXOffset" => self::int16, + "ySubscriptYOffset" => self::int16, + "ySuperscriptXSize" => self::int16, + "ySuperscriptYSize" => self::int16, + "ySuperscriptXOffset" => self::int16, + "ySuperscriptYOffset" => self::int16, + "yStrikeoutSize" => self::int16, + "yStrikeoutPosition" => self::int16, + "sFamilyClass" => self::int16, + "panose" => array(self::uint8, 10), + "ulCharRange" => array(self::uint32, 4), + "achVendID" => array(self::char, 4), + "fsSelection" => self::uint16, + "fsFirstCharIndex" => self::uint16, + "fsLastCharIndex" => self::uint16, + "typoAscender" => self::int16, + "typoDescender" => self::int16, + "typoLineGap" => self::int16, + "winAscent" => self::int16, + "winDescent" => self::int16, + ); +} \ No newline at end of file diff --git a/lib/dompdf/lib/php-font-lib/src/FontLib/Table/Type/post.php b/lib/dompdf/lib/php-font-lib/src/FontLib/Table/Type/post.php new file mode 100644 index 0000000..1160c0b --- /dev/null +++ b/lib/dompdf/lib/php-font-lib/src/FontLib/Table/Type/post.php @@ -0,0 +1,143 @@ + + * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + */ + +namespace FontLib\Table\Type; +use FontLib\Table\Table; +use FontLib\TrueType\File; + +/** + * `post` font table. + * + * @package php-font-lib + */ +class post extends Table { + protected $def = array( + "format" => self::Fixed, + "italicAngle" => self::Fixed, + "underlinePosition" => self::FWord, + "underlineThickness" => self::FWord, + "isFixedPitch" => self::uint32, + "minMemType42" => self::uint32, + "maxMemType42" => self::uint32, + "minMemType1" => self::uint32, + "maxMemType1" => self::uint32, + ); + + protected function _parse() { + $font = $this->getFont(); + $data = $font->unpack($this->def); + + $names = array(); + + switch ($data["format"]) { + case 1: + $names = File::$macCharNames; + break; + + case 2: + $data["numberOfGlyphs"] = $font->readUInt16(); + + $glyphNameIndex = $font->readUInt16Many($data["numberOfGlyphs"]); + + $data["glyphNameIndex"] = $glyphNameIndex; + + $namesPascal = array(); + for ($i = 0; $i < $data["numberOfGlyphs"]; $i++) { + $len = $font->readUInt8(); + $namesPascal[] = $font->read($len); + } + + foreach ($glyphNameIndex as $g => $index) { + if ($index < 258) { + $names[$g] = File::$macCharNames[$index]; + } + else { + if (array_key_exists($index - 258, $namesPascal)) { + $names[$g] = $namesPascal[$index - 258]; + } + } + } + + break; + + case 2.5: + // TODO + break; + + case 3: + // nothing + break; + + case 4: + // TODO + break; + } + + $data["names"] = $names; + + $this->data = $data; + } + + function _encode() { + $font = $this->getFont(); + $data = $this->data; + $data["format"] = 3; + + $length = $font->pack($this->def, $data); + + return $length; + /* + $subset = $font->getSubset(); + + switch($data["format"]) { + case 1: + // nothing to do + break; + + case 2: + $old_names = $data["names"]; + + $glyphNameIndex = range(0, count($subset)); + + $names = array(); + foreach($subset as $gid) { + $names[] = $data["names"][$data["glyphNameIndex"][$gid]]; + } + + $numberOfGlyphs = count($names); + $length += $font->writeUInt16($numberOfGlyphs); + + foreach($glyphNameIndex as $gni) { + $length += $font->writeUInt16($gni); + } + + //$names = array_slice($names, 257); + foreach($names as $name) { + $len = strlen($name); + $length += $font->writeUInt8($len); + $length += $font->write($name, $len); + } + + break; + + case 2.5: + // TODO + break; + + case 3: + // nothing + break; + + case 4: + // TODO + break; + } + + return $length;*/ + } +} \ No newline at end of file diff --git a/lib/dompdf/lib/php-font-lib/src/FontLib/Table/Type/prep.php b/lib/dompdf/lib/php-font-lib/src/FontLib/Table/Type/prep.php new file mode 100644 index 0000000..c82c17d --- /dev/null +++ b/lib/dompdf/lib/php-font-lib/src/FontLib/Table/Type/prep.php @@ -0,0 +1,30 @@ + + * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + */ + +namespace FontLib\Table\Type; + +use FontLib\Table\Table; + +/** + * `prep` font table. + * + * @package php-font-lib + */ +class prep extends Table +{ + private $rawData; + protected function _parse() { + $font = $this->getFont(); + $font->seek($this->entry->offset); + $this->rawData = $font->read($this->entry->length); + } + function _encode() { + return $this->getFont()->write($this->rawData, $this->entry->length); + } +} diff --git a/lib/dompdf/lib/php-font-lib/src/FontLib/TrueType/Collection.php b/lib/dompdf/lib/php-font-lib/src/FontLib/TrueType/Collection.php new file mode 100644 index 0000000..a6afa4f --- /dev/null +++ b/lib/dompdf/lib/php-font-lib/src/FontLib/TrueType/Collection.php @@ -0,0 +1,100 @@ + + * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + */ + +namespace FontLib\TrueType; + +use Countable; +use FontLib\BinaryStream; +use Iterator; +use OutOfBoundsException; + +/** + * TrueType collection font file. + * + * @package php-font-lib + */ +class Collection extends BinaryStream implements Iterator, Countable { + /** + * Current iterator position. + * + * @var integer + */ + private $position = 0; + + protected $collectionOffsets = array(); + protected $collection = array(); + protected $version; + protected $numFonts; + + function parse() { + if (isset($this->numFonts)) { + return; + } + + $this->read(4); // tag name + + $this->version = $this->readFixed(); + $this->numFonts = $this->readUInt32(); + + for ($i = 0; $i < $this->numFonts; $i++) { + $this->collectionOffsets[] = $this->readUInt32(); + } + } + + /** + * @param int $fontId + * + * @throws OutOfBoundsException + * @return File + */ + function getFont($fontId) { + $this->parse(); + + if (!isset($this->collectionOffsets[$fontId])) { + throw new OutOfBoundsException(); + } + + if (isset($this->collection[$fontId])) { + return $this->collection[$fontId]; + } + + $font = new File(); + $font->f = $this->f; + $font->setTableOffset($this->collectionOffsets[$fontId]); + + return $this->collection[$fontId] = $font; + } + + function current() { + return $this->getFont($this->position); + } + + function key() { + return $this->position; + } + + function next() { + return ++$this->position; + } + + function rewind() { + $this->position = 0; + } + + function valid() { + $this->parse(); + + return isset($this->collectionOffsets[$this->position]); + } + + function count() { + $this->parse(); + + return $this->numFonts; + } +} diff --git a/lib/dompdf/lib/php-font-lib/src/FontLib/TrueType/File.php b/lib/dompdf/lib/php-font-lib/src/FontLib/TrueType/File.php new file mode 100644 index 0000000..b1c7cd8 --- /dev/null +++ b/lib/dompdf/lib/php-font-lib/src/FontLib/TrueType/File.php @@ -0,0 +1,591 @@ + + * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + */ + +namespace FontLib\TrueType; + +use FontLib\AdobeFontMetrics; +use FontLib\Font; +use FontLib\BinaryStream; +use FontLib\Table\Table; +use FontLib\Table\DirectoryEntry; +use FontLib\Table\Type\glyf; +use FontLib\Table\Type\name; +use FontLib\Table\Type\nameRecord; + +/** + * TrueType font file. + * + * @package php-font-lib + */ +class File extends BinaryStream { + /** + * @var Header + */ + public $header = array(); + + private $tableOffset = 0; // Used for TTC + + private static $raw = false; + + protected $directory = array(); + protected $data = array(); + + protected $glyph_subset = array(); + + public $glyph_all = array(); + + static $macCharNames = array( + ".notdef", ".null", "CR", + "space", "exclam", "quotedbl", "numbersign", + "dollar", "percent", "ampersand", "quotesingle", + "parenleft", "parenright", "asterisk", "plus", + "comma", "hyphen", "period", "slash", + "zero", "one", "two", "three", + "four", "five", "six", "seven", + "eight", "nine", "colon", "semicolon", + "less", "equal", "greater", "question", + "at", "A", "B", "C", "D", "E", "F", "G", + "H", "I", "J", "K", "L", "M", "N", "O", + "P", "Q", "R", "S", "T", "U", "V", "W", + "X", "Y", "Z", "bracketleft", + "backslash", "bracketright", "asciicircum", "underscore", + "grave", "a", "b", "c", "d", "e", "f", "g", + "h", "i", "j", "k", "l", "m", "n", "o", + "p", "q", "r", "s", "t", "u", "v", "w", + "x", "y", "z", "braceleft", + "bar", "braceright", "asciitilde", "Adieresis", + "Aring", "Ccedilla", "Eacute", "Ntilde", + "Odieresis", "Udieresis", "aacute", "agrave", + "acircumflex", "adieresis", "atilde", "aring", + "ccedilla", "eacute", "egrave", "ecircumflex", + "edieresis", "iacute", "igrave", "icircumflex", + "idieresis", "ntilde", "oacute", "ograve", + "ocircumflex", "odieresis", "otilde", "uacute", + "ugrave", "ucircumflex", "udieresis", "dagger", + "degree", "cent", "sterling", "section", + "bullet", "paragraph", "germandbls", "registered", + "copyright", "trademark", "acute", "dieresis", + "notequal", "AE", "Oslash", "infinity", + "plusminus", "lessequal", "greaterequal", "yen", + "mu", "partialdiff", "summation", "product", + "pi", "integral", "ordfeminine", "ordmasculine", + "Omega", "ae", "oslash", "questiondown", + "exclamdown", "logicalnot", "radical", "florin", + "approxequal", "increment", "guillemotleft", "guillemotright", + "ellipsis", "nbspace", "Agrave", "Atilde", + "Otilde", "OE", "oe", "endash", + "emdash", "quotedblleft", "quotedblright", "quoteleft", + "quoteright", "divide", "lozenge", "ydieresis", + "Ydieresis", "fraction", "currency", "guilsinglleft", + "guilsinglright", "fi", "fl", "daggerdbl", + "periodcentered", "quotesinglbase", "quotedblbase", "perthousand", + "Acircumflex", "Ecircumflex", "Aacute", "Edieresis", + "Egrave", "Iacute", "Icircumflex", "Idieresis", + "Igrave", "Oacute", "Ocircumflex", "applelogo", + "Ograve", "Uacute", "Ucircumflex", "Ugrave", + "dotlessi", "circumflex", "tilde", "macron", + "breve", "dotaccent", "ring", "cedilla", + "hungarumlaut", "ogonek", "caron", "Lslash", + "lslash", "Scaron", "scaron", "Zcaron", + "zcaron", "brokenbar", "Eth", "eth", + "Yacute", "yacute", "Thorn", "thorn", + "minus", "multiply", "onesuperior", "twosuperior", + "threesuperior", "onehalf", "onequarter", "threequarters", + "franc", "Gbreve", "gbreve", "Idot", + "Scedilla", "scedilla", "Cacute", "cacute", + "Ccaron", "ccaron", "dmacron" + ); + + private function uniord (string $c, string $encoding = null) { + if (function_exists("mb_ord")) { + if (PHP_VERSION_ID < 80000 && $encoding === null) { + // in PHP < 8 the encoding argument, if supplied, must be a valid encoding + $encoding = "UTF-8"; + } + return mb_ord($c, $encoding); + } + + if ($encoding != "UTF-8" && $encoding !== null) { + $c = mb_convert_encoding($c, "UTF-8", $encoding); + } + + $length = mb_strlen(mb_substr($c, 0, 1), '8bit'); + $ord = false; + $bytes = []; + $numbytes = 1; + for ($i = 0; $i < $length; $i++) { + $o = \ord($c[$i]); // get one string character at time + if (\count($bytes) === 0) { // get starting octect + if ($o <= 0x7F) { + $ord = $o; + $numbytes = 1; + } elseif (($o >> 0x05) === 0x06) { // 2 bytes character (0x06 = 110 BIN) + $bytes[] = ($o - 0xC0) << 0x06; + $numbytes = 2; + } elseif (($o >> 0x04) === 0x0E) { // 3 bytes character (0x0E = 1110 BIN) + $bytes[] = ($o - 0xE0) << 0x0C; + $numbytes = 3; + } elseif (($o >> 0x03) === 0x1E) { // 4 bytes character (0x1E = 11110 BIN) + $bytes[] = ($o - 0xF0) << 0x12; + $numbytes = 4; + } else { + $ord = false; + break; + } + } elseif (($o >> 0x06) === 0x02) { // bytes 2, 3 and 4 must start with 0x02 = 10 BIN + $bytes[] = $o - 0x80; + if (\count($bytes) === $numbytes) { + // compose UTF-8 bytes to a single unicode value + $o = $bytes[0]; + for ($j = 1; $j < $numbytes; $j++) { + $o += ($bytes[$j] << (($numbytes - $j - 1) * 0x06)); + } + if ((($o >= 0xD800) and ($o <= 0xDFFF)) or ($o >= 0x10FFFF)) { + // The definition of UTF-8 prohibits encoding character numbers between + // U+D800 and U+DFFF, which are reserved for use with the UTF-16 + // encoding form (as surrogate pairs) and do not directly represent + // characters. + return false; + } else { + $ord = $o; // add char to array + } + // reset data for next char + $bytes = []; + $numbytes = 1; + } + } else { + $ord = false; + break; + } + } + + return $ord; + } + + function getTable() { + $this->parseTableEntries(); + + return $this->directory; + } + + function setTableOffset($offset) { + $this->tableOffset = $offset; + } + + function parse() { + $this->parseTableEntries(); + + $this->data = array(); + + foreach ($this->directory as $tag => $table) { + if (empty($this->data[$tag])) { + $this->readTable($tag); + } + } + } + + function utf8toUnicode($str) { + $len = mb_strlen($str, '8bit'); + $out = array(); + + for ($i = 0; $i < $len; $i++) { + $uni = -1; + $h = ord($str[$i]); + + if ($h <= 0x7F) { + $uni = $h; + } + elseif ($h >= 0xC2) { + if (($h <= 0xDF) && ($i < $len - 1)) { + $uni = ($h & 0x1F) << 6 | (ord($str[++$i]) & 0x3F); + } + elseif (($h <= 0xEF) && ($i < $len - 2)) { + $uni = ($h & 0x0F) << 12 | (ord($str[++$i]) & 0x3F) << 6 | (ord($str[++$i]) & 0x3F); + } + elseif (($h <= 0xF4) && ($i < $len - 3)) { + $uni = ($h & 0x0F) << 18 | (ord($str[++$i]) & 0x3F) << 12 | (ord($str[++$i]) & 0x3F) << 6 | (ord($str[++$i]) & 0x3F); + } + } + + if ($uni >= 0) { + $out[] = $uni; + } + } + + return $out; + } + + function getUnicodeCharMap() { + $subtable = null; + foreach ($this->getData("cmap", "subtables") as $_subtable) { + if ($_subtable["platformID"] == 0 || ($_subtable["platformID"] == 3 && $_subtable["platformSpecificID"] == 1)) { + $subtable = $_subtable; + break; + } + } + + if ($subtable) { + return $subtable["glyphIndexArray"]; + } + + $system_encodings = mb_list_encodings(); + $system_encodings = array_change_key_case(array_fill_keys($system_encodings, true), CASE_UPPER); + foreach ($this->getData("cmap", "subtables") as $_subtable) { + $encoding = null; + switch ($_subtable["platformID"]) { + case 3: + switch ($_subtable["platformSpecificID"]) { + case 2: + if (\array_key_exists("SJIS", $system_encodings)) { + $encoding = "SJIS"; + } + break; + case 3: + if (\array_key_exists("GB18030", $system_encodings)) { + $encoding = "GB18030"; + } + break; + case 4: + if (\array_key_exists("BIG-5", $system_encodings)) { + $encoding = "BIG-5"; + } + break; + case 5: + if (\array_key_exists("UHC", $system_encodings)) { + $encoding = "UHC"; + } + break; + } + break; + } + if ($encoding) { + $glyphIndexArray = array(); + foreach ($_subtable["glyphIndexArray"] as $c => $gid) { + $str = trim(pack("N", $c)); + if (\strlen($str) > 0) { + $ord = $this->uniord($str, $encoding); + if ($ord > 0) { + $glyphIndexArray[$ord] = $gid; + } + } + } + return $glyphIndexArray; + } + } + + return null; + } + + function setSubset($subset) { + if (!is_array($subset)) { + $subset = $this->utf8toUnicode($subset); + } + + $subset = array_unique($subset); + + $glyphIndexArray = $this->getUnicodeCharMap(); + + if (!$glyphIndexArray) { + return; + } + + $gids = array( + 0, // .notdef + 1, // .null + ); + + foreach ($subset as $code) { + if (!isset($glyphIndexArray[$code])) { + continue; + } + + $gid = $glyphIndexArray[$code]; + $gids[$gid] = $gid; + } + + /** @var glyf $glyf */ + $glyf = $this->getTableObject("glyf"); + if ($glyf) { + $gids = $glyf->getGlyphIDs($gids); + sort($gids); + $this->glyph_subset = $gids; + } + $this->glyph_all = array_values($glyphIndexArray); // FIXME + } + + function getSubset() { + if (empty($this->glyph_subset)) { + return $this->glyph_all; + } + + return $this->glyph_subset; + } + + function encode($tags = array()) { + if (!self::$raw) { + $tags = array_merge(array("head", "hhea", "cmap", "hmtx", "maxp", "glyf", "loca", "name", "post", "cvt ", "fpgm", "prep"), $tags); + } + else { + $tags = array_keys($this->directory); + } + + $n = 16; // @todo + + Font::d("Tables : " . implode(", ", $tags)); + + /** @var DirectoryEntry[] $entries */ + $entries = array(); + foreach ($tags as $tag) { + if (!isset($this->directory[$tag])) { + Font::d(" >> '$tag' table doesn't exist"); + continue; + } + + $entries[$tag] = $this->directory[$tag]; + } + + $num_tables = count($entries); + $exponent = floor(log($num_tables, 2)); + $power_of_two = pow(2, $exponent); + + $this->header->data["numTables"] = $num_tables; + $this->header->data["searchRange"] = $power_of_two * 16; + $this->header->data["entrySelector"] = log($power_of_two, 2); + $this->header->data["rangeShift"] = $num_tables * 16 - $this->header->data["searchRange"]; + $this->header->encode(); + + $directory_offset = $this->pos(); + $offset = $directory_offset + $num_tables * $n; + $this->seek($offset); + + $i = 0; + foreach ($entries as $entry) { + $entry->encode($directory_offset + $i * $n); + $i++; + } + } + + function parseHeader() { + if (!empty($this->header)) { + return; + } + + $this->seek($this->tableOffset); + + $this->header = new Header($this); + $this->header->parse(); + } + + function getFontType(){ + $class_parts = explode("\\", get_class($this)); + return $class_parts[1]; + } + + function parseTableEntries() { + $this->parseHeader(); + + if (!empty($this->directory)) { + return; + } + + if (empty($this->header->data["numTables"])) { + return; + } + + + $type = $this->getFontType(); + $class = "FontLib\\$type\\TableDirectoryEntry"; + + for ($i = 0; $i < $this->header->data["numTables"]; $i++) { + /** @var TableDirectoryEntry $entry */ + $entry = new $class($this); + $entry->parse(); + + $this->directory[$entry->tag] = $entry; + } + } + + function normalizeFUnit($value, $base = 1000) { + return round($value * ($base / $this->getData("head", "unitsPerEm"))); + } + + protected function readTable($tag) { + $this->parseTableEntries(); + + if (!self::$raw) { + $name_canon = preg_replace("/[^a-z0-9]/", "", strtolower($tag)); + + $class = "FontLib\\Table\\Type\\$name_canon"; + + if (!isset($this->directory[$tag]) || !@class_exists($class)) { + return; + } + } + else { + $class = "FontLib\\Table\\Table"; + } + + /** @var Table $table */ + $table = new $class($this->directory[$tag]); + $table->parse(); + + $this->data[$tag] = $table; + } + + /** + * @param $name + * + * @return Table + */ + public function getTableObject($name) { + if (\array_key_exists($name, $this->data)) { + return $this->data[$name]; + } + return null; + } + + public function setTableObject($name, Table $data) { + $this->data[$name] = $data; + } + + public function getData($name, $key = null) { + $this->parseTableEntries(); + + if (empty($this->data[$name])) { + $this->readTable($name); + } + + if (!isset($this->data[$name])) { + return null; + } + + if (!$key) { + return $this->data[$name]->data; + } + else { + return $this->data[$name]->data[$key]; + } + } + + function addDirectoryEntry(DirectoryEntry $entry) { + $this->directory[$entry->tag] = $entry; + } + + function saveAdobeFontMetrics($file, $encoding = null) { + $afm = new AdobeFontMetrics($this); + $afm->write($file, $encoding); + } + + /** + * Get a specific name table string value from its ID + * + * @param int $nameID The name ID + * + * @return string|null + */ + function getNameTableString($nameID) { + /** @var nameRecord[] $records */ + $records = $this->getData("name", "records"); + + if (!isset($records[$nameID])) { + return null; + } + + return $records[$nameID]->string; + } + + /** + * Get font copyright + * + * @return string|null + */ + function getFontCopyright() { + return $this->getNameTableString(name::NAME_COPYRIGHT); + } + + /** + * Get font name + * + * @return string|null + */ + function getFontName() { + return $this->getNameTableString(name::NAME_NAME); + } + + /** + * Get font subfamily + * + * @return string|null + */ + function getFontSubfamily() { + return $this->getNameTableString(name::NAME_SUBFAMILY); + } + + /** + * Get font subfamily ID + * + * @return string|null + */ + function getFontSubfamilyID() { + return $this->getNameTableString(name::NAME_SUBFAMILY_ID); + } + + /** + * Get font full name + * + * @return string|null + */ + function getFontFullName() { + return $this->getNameTableString(name::NAME_FULL_NAME); + } + + /** + * Get font version + * + * @return string|null + */ + function getFontVersion() { + return $this->getNameTableString(name::NAME_VERSION); + } + + /** + * Get font weight + * + * @return string|null + */ + function getFontWeight() { + return $this->getTableObject("OS/2")->data["usWeightClass"]; + } + + /** + * Get font Postscript name + * + * @return string|null + */ + function getFontPostscriptName() { + return $this->getNameTableString(name::NAME_POSTSCRIPT_NAME); + } + + function reduce() { + $names_to_keep = array( + name::NAME_COPYRIGHT, + name::NAME_NAME, + name::NAME_SUBFAMILY, + name::NAME_SUBFAMILY_ID, + name::NAME_FULL_NAME, + name::NAME_VERSION, + name::NAME_POSTSCRIPT_NAME, + ); + + foreach ($this->data["name"]->data["records"] as $id => $rec) { + if (!in_array($id, $names_to_keep)) { + unset($this->data["name"]->data["records"][$id]); + } + } + } +} diff --git a/lib/dompdf/lib/php-font-lib/src/FontLib/TrueType/Header.php b/lib/dompdf/lib/php-font-lib/src/FontLib/TrueType/Header.php new file mode 100644 index 0000000..652e66f --- /dev/null +++ b/lib/dompdf/lib/php-font-lib/src/FontLib/TrueType/Header.php @@ -0,0 +1,31 @@ + + * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + */ + +namespace FontLib\TrueType; + +/** + * TrueType font file header. + * + * @package php-font-lib + */ +class Header extends \FontLib\Header { + protected $def = array( + "format" => self::uint32, + "numTables" => self::uint16, + "searchRange" => self::uint16, + "entrySelector" => self::uint16, + "rangeShift" => self::uint16, + ); + + public function parse() { + parent::parse(); + + $format = $this->data["format"]; + $this->data["formatText"] = $this->convertUInt32ToStr($format); + } +} \ No newline at end of file diff --git a/lib/dompdf/lib/php-font-lib/src/FontLib/TrueType/TableDirectoryEntry.php b/lib/dompdf/lib/php-font-lib/src/FontLib/TrueType/TableDirectoryEntry.php new file mode 100644 index 0000000..9cf4489 --- /dev/null +++ b/lib/dompdf/lib/php-font-lib/src/FontLib/TrueType/TableDirectoryEntry.php @@ -0,0 +1,33 @@ + + * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + */ + +namespace FontLib\TrueType; + +use FontLib\Table\DirectoryEntry; + +/** + * TrueType table directory entry. + * + * @package php-font-lib + */ +class TableDirectoryEntry extends DirectoryEntry { + function __construct(File $font) { + parent::__construct($font); + } + + function parse() { + parent::parse(); + + $font = $this->font; + $this->checksum = $font->readUInt32(); + $this->offset = $font->readUInt32(); + $this->length = $font->readUInt32(); + $this->entryLength += 12; + } +} + diff --git a/lib/dompdf/lib/php-font-lib/src/FontLib/WOFF/File.php b/lib/dompdf/lib/php-font-lib/src/FontLib/WOFF/File.php new file mode 100644 index 0000000..2c6dff4 --- /dev/null +++ b/lib/dompdf/lib/php-font-lib/src/FontLib/WOFF/File.php @@ -0,0 +1,81 @@ + + * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + */ + +namespace FontLib\WOFF; + +use FontLib\Table\DirectoryEntry; + +/** + * WOFF font file. + * + * @package php-font-lib + * + * @property TableDirectoryEntry[] $directory + */ +class File extends \FontLib\TrueType\File { + function parseHeader() { + if (!empty($this->header)) { + return; + } + + $this->header = new Header($this); + $this->header->parse(); + } + + public function load($file) { + parent::load($file); + + $this->parseTableEntries(); + $dataOffset = $this->pos() + count($this->directory) * 20; + + $fw = $this->getTempFile(false); + $fr = $this->f; + + $this->f = $fw; + $offset = $this->header->encode(); + + foreach ($this->directory as $entry) { + // Read ... + $this->f = $fr; + $this->seek($entry->offset); + $data = $this->read($entry->length); + + if ($entry->length < $entry->origLength) { + $data = (string) gzuncompress($data); + } + + // Prepare data ... + $length = mb_strlen($data, '8bit'); + $entry->length = $entry->origLength = $length; + $entry->offset = $dataOffset; + + // Write ... + $this->f = $fw; + + // Woff Entry + $this->seek($offset); + $offset += $this->write($entry->tag, 4); // tag + $offset += $this->writeUInt32($dataOffset); // offset + $offset += $this->writeUInt32($length); // length + $offset += $this->writeUInt32($length); // origLength + $offset += $this->writeUInt32(DirectoryEntry::computeChecksum($data)); // checksum + + // Data + $this->seek($dataOffset); + $dataOffset += $this->write($data, $length); + } + + $this->f = $fw; + $this->seek(0); + + // Need to re-parse this, don't know why + $this->header = null; + $this->directory = array(); + $this->parseTableEntries(); + } +} diff --git a/lib/dompdf/lib/php-font-lib/src/FontLib/WOFF/Header.php b/lib/dompdf/lib/php-font-lib/src/FontLib/WOFF/Header.php new file mode 100644 index 0000000..9911c97 --- /dev/null +++ b/lib/dompdf/lib/php-font-lib/src/FontLib/WOFF/Header.php @@ -0,0 +1,32 @@ + + * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + */ + +namespace FontLib\WOFF; + +/** + * WOFF font file header. + * + * @package php-font-lib + */ +class Header extends \FontLib\TrueType\Header { + protected $def = array( + "format" => self::uint32, + "flavor" => self::uint32, + "length" => self::uint32, + "numTables" => self::uint16, + self::uint16, + "totalSfntSize" => self::uint32, + "majorVersion" => self::uint16, + "minorVersion" => self::uint16, + "metaOffset" => self::uint32, + "metaLength" => self::uint32, + "metaOrigLength" => self::uint32, + "privOffset" => self::uint32, + "privLength" => self::uint32, + ); +} \ No newline at end of file diff --git a/lib/dompdf/lib/php-font-lib/src/FontLib/WOFF/TableDirectoryEntry.php b/lib/dompdf/lib/php-font-lib/src/FontLib/WOFF/TableDirectoryEntry.php new file mode 100644 index 0000000..5f66311 --- /dev/null +++ b/lib/dompdf/lib/php-font-lib/src/FontLib/WOFF/TableDirectoryEntry.php @@ -0,0 +1,34 @@ + + * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + */ + +namespace FontLib\WOFF; + +use FontLib\Table\DirectoryEntry; + +/** + * WOFF font file table directory entry. + * + * @package php-font-lib + */ +class TableDirectoryEntry extends DirectoryEntry { + public $origLength; + + function __construct(File $font) { + parent::__construct($font); + } + + function parse() { + parent::parse(); + + $font = $this->font; + $this->offset = $font->readUInt32(); + $this->length = $font->readUInt32(); + $this->origLength = $font->readUInt32(); + $this->checksum = $font->readUInt32(); + } +} diff --git a/lib/dompdf/lib/php-font-lib/tests/FontLib/FontTest.php b/lib/dompdf/lib/php-font-lib/tests/FontLib/FontTest.php new file mode 100644 index 0000000..568c200 --- /dev/null +++ b/lib/dompdf/lib/php-font-lib/tests/FontLib/FontTest.php @@ -0,0 +1,69 @@ +expectException('\Fontlib\Exception\FontNotFoundException'); + try { + Font::load('non-existing/font.ttf'); + $this->fail('Load should have failed.'); + } + catch (\Fontlib\Exception\FontNotFoundException $e) { + // Avoid throwing a risky test error. + $this->assertTrue(true); + } + } + + public function testLoadTTFFont() + { + $trueTypeFont = Font::load('tests/resources/fonts/ahem/ahem.ttf'); + + $this->assertInstanceOf('FontLib\TrueType\File', $trueTypeFont); + } + + public function testGetFontInfoTTF() + { + $font = Font::load('tests/resources/fonts/ahem/ahem.ttf'); + $font->parse(); + $this->assertSame('Ahem', $font->getFontName()); + $this->assertSame('Regular', $font->getFontSubfamily()); + $this->assertSame('Version 1.50 Ahem', $font->getFontSubfamilyID()); + $this->assertSame('Ahem', $font->getFontFullName()); + $this->assertSame('Version 1.50', $font->getFontVersion()); + $this->assertSame(400, $font->getFontWeight()); + $this->assertSame('Ahem', $font->getFontPostscriptName()); + $this->assertTrue($font->close()); + } + + public function testTTFCmap() + { + $trueTypeFont = Font::load('tests/resources/fonts/noto/NotoSansShavian-Regular.ttf'); + + $trueTypeFont->parse(); + + $cmapTable = $trueTypeFont->getData("cmap", "subtables"); + + $cmapFormat4Table = $cmapTable[0]; + + $this->assertEquals(4, $cmapFormat4Table['format']); + $this->assertEquals(51, $cmapFormat4Table['segCount']); + $this->assertEquals($cmapFormat4Table['segCount'], count($cmapFormat4Table['startCode'])); + $this->assertEquals($cmapFormat4Table['segCount'], count($cmapFormat4Table['endCode'])); + + $cmapFormat12Table = $cmapTable[1]; + + $this->assertEquals(12, $cmapFormat12Table['format']); + $this->assertEquals(294, $cmapFormat12Table['ngroups']); + $this->assertEquals(294, count($cmapFormat12Table['startCode'])); + $this->assertEquals(294, count($cmapFormat12Table['endCode'])); + $this->assertEquals(383, count($cmapFormat12Table['glyphIndexArray'])); + } +} diff --git a/lib/dompdf/lib/php-font-lib/tests/resources/fonts/ahem/LICENSE b/lib/dompdf/lib/php-font-lib/tests/resources/fonts/ahem/LICENSE new file mode 100644 index 0000000..6a08441 --- /dev/null +++ b/lib/dompdf/lib/php-font-lib/tests/resources/fonts/ahem/LICENSE @@ -0,0 +1,4 @@ +The Ahem font belongs to the public domain. In jurisdictions that do +not recognize public domain ownership of these files, the following +Creative Commons Zero declaration applies: + http://labs.creativecommons.org/licenses/zero-waive/1.0/us/legalcode \ No newline at end of file diff --git a/lib/dompdf/lib/php-font-lib/tests/resources/fonts/ahem/README.md b/lib/dompdf/lib/php-font-lib/tests/resources/fonts/ahem/README.md new file mode 100644 index 0000000..a61db91 --- /dev/null +++ b/lib/dompdf/lib/php-font-lib/tests/resources/fonts/ahem/README.md @@ -0,0 +1,93 @@ +The Ahem font was developed by Todd Fahrner and Myles C. Maxfield to +help test writers develop predictable tests. The units per em is 1000, +the ascent is 800, and the descent is 200, thereby making the em +square exactly square. The glyphs for most characters is simply a box +which fills this square. The codepoints mapped to this full square +with a full advance are the following ranges: + +U+20-U+26 +U+28-U+6F +U+71-U+7E +U+A0-U+C8 +U+CA-U+FF +U+131 +U+152-U+153 +U+178 +U+192 +U+2C6-U+2C7 +U+2C9 +U+2D8-U+2DD +U+394 +U+3A5 +U+3A7 +U+3A9 +U+3BC +U+3C0 +U+2013-U+2014 +U+2018-U+201A +U+201C-U+201E +U+2020-U+2022 +U+2026 +U+2030 +U+2039-U+203A +U+2044 +U+2122 +U+2126 +U+2202 +U+2206 +U+220F +U+2211-U+2212 +U+2219-U+221A +U+221E +U+222B +U+2248 +U+2260 +U+2264-U+2265 +U+22F2 +U+25CA +U+3007 +U+4E00 +U+4E03 +U+4E09 +U+4E5D +U+4E8C +U+4E94 +U+516B +U+516D +U+5341 +U+56D7 +U+56DB +U+571F +U+6728 +U+6C34 +U+706B +U+91D1 +U+F000-U+F002 + +The codepoints which are mapped to something else are the following: + +" " (U+20): No path but full advance +"p" (U+70): Path has 0 ascent but full descent +"É" (U+C9): Path has 0 descent but full ascent +Non-breaking space (U+A0): No path but full advance +Zero-width non-breaking space (U+FEFF): No path and 0 advance +En space (U+2002): No path and half advance +Em space (U+2003): No path but full advance +Three-per-em space (U+2004): No path and one third advance +Four-per-em space (U+2005): No path and one quarter advance +Six-per-em space (U+2006): No path and one sixth advance +Thin space (U+2009): No path and one fifth advance +Hair space (U+200A): No path and one tenth advance +Zero width space (U+200B): No path and no advance +Ideographic space (U+3000): No path but full advance +Zero width non-joiner (U+200C): No path and no advance +Zero width joiner (U+200D): No path and no advance +Greek capital letter Upsilon (U+3A5): Thin vertical stripe and full advance +Greek capital letter Chi (U+3A7): Thin horizontal stripe and full advance +"横" (U+6A2A): Thin horizontal stripe and full advance +"橫" (U+6A6B): Thin horizontal stripe and full advance; +"縦" (U+7E26): Thin vertical stripe and full advance; +"縱" (U+7E31): Thin vertical stripe and full advance; +"纵" (U+7EB5): Thin vertical stripe and full advance. + +Source: https://www.w3.org/Style/CSS/Test/Fonts/Ahem/ \ No newline at end of file diff --git a/lib/dompdf/lib/php-font-lib/tests/resources/fonts/ahem/ahem.ttf b/lib/dompdf/lib/php-font-lib/tests/resources/fonts/ahem/ahem.ttf new file mode 100644 index 0000000..306f065 Binary files /dev/null and b/lib/dompdf/lib/php-font-lib/tests/resources/fonts/ahem/ahem.ttf differ diff --git a/lib/dompdf/lib/php-font-lib/tests/resources/fonts/noto/LICENSE b/lib/dompdf/lib/php-font-lib/tests/resources/fonts/noto/LICENSE new file mode 100644 index 0000000..5277482 --- /dev/null +++ b/lib/dompdf/lib/php-font-lib/tests/resources/fonts/noto/LICENSE @@ -0,0 +1,93 @@ +Copyright 2022 The Noto Project Authors + +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +https://scripts.sil.org/OFL + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. \ No newline at end of file diff --git a/lib/dompdf/lib/php-font-lib/tests/resources/fonts/noto/NotoSansShavian-Regular.ttf b/lib/dompdf/lib/php-font-lib/tests/resources/fonts/noto/NotoSansShavian-Regular.ttf new file mode 100644 index 0000000..83507d6 Binary files /dev/null and b/lib/dompdf/lib/php-font-lib/tests/resources/fonts/noto/NotoSansShavian-Regular.ttf differ diff --git a/lib/dompdf/lib/php-font-lib/tests/resources/fonts/noto/README.md b/lib/dompdf/lib/php-font-lib/tests/resources/fonts/noto/README.md new file mode 100644 index 0000000..b8a7f24 --- /dev/null +++ b/lib/dompdf/lib/php-font-lib/tests/resources/fonts/noto/README.md @@ -0,0 +1,22 @@ +Noto Sans Shavian is an unmodulated (“sans serif”) design for texts in the +historical artificial _Shavian_ script. + +Noto Sans Shavian contains 53 glyphs, and supports 52 characters from the +Unicode block Shavian. + +### Supported writing systems +#### Shavian + +Shavian (𐑖𐑱𐑝𐑾𐑯 𐑨𐑤𐑓𐑩𐑚𐑧𐑑) is an artificial alphabet, written left-to-right. +Created around 1960 by Ronald Kingsley Read for phonetic spelling of +English. The winning entry in a competition posthumously funded by +playwright Bernard Shaw. Also adopted for Esperanto. + +Needs software support for complex text layout (shaping). Read more on +[ScriptSource](https://scriptsource.org/scr/Shaw), +[Unicode](https://www.unicode.org/versions/Unicode13.0.0/ch08.pdf#G27260), +[Wikipedia](https://en.wikipedia.org/wiki/ISO_15924:Shaw), +[Wiktionary](https://en.wiktionary.org/wiki/Category:Shavian_script), +[r12a](https://r12a.github.io/scripts/links?iso=Shaw). + +Source: https://github.com/google/fonts/tree/main/ofl/notosansshavian \ No newline at end of file diff --git a/lib/dompdf/lib/php-svg-lib/src/Svg/DefaultStyle.php b/lib/dompdf/lib/php-svg-lib/src/Svg/DefaultStyle.php new file mode 100644 index 0000000..c0535c7 --- /dev/null +++ b/lib/dompdf/lib/php-svg-lib/src/Svg/DefaultStyle.php @@ -0,0 +1,29 @@ + + * @license GNU LGPLv3+ http://www.gnu.org/copyleft/lesser.html + */ + +namespace Svg; + +class DefaultStyle extends Style +{ + public $color = ''; + public $opacity = 1.0; + public $display = 'inline'; + + public $fill = 'black'; + public $fillOpacity = 1.0; + public $fillRule = 'nonzero'; + + public $stroke = 'none'; + public $strokeOpacity = 1.0; + public $strokeLinecap = 'butt'; + public $strokeLinejoin = 'miter'; + public $strokeMiterlimit = 4; + public $strokeWidth = 1.0; + public $strokeDasharray = 0; + public $strokeDashoffset = 0; +} \ No newline at end of file diff --git a/lib/dompdf/lib/php-svg-lib/src/Svg/Document.php b/lib/dompdf/lib/php-svg-lib/src/Svg/Document.php new file mode 100644 index 0000000..4ecdc76 --- /dev/null +++ b/lib/dompdf/lib/php-svg-lib/src/Svg/Document.php @@ -0,0 +1,404 @@ + + * @license GNU LGPLv3+ http://www.gnu.org/copyleft/lesser.html + */ + +namespace Svg; + +use Svg\Surface\SurfaceInterface; +use Svg\Tag\AbstractTag; +use Svg\Tag\Anchor; +use Svg\Tag\Circle; +use Svg\Tag\Ellipse; +use Svg\Tag\Group; +use Svg\Tag\ClipPath; +use Svg\Tag\Image; +use Svg\Tag\Line; +use Svg\Tag\LinearGradient; +use Svg\Tag\Path; +use Svg\Tag\Polygon; +use Svg\Tag\Polyline; +use Svg\Tag\Rect; +use Svg\Tag\Stop; +use Svg\Tag\Text; +use Svg\Tag\StyleTag; +use Svg\Tag\UseTag; + +class Document extends AbstractTag +{ + protected $filename; + public $inDefs = false; + + protected $x; + protected $y; + protected $width; + protected $height; + + protected $subPathInit; + protected $pathBBox; + protected $viewBox; + + /** @var resource */ + protected $parser; + + /** @var SurfaceInterface */ + protected $surface; + + /** @var AbstractTag[] */ + protected $stack = array(); + + /** @var AbstractTag[] */ + protected $defs = array(); + + /** @var \Sabberworm\CSS\CSSList\Document[] */ + protected $styleSheets = array(); + + public function loadFile($filename) + { + $this->filename = $filename; + } + + protected function initParser() { + $parser = xml_parser_create("utf-8"); + xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, false); + xml_set_element_handler( + $parser, + array($this, "_tagStart"), + array($this, "_tagEnd") + ); + xml_set_character_data_handler( + $parser, + array($this, "_charData") + ); + + return $this->parser = $parser; + } + + public function __construct() { + + } + + /** + * @return SurfaceInterface + */ + public function getSurface() + { + return $this->surface; + } + + public function getStack() + { + return $this->stack; + } + + public function getWidth() + { + return $this->width; + } + + public function getHeight() + { + return $this->height; + } + + public function getDimensions() { + $rootAttributes = null; + + $parser = xml_parser_create("utf-8"); + xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, false); + xml_set_element_handler( + $parser, + function ($parser, $name, $attributes) use (&$rootAttributes) { + if ($name === "svg" && $rootAttributes === null) { + $attributes = array_change_key_case($attributes, CASE_LOWER); + + $rootAttributes = $attributes; + } + }, + function ($parser, $name) {} + ); + + $fp = fopen($this->filename, "r"); + while ($line = fread($fp, 8192)) { + xml_parse($parser, $line, false); + + if ($rootAttributes !== null) { + break; + } + } + + xml_parser_free($parser); + + return $this->handleSizeAttributes($rootAttributes); + } + + public function handleSizeAttributes($attributes){ + if ($this->width === null) { + if (isset($attributes["width"])) { + $width = Style::convertSize($attributes["width"], 400); + $this->width = $width; + } + + if (isset($attributes["height"])) { + $height = Style::convertSize($attributes["height"], 300); + $this->height = $height; + } + + if (isset($attributes['viewbox'])) { + $viewBox = preg_split('/[\s,]+/is', trim($attributes['viewbox'])); + if (count($viewBox) == 4) { + $this->x = $viewBox[0]; + $this->y = $viewBox[1]; + + if (!$this->width) { + $this->width = $viewBox[2]; + } + if (!$this->height) { + $this->height = $viewBox[3]; + } + } + } + } + + return array( + 0 => $this->width, + 1 => $this->height, + + "width" => $this->width, + "height" => $this->height, + ); + } + + public function getDocument(){ + return $this; + } + + /** + * Append a style sheet + * + * @param \Sabberworm\CSS\CSSList\Document $stylesheet + */ + public function appendStyleSheet($stylesheet) { + $this->styleSheets[] = $stylesheet; + } + + /** + * Get the document style sheets + * + * @return \Sabberworm\CSS\CSSList\Document[] + */ + public function getStyleSheets() { + return $this->styleSheets; + } + + protected function before($attributes) + { + $surface = $this->getSurface(); + + $style = new DefaultStyle(); + $style->inherit($this); + $style->fromAttributes($attributes); + + $this->setStyle($style); + + $surface->setStyle($style); + } + + public function render(SurfaceInterface $surface) + { + $this->inDefs = false; + $this->surface = $surface; + + $parser = $this->initParser(); + + if ($this->x || $this->y) { + $surface->translate(-$this->x, -$this->y); + } + + $fp = fopen($this->filename, "r"); + while ($line = fread($fp, 8192)) { + xml_parse($parser, $line, false); + } + + xml_parse($parser, "", true); + + xml_parser_free($parser); + } + + protected function svgOffset($attributes) + { + $this->attributes = $attributes; + + $this->handleSizeAttributes($attributes); + } + + public function getDef($id) { + $id = ltrim($id, "#"); + + return isset($this->defs[$id]) ? $this->defs[$id] : null; + } + + private function _tagStart($parser, $name, $attributes) + { + $this->x = 0; + $this->y = 0; + + $tag = null; + + $attributes = array_change_key_case($attributes, CASE_LOWER); + + switch (strtolower($name)) { + case 'defs': + $this->inDefs = true; + return; + + case 'svg': + if (count($this->attributes)) { + $tag = new Group($this, $name); + } + else { + $tag = $this; + $this->svgOffset($attributes); + } + break; + + case 'path': + $tag = new Path($this, $name); + break; + + case 'rect': + $tag = new Rect($this, $name); + break; + + case 'circle': + $tag = new Circle($this, $name); + break; + + case 'ellipse': + $tag = new Ellipse($this, $name); + break; + + case 'image': + $tag = new Image($this, $name); + break; + + case 'line': + $tag = new Line($this, $name); + break; + + case 'polyline': + $tag = new Polyline($this, $name); + break; + + case 'polygon': + $tag = new Polygon($this, $name); + break; + + case 'lineargradient': + $tag = new LinearGradient($this, $name); + break; + + case 'radialgradient': + $tag = new LinearGradient($this, $name); + break; + + case 'stop': + $tag = new Stop($this, $name); + break; + + case 'style': + $tag = new StyleTag($this, $name); + break; + + case 'a': + $tag = new Anchor($this, $name); + break; + + case 'g': + case 'symbol': + $tag = new Group($this, $name); + break; + + case 'clippath': + $tag = new ClipPath($this, $name); + break; + + case 'use': + $tag = new UseTag($this, $name); + break; + + case 'text': + $tag = new Text($this, $name); + break; + + case 'desc': + return; + } + + if ($tag) { + if (isset($attributes["id"])) { + $this->defs[$attributes["id"]] = $tag; + } + else { + /** @var AbstractTag $top */ + $top = end($this->stack); + if ($top && $top != $tag) { + $top->children[] = $tag; + } + } + + $this->stack[] = $tag; + + $tag->handle($attributes); + } + } + + function _charData($parser, $data) + { + $stack_top = end($this->stack); + + if ($stack_top instanceof Text || $stack_top instanceof StyleTag) { + $stack_top->appendText($data); + } + } + + function _tagEnd($parser, $name) + { + /** @var AbstractTag $tag */ + $tag = null; + switch (strtolower($name)) { + case 'defs': + $this->inDefs = false; + return; + + case 'svg': + case 'path': + case 'rect': + case 'circle': + case 'ellipse': + case 'image': + case 'line': + case 'polyline': + case 'polygon': + case 'radialgradient': + case 'lineargradient': + case 'stop': + case 'style': + case 'text': + case 'g': + case 'symbol': + case 'clippath': + case 'use': + case 'a': + $tag = array_pop($this->stack); + break; + } + + if (!$this->inDefs && $tag) { + $tag->handleEnd(); + } + } +} diff --git a/lib/dompdf/lib/php-svg-lib/src/Svg/Gradient/Stop.php b/lib/dompdf/lib/php-svg-lib/src/Svg/Gradient/Stop.php new file mode 100644 index 0000000..14a36bd --- /dev/null +++ b/lib/dompdf/lib/php-svg-lib/src/Svg/Gradient/Stop.php @@ -0,0 +1,16 @@ + + * @license GNU LGPLv3+ http://www.gnu.org/copyleft/lesser.html + */ + +namespace Svg\Gradient; + +class Stop +{ + public $offset; + public $color; + public $opacity = 1.0; +} \ No newline at end of file diff --git a/lib/dompdf/lib/php-svg-lib/src/Svg/Style.php b/lib/dompdf/lib/php-svg-lib/src/Svg/Style.php new file mode 100644 index 0000000..9e7f6db --- /dev/null +++ b/lib/dompdf/lib/php-svg-lib/src/Svg/Style.php @@ -0,0 +1,550 @@ + + * @license GNU LGPLv3+ http://www.gnu.org/copyleft/lesser.html + */ + +namespace Svg; + +use Svg\Tag\AbstractTag; + +class Style +{ + const TYPE_COLOR = 1; + const TYPE_LENGTH = 2; + const TYPE_NAME = 3; + const TYPE_ANGLE = 4; + const TYPE_NUMBER = 5; + + public $color; + public $opacity; + public $display; + + public $fill; + public $fillOpacity; + public $fillRule; + + public $stroke; + public $strokeOpacity; + public $strokeLinecap; + public $strokeLinejoin; + public $strokeMiterlimit; + public $strokeWidth; + public $strokeDasharray; + public $strokeDashoffset; + + public $fontFamily = 'serif'; + public $fontSize = 12; + public $fontWeight = 'normal'; + public $fontStyle = 'normal'; + public $textAnchor = 'start'; + + protected function getStyleMap() + { + return array( + 'color' => array('color', self::TYPE_COLOR), + 'opacity' => array('opacity', self::TYPE_NUMBER), + 'display' => array('display', self::TYPE_NAME), + + 'fill' => array('fill', self::TYPE_COLOR), + 'fill-opacity' => array('fillOpacity', self::TYPE_NUMBER), + 'fill-rule' => array('fillRule', self::TYPE_NAME), + + 'stroke' => array('stroke', self::TYPE_COLOR), + 'stroke-dasharray' => array('strokeDasharray', self::TYPE_NAME), + 'stroke-dashoffset' => array('strokeDashoffset', self::TYPE_NUMBER), + 'stroke-linecap' => array('strokeLinecap', self::TYPE_NAME), + 'stroke-linejoin' => array('strokeLinejoin', self::TYPE_NAME), + 'stroke-miterlimit' => array('strokeMiterlimit', self::TYPE_NUMBER), + 'stroke-opacity' => array('strokeOpacity', self::TYPE_NUMBER), + 'stroke-width' => array('strokeWidth', self::TYPE_NUMBER), + + 'font-family' => array('fontFamily', self::TYPE_NAME), + 'font-size' => array('fontSize', self::TYPE_NUMBER), + 'font-weight' => array('fontWeight', self::TYPE_NAME), + 'font-style' => array('fontStyle', self::TYPE_NAME), + 'text-anchor' => array('textAnchor', self::TYPE_NAME), + ); + } + + /** + * @param $attributes + * + * @return Style + */ + public function fromAttributes($attributes) + { + $this->fillStyles($attributes); + + if (isset($attributes["style"])) { + $styles = self::parseCssStyle($attributes["style"]); + $this->fillStyles($styles); + } + } + + public function inherit(AbstractTag $tag) { + $group = $tag->getParentGroup(); + if ($group) { + $parent_style = $group->getStyle(); + + foreach ($parent_style as $_key => $_value) { + if ($_value !== null) { + $this->$_key = $_value; + } + } + } + } + + public function fromStyleSheets(AbstractTag $tag, $attributes) { + $class = isset($attributes["class"]) ? preg_split('/\s+/', trim($attributes["class"])) : null; + + $stylesheets = $tag->getDocument()->getStyleSheets(); + + $styles = array(); + + foreach ($stylesheets as $_sc) { + + /** @var \Sabberworm\CSS\RuleSet\DeclarationBlock $_decl */ + foreach ($_sc->getAllDeclarationBlocks() as $_decl) { + + /** @var \Sabberworm\CSS\Property\Selector $_selector */ + foreach ($_decl->getSelectors() as $_selector) { + $_selector = $_selector->getSelector(); + + // Match class name + if ($class !== null) { + foreach ($class as $_class) { + if ($_selector === ".$_class") { + /** @var \Sabberworm\CSS\Rule\Rule $_rule */ + foreach ($_decl->getRules() as $_rule) { + $styles[$_rule->getRule()] = $_rule->getValue() . ""; + } + + break 2; + } + } + } + + // Match tag name + if ($_selector === $tag->tagName) { + /** @var \Sabberworm\CSS\Rule\Rule $_rule */ + foreach ($_decl->getRules() as $_rule) { + $styles[$_rule->getRule()] = $_rule->getValue() . ""; + } + + break; + } + } + } + } + + $this->fillStyles($styles); + } + + protected function fillStyles($styles) + { + foreach ($this->getStyleMap() as $from => $spec) { + if (isset($styles[$from])) { + list($to, $type) = $spec; + $value = null; + switch ($type) { + case self::TYPE_COLOR: + $value = self::parseColor($styles[$from]); + break; + + case self::TYPE_NUMBER: + $value = ($styles[$from] === null) ? null : (float)$styles[$from]; + break; + + default: + $value = $styles[$from]; + } + + if ($value !== null) { + $this->$to = $value; + } + } + } + } + + static function parseColor($color) + { + $color = strtolower(trim($color)); + + $parts = preg_split('/[^,]\s+/', $color, 2); + + if (count($parts) == 2) { + $color = $parts[1]; + } + else { + $color = $parts[0]; + } + + if ($color === "none") { + return "none"; + } + + // SVG color name + if (isset(self::$colorNames[$color])) { + return self::parseHexColor(self::$colorNames[$color]); + } + + // Hex color + if ($color[0] === "#") { + return self::parseHexColor($color); + } + + // RGB color + if (strpos($color, "rgb") !== false) { + return self::getTriplet($color); + } + + // RGB color + if (strpos($color, "hsl") !== false) { + $triplet = self::getTriplet($color, true); + + if ($triplet == null) { + return null; + } + + list($h, $s, $l) = $triplet; + + $r = $l; + $g = $l; + $b = $l; + $v = ($l <= 0.5) ? ($l * (1.0 + $s)) : ($l + $s - $l * $s); + if ($v > 0) { + $m = $l + $l - $v; + $sv = ($v - $m) / $v; + $h *= 6.0; + $sextant = floor($h); + $fract = $h - $sextant; + $vsf = $v * $sv * $fract; + $mid1 = $m + $vsf; + $mid2 = $v - $vsf; + + switch ($sextant) { + case 0: + $r = $v; + $g = $mid1; + $b = $m; + break; + case 1: + $r = $mid2; + $g = $v; + $b = $m; + break; + case 2: + $r = $m; + $g = $v; + $b = $mid1; + break; + case 3: + $r = $m; + $g = $mid2; + $b = $v; + break; + case 4: + $r = $mid1; + $g = $m; + $b = $v; + break; + case 5: + $r = $v; + $g = $m; + $b = $mid2; + break; + } + } + + return array( + $r * 255.0, + $g * 255.0, + $b * 255.0, + ); + } + + // Gradient + if (strpos($color, "url(#") !== false) { + $i = strpos($color, "("); + $j = strpos($color, ")"); + + // Bad url format + if ($i === false || $j === false) { + return null; + } + + return trim(substr($color, $i + 1, $j - $i - 1)); + } + + return null; + } + + static function getTriplet($color, $percent = false) { + $i = strpos($color, "("); + $j = strpos($color, ")"); + + // Bad color value + if ($i === false || $j === false) { + return null; + } + + $triplet = preg_split("/\\s*,\\s*/", trim(substr($color, $i + 1, $j - $i - 1))); + + if (count($triplet) != 3) { + return null; + } + + foreach (array_keys($triplet) as $c) { + $triplet[$c] = trim($triplet[$c]); + + if ($percent) { + if ($triplet[$c][strlen($triplet[$c]) - 1] === "%") { + $triplet[$c] = $triplet[$c] / 100; + } + else { + $triplet[$c] = $triplet[$c] / 255; + } + } + else { + if ($triplet[$c][strlen($triplet[$c]) - 1] === "%") { + $triplet[$c] = round($triplet[$c] * 2.55); + } + } + } + + return $triplet; + } + + static function parseHexColor($hex) + { + $c = array(0, 0, 0); + + // #FFFFFF + if (isset($hex[6])) { + $c[0] = hexdec(substr($hex, 1, 2)); + $c[1] = hexdec(substr($hex, 3, 2)); + $c[2] = hexdec(substr($hex, 5, 2)); + } else { + $c[0] = hexdec($hex[1] . $hex[1]); + $c[1] = hexdec($hex[2] . $hex[2]); + $c[2] = hexdec($hex[3] . $hex[3]); + } + + return $c; + } + + /** + * Simple CSS parser + * + * @param $style + * + * @return array + */ + static function parseCssStyle($style) + { + $matches = array(); + preg_match_all("/([a-z-]+)\\s*:\\s*([^;$]+)/si", $style, $matches, PREG_SET_ORDER); + + $styles = array(); + foreach ($matches as $match) { + $styles[$match[1]] = $match[2]; + } + + return $styles; + } + + /** + * Convert a size to a float + * + * @param string $size SVG size + * @param float $dpi DPI + * @param float $referenceSize Reference size + * + * @return float|null + */ + static function convertSize($size, $referenceSize = 11.0, $dpi = 96.0) { + $size = trim(strtolower($size)); + + if (is_numeric($size)) { + return $size; + } + + if ($pos = strpos($size, "px")) { + return floatval(substr($size, 0, $pos)); + } + + if ($pos = strpos($size, "pt")) { + return floatval(substr($size, 0, $pos)); + } + + if ($pos = strpos($size, "cm")) { + return floatval(substr($size, 0, $pos)) * $dpi; + } + + if ($pos = strpos($size, "%")) { + return $referenceSize * substr($size, 0, $pos) / 100; + } + + if ($pos = strpos($size, "em")) { + return $referenceSize * substr($size, 0, $pos); + } + + // TODO cm, mm, pc, in, etc + + return null; + } + + static $colorNames = array( + 'antiquewhite' => '#FAEBD7', + 'aqua' => '#00FFFF', + 'aquamarine' => '#7FFFD4', + 'beige' => '#F5F5DC', + 'black' => '#000000', + 'blue' => '#0000FF', + 'brown' => '#A52A2A', + 'cadetblue' => '#5F9EA0', + 'chocolate' => '#D2691E', + 'cornflowerblue' => '#6495ED', + 'crimson' => '#DC143C', + 'darkblue' => '#00008B', + 'darkgoldenrod' => '#B8860B', + 'darkgreen' => '#006400', + 'darkmagenta' => '#8B008B', + 'darkorange' => '#FF8C00', + 'darkred' => '#8B0000', + 'darkseagreen' => '#8FBC8F', + 'darkslategray' => '#2F4F4F', + 'darkviolet' => '#9400D3', + 'deepskyblue' => '#00BFFF', + 'dodgerblue' => '#1E90FF', + 'firebrick' => '#B22222', + 'forestgreen' => '#228B22', + 'fuchsia' => '#FF00FF', + 'gainsboro' => '#DCDCDC', + 'gold' => '#FFD700', + 'gray' => '#808080', + 'green' => '#008000', + 'greenyellow' => '#ADFF2F', + 'hotpink' => '#FF69B4', + 'indigo' => '#4B0082', + 'khaki' => '#F0E68C', + 'lavenderblush' => '#FFF0F5', + 'lemonchiffon' => '#FFFACD', + 'lightcoral' => '#F08080', + 'lightgoldenrodyellow' => '#FAFAD2', + 'lightgreen' => '#90EE90', + 'lightsalmon' => '#FFA07A', + 'lightskyblue' => '#87CEFA', + 'lightslategray' => '#778899', + 'lightyellow' => '#FFFFE0', + 'lime' => '#00FF00', + 'limegreen' => '#32CD32', + 'magenta' => '#FF00FF', + 'maroon' => '#800000', + 'mediumaquamarine' => '#66CDAA', + 'mediumorchid' => '#BA55D3', + 'mediumseagreen' => '#3CB371', + 'mediumspringgreen' => '#00FA9A', + 'mediumvioletred' => '#C71585', + 'midnightblue' => '#191970', + 'mintcream' => '#F5FFFA', + 'moccasin' => '#FFE4B5', + 'navy' => '#000080', + 'olive' => '#808000', + 'orange' => '#FFA500', + 'orchid' => '#DA70D6', + 'palegreen' => '#98FB98', + 'palevioletred' => '#D87093', + 'peachpuff' => '#FFDAB9', + 'pink' => '#FFC0CB', + 'powderblue' => '#B0E0E6', + 'purple' => '#800080', + 'red' => '#FF0000', + 'royalblue' => '#4169E1', + 'salmon' => '#FA8072', + 'seagreen' => '#2E8B57', + 'sienna' => '#A0522D', + 'silver' => '#C0C0C0', + 'skyblue' => '#87CEEB', + 'slategray' => '#708090', + 'springgreen' => '#00FF7F', + 'steelblue' => '#4682B4', + 'tan' => '#D2B48C', + 'teal' => '#008080', + 'thistle' => '#D8BFD8', + 'turquoise' => '#40E0D0', + 'violetred' => '#D02090', + 'white' => '#FFFFFF', + 'yellow' => '#FFFF00', + 'aliceblue' => '#f0f8ff', + 'azure' => '#f0ffff', + 'bisque' => '#ffe4c4', + 'blanchedalmond' => '#ffebcd', + 'blueviolet' => '#8a2be2', + 'burlywood' => '#deb887', + 'chartreuse' => '#7fff00', + 'coral' => '#ff7f50', + 'cornsilk' => '#fff8dc', + 'cyan' => '#00ffff', + 'darkcyan' => '#008b8b', + 'darkgray' => '#a9a9a9', + 'darkgrey' => '#a9a9a9', + 'darkkhaki' => '#bdb76b', + 'darkolivegreen' => '#556b2f', + 'darkorchid' => '#9932cc', + 'darksalmon' => '#e9967a', + 'darkslateblue' => '#483d8b', + 'darkslategrey' => '#2f4f4f', + 'darkturquoise' => '#00ced1', + 'deeppink' => '#ff1493', + 'dimgray' => '#696969', + 'dimgrey' => '#696969', + 'floralwhite' => '#fffaf0', + 'ghostwhite' => '#f8f8ff', + 'goldenrod' => '#daa520', + 'grey' => '#808080', + 'honeydew' => '#f0fff0', + 'indianred' => '#cd5c5c', + 'ivory' => '#fffff0', + 'lavender' => '#e6e6fa', + 'lawngreen' => '#7cfc00', + 'lightblue' => '#add8e6', + 'lightcyan' => '#e0ffff', + 'lightgray' => '#d3d3d3', + 'lightgrey' => '#d3d3d3', + 'lightpink' => '#ffb6c1', + 'lightseagreen' => '#20b2aa', + 'lightslategrey' => '#778899', + 'lightsteelblue' => '#b0c4de', + 'linen' => '#faf0e6', + 'mediumblue' => '#0000cd', + 'mediumpurple' => '#9370db', + 'mediumslateblue' => '#7b68ee', + 'mediumturquoise' => '#48d1cc', + 'mistyrose' => '#ffe4e1', + 'navajowhite' => '#ffdead', + 'oldlace' => '#fdf5e6', + 'olivedrab' => '#6b8e23', + 'orangered' => '#ff4500', + 'palegoldenrod' => '#eee8aa', + 'paleturquoise' => '#afeeee', + 'papayawhip' => '#ffefd5', + 'peru' => '#cd853f', + 'plum' => '#dda0dd', + 'rosybrown' => '#bc8f8f', + 'saddlebrown' => '#8b4513', + 'sandybrown' => '#f4a460', + 'seashell' => '#fff5ee', + 'slateblue' => '#6a5acd', + 'slategrey' => '#708090', + 'snow' => '#fffafa', + 'tomato' => '#ff6347', + 'violet' => '#ee82ee', + 'wheat' => '#f5deb3', + 'whitesmoke' => '#f5f5f5', + 'yellowgreen' => '#9acd32', + ); +} \ No newline at end of file diff --git a/lib/dompdf/lib/php-svg-lib/src/Svg/Surface/CPdf.php b/lib/dompdf/lib/php-svg-lib/src/Svg/Surface/CPdf.php new file mode 100644 index 0000000..2dce8f3 --- /dev/null +++ b/lib/dompdf/lib/php-svg-lib/src/Svg/Surface/CPdf.php @@ -0,0 +1,4768 @@ + + * @author Orion Richardson
+ ++ * @author Helmut Tischer + * @author Ryan H. Masten + * @author Brian Sweeney + * @author Fabien Ménager + * @license Public Domain http://creativecommons.org/licenses/publicdomain/ + * @package Cpdf + */ + +namespace Svg\Surface; + +class CPdf +{ + + /** + * @var integer The current number of pdf objects in the document + */ + public $numObj = 0; + + /** + * @var array This array contains all of the pdf objects, ready for final assembly + */ + public $objects = array(); + + /** + * @var integer The objectId (number within the objects array) of the document catalog + */ + public $catalogId; + + /** + * @var array Array carrying information about the fonts that the system currently knows about + * Used to ensure that a font is not loaded twice, among other things + */ + public $fonts = array(); + + /** + * @var string The default font metrics file to use if no other font has been loaded. + * The path to the directory containing the font metrics should be included + */ + public $defaultFont = './fonts/Helvetica.afm'; + + /** + * @string A record of the current font + */ + public $currentFont = ''; + + /** + * @var string The current base font + */ + public $currentBaseFont = ''; + + /** + * @var integer The number of the current font within the font array + */ + public $currentFontNum = 0; + + /** + * @var integer + */ + public $currentNode; + + /** + * @var integer Object number of the current page + */ + public $currentPage; + + /** + * @var integer Object number of the currently active contents block + */ + public $currentContents; + + /** + * @var integer Number of fonts within the system + */ + public $numFonts = 0; + + /** + * @var integer Number of graphic state resources used + */ + private $numStates = 0; + + /** + * @var array Current color for fill operations, defaults to inactive value, + * all three components should be between 0 and 1 inclusive when active + */ + public $currentColor = null; + + /** + * @var string Fill rule (nonzero or evenodd) + */ + public $fillRule = "nonzero"; + + /** + * @var array Current color for stroke operations (lines etc.) + */ + public $currentStrokeColor = null; + + /** + * @var string Current style that lines are drawn in + */ + public $currentLineStyle = ''; + + /** + * @var array Current line transparency (partial graphics state) + */ + public $currentLineTransparency = array("mode" => "Normal", "opacity" => 1.0); + + /** + * array Current fill transparency (partial graphics state) + */ + public $currentFillTransparency = array("mode" => "Normal", "opacity" => 1.0); + + /** + * @var array An array which is used to save the state of the document, mainly the colors and styles + * it is used to temporarily change to another state, the change back to what it was before + */ + public $stateStack = array(); + + /** + * @var integer Number of elements within the state stack + */ + public $nStateStack = 0; + + /** + * @var integer Number of page objects within the document + */ + public $numPages = 0; + + /** + * @var array Object Id storage stack + */ + public $stack = array(); + + /** + * @var integer Number of elements within the object Id storage stack + */ + public $nStack = 0; + + /** + * an array which contains information about the objects which are not firmly attached to pages + * these have been added with the addObject function + */ + public $looseObjects = array(); + + /** + * array contains infomation about how the loose objects are to be added to the document + */ + public $addLooseObjects = array(); + + /** + * @var integer The objectId of the information object for the document + * this contains authorship, title etc. + */ + public $infoObject = 0; + + /** + * @var integer Number of images being tracked within the document + */ + public $numImages = 0; + + /** + * @var array An array containing options about the document + * it defaults to turning on the compression of the objects + */ + public $options = array('compression' => true); + + /** + * @var integer The objectId of the first page of the document + */ + public $firstPageId; + + /** + * @var float Used to track the last used value of the inter-word spacing, this is so that it is known + * when the spacing is changed. + */ + public $wordSpaceAdjust = 0; + + /** + * @var float Used to track the last used value of the inter-letter spacing, this is so that it is known + * when the spacing is changed. + */ + public $charSpaceAdjust = 0; + + /** + * @var integer The object Id of the procset object + */ + public $procsetObjectId; + + /** + * @var array Store the information about the relationship between font families + * this used so that the code knows which font is the bold version of another font, etc. + * the value of this array is initialised in the constuctor function. + */ + public $fontFamilies = array(); + + /** + * @var string Folder for php serialized formats of font metrics files. + * If empty string, use same folder as original metrics files. + * This can be passed in from class creator. + * If this folder does not exist or is not writable, Cpdf will be **much** slower. + * Because of potential trouble with php safe mode, folder cannot be created at runtime. + */ + public $fontcache = ''; + + /** + * @var integer The version of the font metrics cache file. + * This value must be manually incremented whenever the internal font data structure is modified. + */ + public $fontcacheVersion = 6; + + /** + * @var string Temporary folder. + * If empty string, will attempty system tmp folder. + * This can be passed in from class creator. + * Only used for conversion of gd images to jpeg images. + */ + public $tmp = ''; + + /** + * @var string Track if the current font is bolded or italicised + */ + public $currentTextState = ''; + + /** + * @var string Messages are stored here during processing, these can be selected afterwards to give some useful debug information + */ + public $messages = ''; + + /** + * @var string The ancryption array for the document encryption is stored here + */ + public $arc4 = ''; + + /** + * @var integer The object Id of the encryption information + */ + public $arc4_objnum = 0; + + /** + * @var string The file identifier, used to uniquely identify a pdf document + */ + public $fileIdentifier = ''; + + /** + * @var boolean A flag to say if a document is to be encrypted or not + */ + public $encrypted = false; + + /** + * @var string The encryption key for the encryption of all the document content (structure is not encrypted) + */ + public $encryptionKey = ''; + + /** + * @var array Array which forms a stack to keep track of nested callback functions + */ + public $callback = array(); + + /** + * @var integer The number of callback functions in the callback array + */ + public $nCallback = 0; + + /** + * @var array Store label->id pairs for named destinations, these will be used to replace internal links + * done this way so that destinations can be defined after the location that links to them + */ + public $destinations = array(); + + /** + * @var array Store the stack for the transaction commands, each item in here is a record of the values of all the + * publiciables within the class, so that the user can rollback at will (from each 'start' command) + * note that this includes the objects array, so these can be large. + */ + public $checkpoint = ''; + + /** + * @var array Table of Image origin filenames and image labels which were already added with o_image(). + * Allows to merge identical images + */ + public $imagelist = array(); + + /** + * @var boolean Whether the text passed in should be treated as Unicode or just local character set. + */ + public $isUnicode = false; + + /** + * @var string the JavaScript code of the document + */ + public $javascript = ''; + + /** + * @var boolean whether the compression is possible + */ + protected $compressionReady = false; + + /** + * @var array Current page size + */ + protected $currentPageSize = array("width" => 0, "height" => 0); + + /** + * @var array All the chars that will be required in the font subsets + */ + protected $stringSubsets = array(); + + /** + * @var string The target internal encoding + */ + static protected $targetEncoding = 'iso-8859-1'; + + /** + * @var array The list of the core fonts + */ + static protected $coreFonts = array( + 'courier', + 'courier-bold', + 'courier-oblique', + 'courier-boldoblique', + 'helvetica', + 'helvetica-bold', + 'helvetica-oblique', + 'helvetica-boldoblique', + 'times-roman', + 'times-bold', + 'times-italic', + 'times-bolditalic', + 'symbol', + 'zapfdingbats' + ); + + /** + * Class constructor + * This will start a new document + * + * @param array $pageSize Array of 4 numbers, defining the bottom left and upper right corner of the page. first two are normally zero. + * @param boolean $isUnicode Whether text will be treated as Unicode or not. + * @param string $fontcache The font cache folder + * @param string $tmp The temporary folder + */ + function __construct($pageSize = array(0, 0, 612, 792), $isUnicode = false, $fontcache = '', $tmp = '') + { + $this->isUnicode = $isUnicode; + $this->fontcache = $fontcache; + $this->tmp = $tmp; + $this->newDocument($pageSize); + + $this->compressionReady = function_exists('gzcompress'); + + if (in_array('Windows-1252', mb_list_encodings())) { + self::$targetEncoding = 'Windows-1252'; + } + + // also initialize the font families that are known about already + $this->setFontFamily('init'); + // $this->fileIdentifier = md5('xxxxxxxx'.time()); + } + + /** + * Document object methods (internal use only) + * + * There is about one object method for each type of object in the pdf document + * Each function has the same call list ($id,$action,$options). + * $id = the object ID of the object, or what it is to be if it is being created + * $action = a string specifying the action to be performed, though ALL must support: + * 'new' - create the object with the id $id + * 'out' - produce the output for the pdf object + * $options = optional, a string or array containing the various parameters for the object + * + * These, in conjunction with the output function are the ONLY way for output to be produced + * within the pdf 'file'. + */ + + /** + * Destination object, used to specify the location for the user to jump to, presently on opening + */ + protected function o_destination($id, $action, $options = '') + { + if ($action !== 'new') { + $o = &$this->objects[$id]; + } + + switch ($action) { + case 'new': + $this->objects[$id] = array('t' => 'destination', 'info' => array()); + $tmp = ''; + switch ($options['type']) { + case 'XYZ': + case 'FitR': + $tmp = ' ' . $options['p3'] . $tmp; + case 'FitH': + case 'FitV': + case 'FitBH': + case 'FitBV': + $tmp = ' ' . $options['p1'] . ' ' . $options['p2'] . $tmp; + case 'Fit': + case 'FitB': + $tmp = $options['type'] . $tmp; + $this->objects[$id]['info']['string'] = $tmp; + $this->objects[$id]['info']['page'] = $options['page']; + } + break; + + case 'out': + $tmp = $o['info']; + $res = "\n$id 0 obj\n" . '[' . $tmp['page'] . ' 0 R /' . $tmp['string'] . "]\nendobj"; + + return $res; + } + } + + /** + * set the viewer preferences + */ + protected function o_viewerPreferences($id, $action, $options = '') + { + if ($action !== 'new') { + $o = &$this->objects[$id]; + } + + switch ($action) { + case 'new': + $this->objects[$id] = array('t' => 'viewerPreferences', 'info' => array()); + break; + + case 'add': + foreach ($options as $k => $v) { + switch ($k) { + case 'HideToolbar': + case 'HideMenubar': + case 'HideWindowUI': + case 'FitWindow': + case 'CenterWindow': + case 'NonFullScreenPageMode': + case 'Direction': + $o['info'][$k] = $v; + break; + } + } + break; + + case 'out': + $res = "\n$id 0 obj\n<< "; + foreach ($o['info'] as $k => $v) { + $res .= "\n/$k $v"; + } + $res .= "\n>>\n"; + + return $res; + } + } + + /** + * define the document catalog, the overall controller for the document + */ + protected function o_catalog($id, $action, $options = '') + { + if ($action !== 'new') { + $o = &$this->objects[$id]; + } + + switch ($action) { + case 'new': + $this->objects[$id] = array('t' => 'catalog', 'info' => array()); + $this->catalogId = $id; + break; + + case 'outlines': + case 'pages': + case 'openHere': + case 'javascript': + $o['info'][$action] = $options; + break; + + case 'viewerPreferences': + if (!isset($o['info']['viewerPreferences'])) { + $this->numObj++; + $this->o_viewerPreferences($this->numObj, 'new'); + $o['info']['viewerPreferences'] = $this->numObj; + } + + $vp = $o['info']['viewerPreferences']; + $this->o_viewerPreferences($vp, 'add', $options); + + break; + + case 'out': + $res = "\n$id 0 obj\n<< /Type /Catalog"; + + foreach ($o['info'] as $k => $v) { + switch ($k) { + case 'outlines': + $res .= "\n/Outlines $v 0 R"; + break; + + case 'pages': + $res .= "\n/Pages $v 0 R"; + break; + + case 'viewerPreferences': + $res .= "\n/ViewerPreferences $v 0 R"; + break; + + case 'openHere': + $res .= "\n/OpenAction $v 0 R"; + break; + + case 'javascript': + $res .= "\n/Names <>"; + break; + } + } + + $res .= " >>\nendobj"; + + return $res; + } + } + + /** + * object which is a parent to the pages in the document + */ + protected function o_pages($id, $action, $options = '') + { + if ($action !== 'new') { + $o = &$this->objects[$id]; + } + + switch ($action) { + case 'new': + $this->objects[$id] = array('t' => 'pages', 'info' => array()); + $this->o_catalog($this->catalogId, 'pages', $id); + break; + + case 'page': + if (!is_array($options)) { + // then it will just be the id of the new page + $o['info']['pages'][] = $options; + } else { + // then it should be an array having 'id','rid','pos', where rid=the page to which this one will be placed relative + // and pos is either 'before' or 'after', saying where this page will fit. + if (isset($options['id']) && isset($options['rid']) && isset($options['pos'])) { + $i = array_search($options['rid'], $o['info']['pages']); + if (isset($o['info']['pages'][$i]) && $o['info']['pages'][$i] == $options['rid']) { + + // then there is a match + // make a space + switch ($options['pos']) { + case 'before': + $k = $i; + break; + + case 'after': + $k = $i + 1; + break; + + default: + $k = -1; + break; + } + + if ($k >= 0) { + for ($j = count($o['info']['pages']) - 1; $j >= $k; $j--) { + $o['info']['pages'][$j + 1] = $o['info']['pages'][$j]; + } + + $o['info']['pages'][$k] = $options['id']; + } + } + } + } + break; + + case 'procset': + $o['info']['procset'] = $options; + break; + + case 'mediaBox': + $o['info']['mediaBox'] = $options; + // which should be an array of 4 numbers + $this->currentPageSize = array('width' => $options[2], 'height' => $options[3]); + break; + + case 'font': + $o['info']['fonts'][] = array('objNum' => $options['objNum'], 'fontNum' => $options['fontNum']); + break; + + case 'extGState': + $o['info']['extGStates'][] = array('objNum' => $options['objNum'], 'stateNum' => $options['stateNum']); + break; + + case 'xObject': + $o['info']['xObjects'][] = array('objNum' => $options['objNum'], 'label' => $options['label']); + break; + + case 'out': + if (count($o['info']['pages'])) { + $res = "\n$id 0 obj\n<< /Type /Pages\n/Kids ["; + foreach ($o['info']['pages'] as $v) { + $res .= "$v 0 R\n"; + } + + $res .= "]\n/Count " . count($this->objects[$id]['info']['pages']); + + if ((isset($o['info']['fonts']) && count($o['info']['fonts'])) || + isset($o['info']['procset']) || + (isset($o['info']['extGStates']) && count($o['info']['extGStates'])) + ) { + $res .= "\n/Resources <<"; + + if (isset($o['info']['procset'])) { + $res .= "\n/ProcSet " . $o['info']['procset'] . " 0 R"; + } + + if (isset($o['info']['fonts']) && count($o['info']['fonts'])) { + $res .= "\n/Font << "; + foreach ($o['info']['fonts'] as $finfo) { + $res .= "\n/F" . $finfo['fontNum'] . " " . $finfo['objNum'] . " 0 R"; + } + $res .= "\n>>"; + } + + if (isset($o['info']['xObjects']) && count($o['info']['xObjects'])) { + $res .= "\n/XObject << "; + foreach ($o['info']['xObjects'] as $finfo) { + $res .= "\n/" . $finfo['label'] . " " . $finfo['objNum'] . " 0 R"; + } + $res .= "\n>>"; + } + + if (isset($o['info']['extGStates']) && count($o['info']['extGStates'])) { + $res .= "\n/ExtGState << "; + foreach ($o['info']['extGStates'] as $gstate) { + $res .= "\n/GS" . $gstate['stateNum'] . " " . $gstate['objNum'] . " 0 R"; + } + $res .= "\n>>"; + } + + $res .= "\n>>"; + if (isset($o['info']['mediaBox'])) { + $tmp = $o['info']['mediaBox']; + $res .= "\n/MediaBox [" . sprintf( + '%.3F %.3F %.3F %.3F', + $tmp[0], + $tmp[1], + $tmp[2], + $tmp[3] + ) . ']'; + } + } + + $res .= "\n >>\nendobj"; + } else { + $res = "\n$id 0 obj\n<< /Type /Pages\n/Count 0\n>>\nendobj"; + } + + return $res; + } + } + + /** + * define the outlines in the doc, empty for now + */ + protected function o_outlines($id, $action, $options = '') + { + if ($action !== 'new') { + $o = &$this->objects[$id]; + } + + switch ($action) { + case 'new': + $this->objects[$id] = array('t' => 'outlines', 'info' => array('outlines' => array())); + $this->o_catalog($this->catalogId, 'outlines', $id); + break; + + case 'outline': + $o['info']['outlines'][] = $options; + break; + + case 'out': + if (count($o['info']['outlines'])) { + $res = "\n$id 0 obj\n<< /Type /Outlines /Kids ["; + foreach ($o['info']['outlines'] as $v) { + $res .= "$v 0 R "; + } + + $res .= "] /Count " . count($o['info']['outlines']) . " >>\nendobj"; + } else { + $res = "\n$id 0 obj\n<< /Type /Outlines /Count 0 >>\nendobj"; + } + + return $res; + } + } + + /** + * an object to hold the font description + */ + protected function o_font($id, $action, $options = '') + { + if ($action !== 'new') { + $o = &$this->objects[$id]; + } + + switch ($action) { + case 'new': + $this->objects[$id] = array( + 't' => 'font', + 'info' => array( + 'name' => $options['name'], + 'fontFileName' => $options['fontFileName'], + 'SubType' => 'Type1' + ) + ); + $fontNum = $this->numFonts; + $this->objects[$id]['info']['fontNum'] = $fontNum; + + // deal with the encoding and the differences + if (isset($options['differences'])) { + // then we'll need an encoding dictionary + $this->numObj++; + $this->o_fontEncoding($this->numObj, 'new', $options); + $this->objects[$id]['info']['encodingDictionary'] = $this->numObj; + } else { + if (isset($options['encoding'])) { + // we can specify encoding here + switch ($options['encoding']) { + case 'WinAnsiEncoding': + case 'MacRomanEncoding': + case 'MacExpertEncoding': + $this->objects[$id]['info']['encoding'] = $options['encoding']; + break; + + case 'none': + break; + + default: + $this->objects[$id]['info']['encoding'] = 'WinAnsiEncoding'; + break; + } + } else { + $this->objects[$id]['info']['encoding'] = 'WinAnsiEncoding'; + } + } + + if ($this->fonts[$options['fontFileName']]['isUnicode']) { + // For Unicode fonts, we need to incorporate font data into + // sub-sections that are linked from the primary font section. + // Look at o_fontGIDtoCID and o_fontDescendentCID functions + // for more informaiton. + // + // All of this code is adapted from the excellent changes made to + // transform FPDF to TCPDF (http://tcpdf.sourceforge.net/) + + $toUnicodeId = ++$this->numObj; + $this->o_contents($toUnicodeId, 'new', 'raw'); + $this->objects[$id]['info']['toUnicode'] = $toUnicodeId; + + $stream = << > def +/CMapName /Adobe-Identity-UCS def +/CMapType 2 def +1 begincodespacerange +<0000> +endcodespacerange +1 beginbfrange +<0000> <0000> +endbfrange +endcmap +CMapName currentdict /CMap defineresource pop +end +end +EOT; + + $res = "<>\n"; + $res .= "stream\n" . $stream . "endstream"; + + $this->objects[$toUnicodeId]['c'] = $res; + + $cidFontId = ++$this->numObj; + $this->o_fontDescendentCID($cidFontId, 'new', $options); + $this->objects[$id]['info']['cidFont'] = $cidFontId; + } + + // also tell the pages node about the new font + $this->o_pages($this->currentNode, 'font', array('fontNum' => $fontNum, 'objNum' => $id)); + break; + + case 'add': + foreach ($options as $k => $v) { + switch ($k) { + case 'BaseFont': + $o['info']['name'] = $v; + break; + case 'FirstChar': + case 'LastChar': + case 'Widths': + case 'FontDescriptor': + case 'SubType': + $this->addMessage('o_font ' . $k . " : " . $v); + $o['info'][$k] = $v; + break; + } + } + + // pass values down to descendent font + if (isset($o['info']['cidFont'])) { + $this->o_fontDescendentCID($o['info']['cidFont'], 'add', $options); + } + break; + + case 'out': + if ($this->fonts[$this->objects[$id]['info']['fontFileName']]['isUnicode']) { + // For Unicode fonts, we need to incorporate font data into + // sub-sections that are linked from the primary font section. + // Look at o_fontGIDtoCID and o_fontDescendentCID functions + // for more informaiton. + // + // All of this code is adapted from the excellent changes made to + // transform FPDF to TCPDF (http://tcpdf.sourceforge.net/) + + $res = "\n$id 0 obj\n<>\n"; + $res .= "endobj"; + } else { + $res = "\n$id 0 obj\n<< /Type /Font\n/Subtype /" . $o['info']['SubType'] . "\n"; + $res .= "/Name /F" . $o['info']['fontNum'] . "\n"; + $res .= "/BaseFont /" . $o['info']['name'] . "\n"; + + if (isset($o['info']['encodingDictionary'])) { + // then place a reference to the dictionary + $res .= "/Encoding " . $o['info']['encodingDictionary'] . " 0 R\n"; + } else { + if (isset($o['info']['encoding'])) { + // use the specified encoding + $res .= "/Encoding /" . $o['info']['encoding'] . "\n"; + } + } + + if (isset($o['info']['FirstChar'])) { + $res .= "/FirstChar " . $o['info']['FirstChar'] . "\n"; + } + + if (isset($o['info']['LastChar'])) { + $res .= "/LastChar " . $o['info']['LastChar'] . "\n"; + } + + if (isset($o['info']['Widths'])) { + $res .= "/Widths " . $o['info']['Widths'] . " 0 R\n"; + } + + if (isset($o['info']['FontDescriptor'])) { + $res .= "/FontDescriptor " . $o['info']['FontDescriptor'] . " 0 R\n"; + } + + $res .= ">>\n"; + $res .= "endobj"; + } + + return $res; + } + } + + /** + * a font descriptor, needed for including additional fonts + */ + protected function o_fontDescriptor($id, $action, $options = '') + { + if ($action !== 'new') { + $o = &$this->objects[$id]; + } + + switch ($action) { + case 'new': + $this->objects[$id] = array('t' => 'fontDescriptor', 'info' => $options); + break; + + case 'out': + $res = "\n$id 0 obj\n<< /Type /FontDescriptor\n"; + foreach ($o['info'] as $label => $value) { + switch ($label) { + case 'Ascent': + case 'CapHeight': + case 'Descent': + case 'Flags': + case 'ItalicAngle': + case 'StemV': + case 'AvgWidth': + case 'Leading': + case 'MaxWidth': + case 'MissingWidth': + case 'StemH': + case 'XHeight': + case 'CharSet': + if (mb_strlen($value, '8bit')) { + $res .= "/$label $value\n"; + } + + break; + case 'FontFile': + case 'FontFile2': + case 'FontFile3': + $res .= "/$label $value 0 R\n"; + break; + + case 'FontBBox': + $res .= "/$label [$value[0] $value[1] $value[2] $value[3]]\n"; + break; + + case 'FontName': + $res .= "/$label /$value\n"; + break; + } + } + + $res .= ">>\nendobj"; + + return $res; + } + } + + /** + * the font encoding + */ + protected function o_fontEncoding($id, $action, $options = '') + { + if ($action !== 'new') { + $o = &$this->objects[$id]; + } + + switch ($action) { + case 'new': + // the options array should contain 'differences' and maybe 'encoding' + $this->objects[$id] = array('t' => 'fontEncoding', 'info' => $options); + break; + + case 'out': + $res = "\n$id 0 obj\n<< /Type /Encoding\n"; + if (!isset($o['info']['encoding'])) { + $o['info']['encoding'] = 'WinAnsiEncoding'; + } + + if ($o['info']['encoding'] !== 'none') { + $res .= "/BaseEncoding /" . $o['info']['encoding'] . "\n"; + } + + $res .= "/Differences \n["; + + $onum = -100; + + foreach ($o['info']['differences'] as $num => $label) { + if ($num != $onum + 1) { + // we cannot make use of consecutive numbering + $res .= "\n$num /$label"; + } else { + $res .= " /$label"; + } + + $onum = $num; + } + + $res .= "\n]\n>>\nendobj"; + + return $res; + } + } + + /** + * a descendent cid font, needed for unicode fonts + */ + protected function o_fontDescendentCID($id, $action, $options = '') + { + if ($action !== 'new') { + $o = &$this->objects[$id]; + } + + switch ($action) { + case 'new': + $this->objects[$id] = array('t' => 'fontDescendentCID', 'info' => $options); + + // we need a CID system info section + $cidSystemInfoId = ++$this->numObj; + $this->o_contents($cidSystemInfoId, 'new', 'raw'); + $this->objects[$id]['info']['cidSystemInfo'] = $cidSystemInfoId; + $res = "<>"; + $this->objects[$cidSystemInfoId]['c'] = $res; + + // and a CID to GID map + $cidToGidMapId = ++$this->numObj; + $this->o_fontGIDtoCIDMap($cidToGidMapId, 'new', $options); + $this->objects[$id]['info']['cidToGidMap'] = $cidToGidMapId; + break; + + case 'add': + foreach ($options as $k => $v) { + switch ($k) { + case 'BaseFont': + $o['info']['name'] = $v; + break; + + case 'FirstChar': + case 'LastChar': + case 'MissingWidth': + case 'FontDescriptor': + case 'SubType': + $this->addMessage("o_fontDescendentCID $k : $v"); + $o['info'][$k] = $v; + break; + } + } + + // pass values down to cid to gid map + $this->o_fontGIDtoCIDMap($o['info']['cidToGidMap'], 'add', $options); + break; + + case 'out': + $res = "\n$id 0 obj\n"; + $res .= "<fonts[$o['info']['fontFileName']]['CIDWidths'])) { + $cid_widths = &$this->fonts[$o['info']['fontFileName']]['CIDWidths']; + $w = ''; + foreach ($cid_widths as $cid => $width) { + $w .= "$cid [$width] "; + } + $res .= "/W [$w]\n"; + } + + $res .= "/CIDToGIDMap " . $o['info']['cidToGidMap'] . " 0 R\n"; + $res .= ">>\n"; + $res .= "endobj"; + + return $res; + } + } + + /** + * a font glyph to character map, needed for unicode fonts + */ + protected function o_fontGIDtoCIDMap($id, $action, $options = '') + { + if ($action !== 'new') { + $o = &$this->objects[$id]; + } + + switch ($action) { + case 'new': + $this->objects[$id] = array('t' => 'fontGIDtoCIDMap', 'info' => $options); + break; + + case 'out': + $res = "\n$id 0 obj\n"; + $fontFileName = $o['info']['fontFileName']; + $tmp = $this->fonts[$fontFileName]['CIDtoGID'] = base64_decode($this->fonts[$fontFileName]['CIDtoGID']); + + $compressed = isset($this->fonts[$fontFileName]['CIDtoGID_Compressed']) && + $this->fonts[$fontFileName]['CIDtoGID_Compressed']; + + if (!$compressed && isset($o['raw'])) { + $res .= $tmp; + } else { + $res .= "<<"; + + if (!$compressed && $this->compressionReady && $this->options['compression']) { + // then implement ZLIB based compression on this content stream + $compressed = true; + $tmp = gzcompress($tmp, 6); + } + if ($compressed) { + $res .= "\n/Filter /FlateDecode"; + } + + $res .= "\n/Length " . mb_strlen($tmp, '8bit') . ">>\nstream\n$tmp\nendstream"; + } + + $res .= "\nendobj"; + + return $res; + } + } + + /** + * the document procset, solves some problems with printing to old PS printers + */ + protected function o_procset($id, $action, $options = '') + { + if ($action !== 'new') { + $o = &$this->objects[$id]; + } + + switch ($action) { + case 'new': + $this->objects[$id] = array('t' => 'procset', 'info' => array('PDF' => 1, 'Text' => 1)); + $this->o_pages($this->currentNode, 'procset', $id); + $this->procsetObjectId = $id; + break; + + case 'add': + // this is to add new items to the procset list, despite the fact that this is considered + // obselete, the items are required for printing to some postscript printers + switch ($options) { + case 'ImageB': + case 'ImageC': + case 'ImageI': + $o['info'][$options] = 1; + break; + } + break; + + case 'out': + $res = "\n$id 0 obj\n["; + foreach ($o['info'] as $label => $val) { + $res .= "/$label "; + } + $res .= "]\nendobj"; + + return $res; + } + } + + /** + * define the document information + */ + protected function o_info($id, $action, $options = '') + { + if ($action !== 'new') { + $o = &$this->objects[$id]; + } + + switch ($action) { + case 'new': + $this->infoObject = $id; + $date = 'D:' . @date('Ymd'); + $this->objects[$id] = array( + 't' => 'info', + 'info' => array( + 'Creator' => 'R and OS php pdf writer, http://www.ros.co.nz', + 'CreationDate' => $date + ) + ); + break; + case 'Title': + case 'Author': + case 'Subject': + case 'Keywords': + case 'Creator': + case 'Producer': + case 'CreationDate': + case 'ModDate': + case 'Trapped': + $o['info'][$action] = $options; + break; + + case 'out': + if ($this->encrypted) { + $this->encryptInit($id); + } + + $res = "\n$id 0 obj\n<<\n"; + foreach ($o['info'] as $k => $v) { + $res .= "/$k ("; + + if ($this->encrypted) { + $v = $this->ARC4($v); + } // dates must be outputted as-is, without Unicode transformations + elseif (!in_array($k, array('CreationDate', 'ModDate'))) { + $v = $this->filterText($v); + } + + $res .= $v; + $res .= ")\n"; + } + + $res .= ">>\nendobj"; + + return $res; + } + } + + /** + * an action object, used to link to URLS initially + */ + protected function o_action($id, $action, $options = '') + { + if ($action !== 'new') { + $o = &$this->objects[$id]; + } + + switch ($action) { + case 'new': + if (is_array($options)) { + $this->objects[$id] = array('t' => 'action', 'info' => $options, 'type' => $options['type']); + } else { + // then assume a URI action + $this->objects[$id] = array('t' => 'action', 'info' => $options, 'type' => 'URI'); + } + break; + + case 'out': + if ($this->encrypted) { + $this->encryptInit($id); + } + + $res = "\n$id 0 obj\n<< /Type /Action"; + switch ($o['type']) { + case 'ilink': + if (!isset($this->destinations[(string)$o['info']['label']])) { + break; + } + + // there will be an 'label' setting, this is the name of the destination + $res .= "\n/S /GoTo\n/D " . $this->destinations[(string)$o['info']['label']] . " 0 R"; + break; + + case 'URI': + $res .= "\n/S /URI\n/URI ("; + if ($this->encrypted) { + $res .= $this->filterText($this->ARC4($o['info']), true, false); + } else { + $res .= $this->filterText($o['info'], true, false); + } + + $res .= ")"; + break; + } + + $res .= "\n>>\nendobj"; + + return $res; + } + } + + /** + * an annotation object, this will add an annotation to the current page. + * initially will support just link annotations + */ + protected function o_annotation($id, $action, $options = '') + { + if ($action !== 'new') { + $o = &$this->objects[$id]; + } + + switch ($action) { + case 'new': + // add the annotation to the current page + $pageId = $this->currentPage; + $this->o_page($pageId, 'annot', $id); + + // and add the action object which is going to be required + switch ($options['type']) { + case 'link': + $this->objects[$id] = array('t' => 'annotation', 'info' => $options); + $this->numObj++; + $this->o_action($this->numObj, 'new', $options['url']); + $this->objects[$id]['info']['actionId'] = $this->numObj; + break; + + case 'ilink': + // this is to a named internal link + $label = $options['label']; + $this->objects[$id] = array('t' => 'annotation', 'info' => $options); + $this->numObj++; + $this->o_action($this->numObj, 'new', array('type' => 'ilink', 'label' => $label)); + $this->objects[$id]['info']['actionId'] = $this->numObj; + break; + } + break; + + case 'out': + $res = "\n$id 0 obj\n<< /Type /Annot"; + switch ($o['info']['type']) { + case 'link': + case 'ilink': + $res .= "\n/Subtype /Link"; + break; + } + $res .= "\n/A " . $o['info']['actionId'] . " 0 R"; + $res .= "\n/Border [0 0 0]"; + $res .= "\n/H /I"; + $res .= "\n/Rect [ "; + + foreach ($o['info']['rect'] as $v) { + $res .= sprintf("%.4F ", $v); + } + + $res .= "]"; + $res .= "\n>>\nendobj"; + + return $res; + } + } + + /** + * a page object, it also creates a contents object to hold its contents + */ + protected function o_page($id, $action, $options = '') + { + if ($action !== 'new') { + $o = &$this->objects[$id]; + } + + switch ($action) { + case 'new': + $this->numPages++; + $this->objects[$id] = array( + 't' => 'page', + 'info' => array( + 'parent' => $this->currentNode, + 'pageNum' => $this->numPages + ) + ); + + if (is_array($options)) { + // then this must be a page insertion, array should contain 'rid','pos'=[before|after] + $options['id'] = $id; + $this->o_pages($this->currentNode, 'page', $options); + } else { + $this->o_pages($this->currentNode, 'page', $id); + } + + $this->currentPage = $id; + //make a contents object to go with this page + $this->numObj++; + $this->o_contents($this->numObj, 'new', $id); + $this->currentContents = $this->numObj; + $this->objects[$id]['info']['contents'] = array(); + $this->objects[$id]['info']['contents'][] = $this->numObj; + + $match = ($this->numPages % 2 ? 'odd' : 'even'); + foreach ($this->addLooseObjects as $oId => $target) { + if ($target === 'all' || $match === $target) { + $this->objects[$id]['info']['contents'][] = $oId; + } + } + break; + + case 'content': + $o['info']['contents'][] = $options; + break; + + case 'annot': + // add an annotation to this page + if (!isset($o['info']['annot'])) { + $o['info']['annot'] = array(); + } + + // $options should contain the id of the annotation dictionary + $o['info']['annot'][] = $options; + break; + + case 'out': + $res = "\n$id 0 obj\n<< /Type /Page"; + $res .= "\n/Parent " . $o['info']['parent'] . " 0 R"; + + if (isset($o['info']['annot'])) { + $res .= "\n/Annots ["; + foreach ($o['info']['annot'] as $aId) { + $res .= " $aId 0 R"; + } + $res .= " ]"; + } + + $count = count($o['info']['contents']); + if ($count == 1) { + $res .= "\n/Contents " . $o['info']['contents'][0] . " 0 R"; + } else { + if ($count > 1) { + $res .= "\n/Contents [\n"; + + // reverse the page contents so added objects are below normal content + //foreach (array_reverse($o['info']['contents']) as $cId) { + // Back to normal now that I've got transparency working --Benj + foreach ($o['info']['contents'] as $cId) { + $res .= "$cId 0 R\n"; + } + $res .= "]"; + } + } + + $res .= "\n>>\nendobj"; + + return $res; + } + } + + /** + * the contents objects hold all of the content which appears on pages + */ + protected function o_contents($id, $action, $options = '') + { + if ($action !== 'new') { + $o = &$this->objects[$id]; + } + + switch ($action) { + case 'new': + $this->objects[$id] = array('t' => 'contents', 'c' => '', 'info' => array()); + if (mb_strlen($options, '8bit') && intval($options)) { + // then this contents is the primary for a page + $this->objects[$id]['onPage'] = $options; + } else { + if ($options === 'raw') { + // then this page contains some other type of system object + $this->objects[$id]['raw'] = 1; + } + } + break; + + case 'add': + // add more options to the decleration + foreach ($options as $k => $v) { + $o['info'][$k] = $v; + } + + case 'out': + $tmp = $o['c']; + $res = "\n$id 0 obj\n"; + + if (isset($this->objects[$id]['raw'])) { + $res .= $tmp; + } else { + $res .= "<<"; + if ($this->compressionReady && $this->options['compression']) { + // then implement ZLIB based compression on this content stream + $res .= " /Filter /FlateDecode"; + $tmp = gzcompress($tmp, 6); + } + + if ($this->encrypted) { + $this->encryptInit($id); + $tmp = $this->ARC4($tmp); + } + + foreach ($o['info'] as $k => $v) { + $res .= "\n/$k $v"; + } + + $res .= "\n/Length " . mb_strlen($tmp, '8bit') . " >>\nstream\n$tmp\nendstream"; + } + + $res .= "\nendobj"; + + return $res; + } + } + + protected function o_embedjs($id, $action) + { + if ($action !== 'new') { + $o = &$this->objects[$id]; + } + + switch ($action) { + case 'new': + $this->objects[$id] = array( + 't' => 'embedjs', + 'info' => array( + 'Names' => '[(EmbeddedJS) ' . ($id + 1) . ' 0 R]' + ) + ); + break; + + case 'out': + $res = "\n$id 0 obj\n<< "; + foreach ($o['info'] as $k => $v) { + $res .= "\n/$k $v"; + } + $res .= "\n>>\nendobj"; + + return $res; + } + } + + protected function o_javascript($id, $action, $code = '') + { + if ($action !== 'new') { + $o = &$this->objects[$id]; + } + + switch ($action) { + case 'new': + $this->objects[$id] = array( + 't' => 'javascript', + 'info' => array( + 'S' => '/JavaScript', + 'JS' => '(' . $this->filterText($code) . ')', + ) + ); + break; + + case 'out': + $res = "\n$id 0 obj\n<< "; + foreach ($o['info'] as $k => $v) { + $res .= "\n/$k $v"; + } + $res .= "\n>>\nendobj"; + + return $res; + } + } + + /** + * an image object, will be an XObject in the document, includes description and data + */ + protected function o_image($id, $action, $options = '') + { + if ($action !== 'new') { + $o = &$this->objects[$id]; + } + + switch ($action) { + case 'new': + // make the new object + $this->objects[$id] = array('t' => 'image', 'data' => &$options['data'], 'info' => array()); + + $info =& $this->objects[$id]['info']; + + $info['Type'] = '/XObject'; + $info['Subtype'] = '/Image'; + $info['Width'] = $options['iw']; + $info['Height'] = $options['ih']; + + if (isset($options['masked']) && $options['masked']) { + $info['SMask'] = ($this->numObj - 1) . ' 0 R'; + } + + if (!isset($options['type']) || $options['type'] === 'jpg') { + if (!isset($options['channels'])) { + $options['channels'] = 3; + } + + switch ($options['channels']) { + case 1: + $info['ColorSpace'] = '/DeviceGray'; + break; + case 4: + $info['ColorSpace'] = '/DeviceCMYK'; + break; + default: + $info['ColorSpace'] = '/DeviceRGB'; + break; + } + + if ($info['ColorSpace'] === '/DeviceCMYK') { + $info['Decode'] = '[1 0 1 0 1 0 1 0]'; + } + + $info['Filter'] = '/DCTDecode'; + $info['BitsPerComponent'] = 8; + } else { + if ($options['type'] === 'png') { + $info['Filter'] = '/FlateDecode'; + $info['DecodeParms'] = '<< /Predictor 15 /Colors ' . $options['ncolor'] . ' /Columns ' . $options['iw'] . ' /BitsPerComponent ' . $options['bitsPerComponent'] . '>>'; + + if ($options['isMask']) { + $info['ColorSpace'] = '/DeviceGray'; + } else { + if (mb_strlen($options['pdata'], '8bit')) { + $tmp = ' [ /Indexed /DeviceRGB ' . (mb_strlen($options['pdata'], '8bit') / 3 - 1) . ' '; + $this->numObj++; + $this->o_contents($this->numObj, 'new'); + $this->objects[$this->numObj]['c'] = $options['pdata']; + $tmp .= $this->numObj . ' 0 R'; + $tmp .= ' ]'; + $info['ColorSpace'] = $tmp; + + if (isset($options['transparency'])) { + $transparency = $options['transparency']; + switch ($transparency['type']) { + case 'indexed': + $tmp = ' [ ' . $transparency['data'] . ' ' . $transparency['data'] . '] '; + $info['Mask'] = $tmp; + break; + + case 'color-key': + $tmp = ' [ ' . + $transparency['r'] . ' ' . $transparency['r'] . + $transparency['g'] . ' ' . $transparency['g'] . + $transparency['b'] . ' ' . $transparency['b'] . + ' ] '; + $info['Mask'] = $tmp; + break; + } + } + } else { + if (isset($options['transparency'])) { + $transparency = $options['transparency']; + + switch ($transparency['type']) { + case 'indexed': + $tmp = ' [ ' . $transparency['data'] . ' ' . $transparency['data'] . '] '; + $info['Mask'] = $tmp; + break; + + case 'color-key': + $tmp = ' [ ' . + $transparency['r'] . ' ' . $transparency['r'] . ' ' . + $transparency['g'] . ' ' . $transparency['g'] . ' ' . + $transparency['b'] . ' ' . $transparency['b'] . + ' ] '; + $info['Mask'] = $tmp; + break; + } + } + $info['ColorSpace'] = '/' . $options['color']; + } + } + + $info['BitsPerComponent'] = $options['bitsPerComponent']; + } + } + + // assign it a place in the named resource dictionary as an external object, according to + // the label passed in with it. + $this->o_pages($this->currentNode, 'xObject', array('label' => $options['label'], 'objNum' => $id)); + + // also make sure that we have the right procset object for it. + $this->o_procset($this->procsetObjectId, 'add', 'ImageC'); + break; + + case 'out': + $tmp = &$o['data']; + $res = "\n$id 0 obj\n<<"; + + foreach ($o['info'] as $k => $v) { + $res .= "\n/$k $v"; + } + + if ($this->encrypted) { + $this->encryptInit($id); + $tmp = $this->ARC4($tmp); + } + + $res .= "\n/Length " . mb_strlen($tmp, '8bit') . ">>\nstream\n$tmp\nendstream\nendobj"; + + return $res; + } + } + + /** + * graphics state object + */ + protected function o_extGState($id, $action, $options = "") + { + static $valid_params = array( + "LW", + "LC", + "LC", + "LJ", + "ML", + "D", + "RI", + "OP", + "op", + "OPM", + "Font", + "BG", + "BG2", + "UCR", + "TR", + "TR2", + "HT", + "FL", + "SM", + "SA", + "BM", + "SMask", + "CA", + "ca", + "AIS", + "TK" + ); + + if ($action !== "new") { + $o = &$this->objects[$id]; + } + + switch ($action) { + case "new": + $this->objects[$id] = array('t' => 'extGState', 'info' => $options); + + // Tell the pages about the new resource + $this->numStates++; + $this->o_pages($this->currentNode, 'extGState', array("objNum" => $id, "stateNum" => $this->numStates)); + break; + + case "out": + $res = "\n$id 0 obj\n<< /Type /ExtGState\n"; + + foreach ($o["info"] as $k => $v) { + if (!in_array($k, $valid_params)) { + continue; + } + $res .= "/$k $v\n"; + } + + $res .= ">>\nendobj"; + + return $res; + } + } + + /** + * encryption object. + */ + protected function o_encryption($id, $action, $options = '') + { + if ($action !== 'new') { + $o = &$this->objects[$id]; + } + + switch ($action) { + case 'new': + // make the new object + $this->objects[$id] = array('t' => 'encryption', 'info' => $options); + $this->arc4_objnum = $id; + + // figure out the additional paramaters required + $pad = chr(0x28) . chr(0xBF) . chr(0x4E) . chr(0x5E) . chr(0x4E) . chr(0x75) . chr(0x8A) . chr(0x41) + . chr(0x64) . chr(0x00) . chr(0x4E) . chr(0x56) . chr(0xFF) . chr(0xFA) . chr(0x01) . chr(0x08) + . chr(0x2E) . chr(0x2E) . chr(0x00) . chr(0xB6) . chr(0xD0) . chr(0x68) . chr(0x3E) . chr(0x80) + . chr(0x2F) . chr(0x0C) . chr(0xA9) . chr(0xFE) . chr(0x64) . chr(0x53) . chr(0x69) . chr(0x7A); + + $len = mb_strlen($options['owner'], '8bit'); + + if ($len > 32) { + $owner = substr($options['owner'], 0, 32); + } else { + if ($len < 32) { + $owner = $options['owner'] . substr($pad, 0, 32 - $len); + } else { + $owner = $options['owner']; + } + } + + $len = mb_strlen($options['user'], '8bit'); + if ($len > 32) { + $user = substr($options['user'], 0, 32); + } else { + if ($len < 32) { + $user = $options['user'] . substr($pad, 0, 32 - $len); + } else { + $user = $options['user']; + } + } + + $tmp = $this->md5_16($owner); + $okey = substr($tmp, 0, 5); + $this->ARC4_init($okey); + $ovalue = $this->ARC4($user); + $this->objects[$id]['info']['O'] = $ovalue; + + // now make the u value, phew. + $tmp = $this->md5_16( + $user . $ovalue . chr($options['p']) . chr(255) . chr(255) . chr(255) . $this->fileIdentifier + ); + + $ukey = substr($tmp, 0, 5); + $this->ARC4_init($ukey); + $this->encryptionKey = $ukey; + $this->encrypted = true; + $uvalue = $this->ARC4($pad); + $this->objects[$id]['info']['U'] = $uvalue; + $this->encryptionKey = $ukey; + // initialize the arc4 array + break; + + case 'out': + $res = "\n$id 0 obj\n<<"; + $res .= "\n/Filter /Standard"; + $res .= "\n/V 1"; + $res .= "\n/R 2"; + $res .= "\n/O (" . $this->filterText($o['info']['O'], true, false) . ')'; + $res .= "\n/U (" . $this->filterText($o['info']['U'], true, false) . ')'; + // and the p-value needs to be converted to account for the twos-complement approach + $o['info']['p'] = (($o['info']['p'] ^ 255) + 1) * -1; + $res .= "\n/P " . ($o['info']['p']); + $res .= "\n>>\nendobj"; + + return $res; + } + } + + /** + * ARC4 functions + * A series of function to implement ARC4 encoding in PHP + */ + + /** + * calculate the 16 byte version of the 128 bit md5 digest of the string + */ + function md5_16($string) + { + $tmp = md5($string); + $out = ''; + for ($i = 0; $i <= 30; $i = $i + 2) { + $out .= chr(hexdec(substr($tmp, $i, 2))); + } + + return $out; + } + + /** + * initialize the encryption for processing a particular object + */ + function encryptInit($id) + { + $tmp = $this->encryptionKey; + $hex = dechex($id); + if (mb_strlen($hex, '8bit') < 6) { + $hex = substr('000000', 0, 6 - mb_strlen($hex, '8bit')) . $hex; + } + $tmp .= chr(hexdec(substr($hex, 4, 2))) . chr(hexdec(substr($hex, 2, 2))) . chr( + hexdec(substr($hex, 0, 2)) + ) . chr(0) . chr(0); + $key = $this->md5_16($tmp); + $this->ARC4_init(substr($key, 0, 10)); + } + + /** + * initialize the ARC4 encryption + */ + function ARC4_init($key = '') + { + $this->arc4 = ''; + + // setup the control array + if (mb_strlen($key, '8bit') == 0) { + return; + } + + $k = ''; + while (mb_strlen($k, '8bit') < 256) { + $k .= $key; + } + + $k = substr($k, 0, 256); + for ($i = 0; $i < 256; $i++) { + $this->arc4 .= chr($i); + } + + $j = 0; + + for ($i = 0; $i < 256; $i++) { + $t = $this->arc4[$i]; + $j = ($j + ord($t) + ord($k[$i])) % 256; + $this->arc4[$i] = $this->arc4[$j]; + $this->arc4[$j] = $t; + } + } + + /** + * ARC4 encrypt a text string + */ + function ARC4($text) + { + $len = mb_strlen($text, '8bit'); + $a = 0; + $b = 0; + $c = $this->arc4; + $out = ''; + for ($i = 0; $i < $len; $i++) { + $a = ($a + 1) % 256; + $t = $c[$a]; + $b = ($b + ord($t)) % 256; + $c[$a] = $c[$b]; + $c[$b] = $t; + $k = ord($c[(ord($c[$a]) + ord($c[$b])) % 256]); + $out .= chr(ord($text[$i]) ^ $k); + } + + return $out; + } + + /** + * functions which can be called to adjust or add to the document + */ + + /** + * add a link in the document to an external URL + */ + function addLink($url, $x0, $y0, $x1, $y1) + { + $this->numObj++; + $info = array('type' => 'link', 'url' => $url, 'rect' => array($x0, $y0, $x1, $y1)); + $this->o_annotation($this->numObj, 'new', $info); + } + + /** + * add a link in the document to an internal destination (ie. within the document) + */ + function addInternalLink($label, $x0, $y0, $x1, $y1) + { + $this->numObj++; + $info = array('type' => 'ilink', 'label' => $label, 'rect' => array($x0, $y0, $x1, $y1)); + $this->o_annotation($this->numObj, 'new', $info); + } + + /** + * set the encryption of the document + * can be used to turn it on and/or set the passwords which it will have. + * also the functions that the user will have are set here, such as print, modify, add + */ + function setEncryption($userPass = '', $ownerPass = '', $pc = array()) + { + $p = bindec("11000000"); + + $options = array('print' => 4, 'modify' => 8, 'copy' => 16, 'add' => 32); + + foreach ($pc as $k => $v) { + if ($v && isset($options[$k])) { + $p += $options[$k]; + } else { + if (isset($options[$v])) { + $p += $options[$v]; + } + } + } + + // implement encryption on the document + if ($this->arc4_objnum == 0) { + // then the block does not exist already, add it. + $this->numObj++; + if (mb_strlen($ownerPass) == 0) { + $ownerPass = $userPass; + } + + $this->o_encryption($this->numObj, 'new', array('user' => $userPass, 'owner' => $ownerPass, 'p' => $p)); + } + } + + /** + * should be used for internal checks, not implemented as yet + */ + function checkAllHere() + { + } + + /** + * return the pdf stream as a string returned from the function + */ + function output($debug = false) + { + if ($debug) { + // turn compression off + $this->options['compression'] = false; + } + + if ($this->javascript) { + $this->numObj++; + + $js_id = $this->numObj; + $this->o_embedjs($js_id, 'new'); + $this->o_javascript(++$this->numObj, 'new', $this->javascript); + + $id = $this->catalogId; + + $this->o_catalog($id, 'javascript', $js_id); + } + + if ($this->arc4_objnum) { + $this->ARC4_init($this->encryptionKey); + } + + $this->checkAllHere(); + + $xref = array(); + $content = '%PDF-1.3'; + $pos = mb_strlen($content, '8bit'); + + foreach ($this->objects as $k => $v) { + $tmp = 'o_' . $v['t']; + $cont = $this->$tmp($k, 'out'); + $content .= $cont; + $xref[] = $pos; + $pos += mb_strlen($cont, '8bit'); + } + + $content .= "\nxref\n0 " . (count($xref) + 1) . "\n0000000000 65535 f \n"; + + foreach ($xref as $p) { + $content .= str_pad($p, 10, "0", STR_PAD_LEFT) . " 00000 n \n"; + } + + $content .= "trailer\n<<\n/Size " . (count($xref) + 1) . "\n/Root 1 0 R\n/Info $this->infoObject 0 R\n"; + + // if encryption has been applied to this document then add the marker for this dictionary + if ($this->arc4_objnum > 0) { + $content .= "/Encrypt $this->arc4_objnum 0 R\n"; + } + + if (mb_strlen($this->fileIdentifier, '8bit')) { + $content .= "/ID[<$this->fileIdentifier><$this->fileIdentifier>]\n"; + } + + // account for \n added at start of xref table + $pos++; + + $content .= ">>\nstartxref\n$pos\n%%EOF\n"; + + return $content; + } + + /** + * intialize a new document + * if this is called on an existing document results may be unpredictable, but the existing document would be lost at minimum + * this function is called automatically by the constructor function + */ + private function newDocument($pageSize = array(0, 0, 612, 792)) + { + $this->numObj = 0; + $this->objects = array(); + + $this->numObj++; + $this->o_catalog($this->numObj, 'new'); + + $this->numObj++; + $this->o_outlines($this->numObj, 'new'); + + $this->numObj++; + $this->o_pages($this->numObj, 'new'); + + $this->o_pages($this->numObj, 'mediaBox', $pageSize); + $this->currentNode = 3; + + $this->numObj++; + $this->o_procset($this->numObj, 'new'); + + $this->numObj++; + $this->o_info($this->numObj, 'new'); + + $this->numObj++; + $this->o_page($this->numObj, 'new'); + + // need to store the first page id as there is no way to get it to the user during + // startup + $this->firstPageId = $this->currentContents; + } + + /** + * open the font file and return a php structure containing it. + * first check if this one has been done before and saved in a form more suited to php + * note that if a php serialized version does not exist it will try and make one, but will + * require write access to the directory to do it... it is MUCH faster to have these serialized + * files. + */ + private function openFont($font) + { + // assume that $font contains the path and file but not the extension + $pos = strrpos($font, '/'); + + if ($pos === false) { + $dir = './'; + $name = $font; + } else { + $dir = substr($font, 0, $pos + 1); + $name = substr($font, $pos + 1); + } + + $fontcache = $this->fontcache; + if ($fontcache == '') { + $fontcache = $dir; + } + + //$name filename without folder and extension of font metrics + //$dir folder of font metrics + //$fontcache folder of runtime created php serialized version of font metrics. + // If this is not given, the same folder as the font metrics will be used. + // Storing and reusing serialized versions improves speed much + + $this->addMessage("openFont: $font - $name"); + + if (!$this->isUnicode || in_array(mb_strtolower(basename($name)), self::$coreFonts)) { + $metrics_name = "$name.afm"; + } else { + $metrics_name = "$name.ufm"; + } + + $cache_name = "$metrics_name.php"; + $this->addMessage("metrics: $metrics_name, cache: $cache_name"); + + if (file_exists($fontcache . $cache_name)) { + $this->addMessage("openFont: php file exists $fontcache$cache_name"); + $this->fonts[$font] = require($fontcache . $cache_name); + + if (!isset($this->fonts[$font]['_version_']) || $this->fonts[$font]['_version_'] != $this->fontcacheVersion) { + // if the font file is old, then clear it out and prepare for re-creation + $this->addMessage('openFont: clear out, make way for new version.'); + $this->fonts[$font] = null; + unset($this->fonts[$font]); + } + } else { + $old_cache_name = "php_$metrics_name"; + if (file_exists($fontcache . $old_cache_name)) { + $this->addMessage( + "openFont: php file doesn't exist $fontcache$cache_name, creating it from the old format" + ); + $old_cache = file_get_contents($fontcache . $old_cache_name); + file_put_contents($fontcache . $cache_name, 'openFont($font); + } + } + + if (!isset($this->fonts[$font]) && file_exists($dir . $metrics_name)) { + // then rebuild the php_.afm file from the .afm file + $this->addMessage("openFont: build php file from $dir$metrics_name"); + $data = array(); + + // 20 => 'space' + $data['codeToName'] = array(); + + // Since we're not going to enable Unicode for the core fonts we need to use a font-based + // setting for Unicode support rather than a global setting. + $data['isUnicode'] = (strtolower(substr($metrics_name, -3)) !== 'afm'); + + $cidtogid = ''; + if ($data['isUnicode']) { + $cidtogid = str_pad('', 256 * 256 * 2, "\x00"); + } + + $file = file($dir . $metrics_name); + + foreach ($file as $rowA) { + $row = trim($rowA); + $pos = strpos($row, ' '); + + if ($pos) { + // then there must be some keyword + $key = substr($row, 0, $pos); + switch ($key) { + case 'FontName': + case 'FullName': + case 'FamilyName': + case 'PostScriptName': + case 'Weight': + case 'ItalicAngle': + case 'IsFixedPitch': + case 'CharacterSet': + case 'UnderlinePosition': + case 'UnderlineThickness': + case 'Version': + case 'EncodingScheme': + case 'CapHeight': + case 'XHeight': + case 'Ascender': + case 'Descender': + case 'StdHW': + case 'StdVW': + case 'StartCharMetrics': + case 'FontHeightOffset': // OAR - Added so we can offset the height calculation of a Windows font. Otherwise it's too big. + $data[$key] = trim(substr($row, $pos)); + break; + + case 'FontBBox': + $data[$key] = explode(' ', trim(substr($row, $pos))); + break; + + //C 39 ; WX 222 ; N quoteright ; B 53 463 157 718 ; + case 'C': // Found in AFM files + $bits = explode(';', trim($row)); + $dtmp = array(); + + foreach ($bits as $bit) { + $bits2 = explode(' ', trim($bit)); + if (mb_strlen($bits2[0], '8bit') == 0) { + continue; + } + + if (count($bits2) > 2) { + $dtmp[$bits2[0]] = array(); + for ($i = 1; $i < count($bits2); $i++) { + $dtmp[$bits2[0]][] = $bits2[$i]; + } + } else { + if (count($bits2) == 2) { + $dtmp[$bits2[0]] = $bits2[1]; + } + } + } + + $c = (int)$dtmp['C']; + $n = $dtmp['N']; + $width = floatval($dtmp['WX']); + + if ($c >= 0) { + if ($c != hexdec($n)) { + $data['codeToName'][$c] = $n; + } + $data['C'][$c] = $width; + } else { + $data['C'][$n] = $width; + } + + if (!isset($data['MissingWidth']) && $c == -1 && $n === '.notdef') { + $data['MissingWidth'] = $width; + } + + break; + + // U 827 ; WX 0 ; N squaresubnosp ; G 675 ; + case 'U': // Found in UFM files + if (!$data['isUnicode']) { + break; + } + + $bits = explode(';', trim($row)); + $dtmp = array(); + + foreach ($bits as $bit) { + $bits2 = explode(' ', trim($bit)); + if (mb_strlen($bits2[0], '8bit') === 0) { + continue; + } + + if (count($bits2) > 2) { + $dtmp[$bits2[0]] = array(); + for ($i = 1; $i < count($bits2); $i++) { + $dtmp[$bits2[0]][] = $bits2[$i]; + } + } else { + if (count($bits2) == 2) { + $dtmp[$bits2[0]] = $bits2[1]; + } + } + } + + $c = (int)$dtmp['U']; + $n = $dtmp['N']; + $glyph = $dtmp['G']; + $width = floatval($dtmp['WX']); + + if ($c >= 0) { + // Set values in CID to GID map + if ($c >= 0 && $c < 0xFFFF && $glyph) { + $cidtogid[$c * 2] = chr($glyph >> 8); + $cidtogid[$c * 2 + 1] = chr($glyph & 0xFF); + } + + if ($c != hexdec($n)) { + $data['codeToName'][$c] = $n; + } + $data['C'][$c] = $width; + } else { + $data['C'][$n] = $width; + } + + if (!isset($data['MissingWidth']) && $c == -1 && $n === '.notdef') { + $data['MissingWidth'] = $width; + } + + break; + + case 'KPX': + break; // don't include them as they are not used yet + //KPX Adieresis yacute -40 + $bits = explode(' ', trim($row)); + $data['KPX'][$bits[1]][$bits[2]] = $bits[3]; + break; + } + } + } + + if ($this->compressionReady && $this->options['compression']) { + // then implement ZLIB based compression on CIDtoGID string + $data['CIDtoGID_Compressed'] = true; + $cidtogid = gzcompress($cidtogid, 6); + } + $data['CIDtoGID'] = base64_encode($cidtogid); + $data['_version_'] = $this->fontcacheVersion; + $this->fonts[$font] = $data; + + //Because of potential trouble with php safe mode, expect that the folder already exists. + //If not existing, this will hit performance because of missing cached results. + if (is_dir(substr($fontcache, 0, -1)) && is_writable(substr($fontcache, 0, -1))) { + file_put_contents($fontcache . $cache_name, 'fonts[$font])) { + $this->addMessage("openFont: no font file found for $font. Do you need to run load_font.php?"); + } + + //pre_r($this->messages); + } + + /** + * if the font is not loaded then load it and make the required object + * else just make it the current font + * the encoding array can contain 'encoding'=> 'none','WinAnsiEncoding','MacRomanEncoding' or 'MacExpertEncoding' + * note that encoding='none' will need to be used for symbolic fonts + * and 'differences' => an array of mappings between numbers 0->255 and character names. + * + */ + function selectFont($fontName, $encoding = '', $set = true) + { + $ext = substr($fontName, -4); + if ($ext === '.afm' || $ext === '.ufm') { + $fontName = substr($fontName, 0, mb_strlen($fontName) - 4); + } + + if (!isset($this->fonts[$fontName])) { + $this->addMessage("selectFont: selecting - $fontName - $encoding, $set"); + + // load the file + $this->openFont($fontName); + + if (isset($this->fonts[$fontName])) { + $this->numObj++; + $this->numFonts++; + + $font = &$this->fonts[$fontName]; + + //$this->numFonts = md5($fontName); + $pos = strrpos($fontName, '/'); + // $dir = substr($fontName,0,$pos+1); + $name = substr($fontName, $pos + 1); + $options = array('name' => $name, 'fontFileName' => $fontName); + + if (is_array($encoding)) { + // then encoding and differences might be set + if (isset($encoding['encoding'])) { + $options['encoding'] = $encoding['encoding']; + } + + if (isset($encoding['differences'])) { + $options['differences'] = $encoding['differences']; + } + } else { + if (mb_strlen($encoding, '8bit')) { + // then perhaps only the encoding has been set + $options['encoding'] = $encoding; + } + } + + $fontObj = $this->numObj; + $this->o_font($this->numObj, 'new', $options); + $font['fontNum'] = $this->numFonts; + + // if this is a '.afm' font, and there is a '.pfa' file to go with it ( as there + // should be for all non-basic fonts), then load it into an object and put the + // references into the font object + $basefile = $fontName; + + $fbtype = ''; + if (file_exists("$basefile.pfb")) { + $fbtype = 'pfb'; + } else { + if (file_exists("$basefile.ttf")) { + $fbtype = 'ttf'; + } + } + + $fbfile = "$basefile.$fbtype"; + + // $pfbfile = substr($fontName,0,strlen($fontName)-4).'.pfb'; + // $ttffile = substr($fontName,0,strlen($fontName)-4).'.ttf'; + $this->addMessage('selectFont: checking for - ' . $fbfile); + + // OAR - I don't understand this old check + // if (substr($fontName, -4) === '.afm' && strlen($fbtype)) { + if ($fbtype) { + $adobeFontName = isset($font['PostScriptName']) ? $font['PostScriptName'] : $font['FontName']; + // $fontObj = $this->numObj; + $this->addMessage("selectFont: adding font file - $fbfile - $adobeFontName"); + + // find the array of font widths, and put that into an object. + $firstChar = -1; + $lastChar = 0; + $widths = array(); + $cid_widths = array(); + + foreach ($font['C'] as $num => $d) { + if (intval($num) > 0 || $num == '0') { + if (!$font['isUnicode']) { + // With Unicode, widths array isn't used + if ($lastChar > 0 && $num > $lastChar + 1) { + for ($i = $lastChar + 1; $i < $num; $i++) { + $widths[] = 0; + } + } + } + + $widths[] = $d; + + if ($font['isUnicode']) { + $cid_widths[$num] = $d; + } + + if ($firstChar == -1) { + $firstChar = $num; + } + + $lastChar = $num; + } + } + + // also need to adjust the widths for the differences array + if (isset($options['differences'])) { + foreach ($options['differences'] as $charNum => $charName) { + if ($charNum > $lastChar) { + if (!$font['isUnicode']) { + // With Unicode, widths array isn't used + for ($i = $lastChar + 1; $i <= $charNum; $i++) { + $widths[] = 0; + } + } + + $lastChar = $charNum; + } + + if (isset($font['C'][$charName])) { + $widths[$charNum - $firstChar] = $font['C'][$charName]; + if ($font['isUnicode']) { + $cid_widths[$charName] = $font['C'][$charName]; + } + } + } + } + + if ($font['isUnicode']) { + $font['CIDWidths'] = $cid_widths; + } + + $this->addMessage('selectFont: FirstChar = ' . $firstChar); + $this->addMessage('selectFont: LastChar = ' . $lastChar); + + $widthid = -1; + + if (!$font['isUnicode']) { + // With Unicode, widths array isn't used + + $this->numObj++; + $this->o_contents($this->numObj, 'new', 'raw'); + $this->objects[$this->numObj]['c'] .= '[' . implode(' ', $widths) . ']'; + $widthid = $this->numObj; + } + + $missing_width = 500; + $stemV = 70; + + if (isset($font['MissingWidth'])) { + $missing_width = $font['MissingWidth']; + } + if (isset($font['StdVW'])) { + $stemV = $font['StdVW']; + } else { + if (isset($font['Weight']) && preg_match('!(bold|black)!i', $font['Weight'])) { + $stemV = 120; + } + } + + // load the pfb file, and put that into an object too. + // note that pdf supports only binary format type 1 font files, though there is a + // simple utility to convert them from pfa to pfb. + // FIXME: should we move font subset creation to CPDF::output? See notes in issue #750. + if (!$this->isUnicode || $fbtype !== 'ttf' || empty($this->stringSubsets)) { + $data = file_get_contents($fbfile); + } else { + $this->stringSubsets[$fontName][] = 32; // Force space if not in yet + + $subset = $this->stringSubsets[$fontName]; + sort($subset); + + // Load font + $font_obj = Font::load($fbfile); + $font_obj->parse(); + + // Define subset + $font_obj->setSubset($subset); + $font_obj->reduce(); + + // Write new font + $tmp_name = "$fbfile.tmp." . uniqid(); + $font_obj->open($tmp_name, Font_Binary_Stream::modeWrite); + $font_obj->encode(array("OS/2")); + $font_obj->close(); + + // Parse the new font to get cid2gid and widths + $font_obj = Font::load($tmp_name); + + // Find Unicode char map table + $subtable = null; + foreach ($font_obj->getData("cmap", "subtables") as $_subtable) { + if ($_subtable["platformID"] == 0 || $_subtable["platformID"] == 3 && $_subtable["platformSpecificID"] == 1) { + $subtable = $_subtable; + break; + } + } + + if ($subtable) { + $glyphIndexArray = $subtable["glyphIndexArray"]; + $hmtx = $font_obj->getData("hmtx"); + + unset($glyphIndexArray[0xFFFF]); + + $cidtogid = str_pad('', max(array_keys($glyphIndexArray)) * 2 + 1, "\x00"); + $font['CIDWidths'] = array(); + foreach ($glyphIndexArray as $cid => $gid) { + if ($cid >= 0 && $cid < 0xFFFF && $gid) { + $cidtogid[$cid * 2] = chr($gid >> 8); + $cidtogid[$cid * 2 + 1] = chr($gid & 0xFF); + } + + $width = $font_obj->normalizeFUnit(isset($hmtx[$gid]) ? $hmtx[$gid][0] : $hmtx[0][0]); + $font['CIDWidths'][$cid] = $width; + } + + $font['CIDtoGID'] = base64_encode(gzcompress($cidtogid)); + $font['CIDtoGID_Compressed'] = true; + + $data = file_get_contents($tmp_name); + } else { + $data = file_get_contents($fbfile); + } + + $font_obj->close(); + unlink($tmp_name); + } + + // create the font descriptor + $this->numObj++; + $fontDescriptorId = $this->numObj; + + $this->numObj++; + $pfbid = $this->numObj; + + // determine flags (more than a little flakey, hopefully will not matter much) + $flags = 0; + + if ($font['ItalicAngle'] != 0) { + $flags += pow(2, 6); + } + + if ($font['IsFixedPitch'] === 'true') { + $flags += 1; + } + + $flags += pow(2, 5); // assume non-sybolic + $list = array( + 'Ascent' => 'Ascender', + 'CapHeight' => 'CapHeight', + 'MissingWidth' => 'MissingWidth', + 'Descent' => 'Descender', + 'FontBBox' => 'FontBBox', + 'ItalicAngle' => 'ItalicAngle' + ); + $fdopt = array( + 'Flags' => $flags, + 'FontName' => $adobeFontName, + 'StemV' => $stemV + ); + + foreach ($list as $k => $v) { + if (isset($font[$v])) { + $fdopt[$k] = $font[$v]; + } + } + + if ($fbtype === 'pfb') { + $fdopt['FontFile'] = $pfbid; + } else { + if ($fbtype === 'ttf') { + $fdopt['FontFile2'] = $pfbid; + } + } + + $this->o_fontDescriptor($fontDescriptorId, 'new', $fdopt); + + // embed the font program + $this->o_contents($this->numObj, 'new'); + $this->objects[$pfbid]['c'] .= $data; + + // determine the cruicial lengths within this file + if ($fbtype === 'pfb') { + $l1 = strpos($data, 'eexec') + 6; + $l2 = strpos($data, '00000000') - $l1; + $l3 = mb_strlen($data, '8bit') - $l2 - $l1; + $this->o_contents( + $this->numObj, + 'add', + array('Length1' => $l1, 'Length2' => $l2, 'Length3' => $l3) + ); + } else { + if ($fbtype == 'ttf') { + $l1 = mb_strlen($data, '8bit'); + $this->o_contents($this->numObj, 'add', array('Length1' => $l1)); + } + } + + // tell the font object about all this new stuff + $tmp = array( + 'BaseFont' => $adobeFontName, + 'MissingWidth' => $missing_width, + 'Widths' => $widthid, + 'FirstChar' => $firstChar, + 'LastChar' => $lastChar, + 'FontDescriptor' => $fontDescriptorId + ); + + if ($fbtype === 'ttf') { + $tmp['SubType'] = 'TrueType'; + } + + $this->addMessage("adding extra info to font.($fontObj)"); + + foreach ($tmp as $fk => $fv) { + $this->addMessage("$fk : $fv"); + } + + $this->o_font($fontObj, 'add', $tmp); + } else { + $this->addMessage( + 'selectFont: pfb or ttf file not found, ok if this is one of the 14 standard fonts' + ); + } + + // also set the differences here, note that this means that these will take effect only the + //first time that a font is selected, else they are ignored + if (isset($options['differences'])) { + $font['differences'] = $options['differences']; + } + } + } + + if ($set && isset($this->fonts[$fontName])) { + // so if for some reason the font was not set in the last one then it will not be selected + $this->currentBaseFont = $fontName; + + // the next lines mean that if a new font is selected, then the current text state will be + // applied to it as well. + $this->currentFont = $this->currentBaseFont; + $this->currentFontNum = $this->fonts[$this->currentFont]['fontNum']; + + //$this->setCurrentFont(); + } + + return $this->currentFontNum; + //return $this->numObj; + } + + /** + * sets up the current font, based on the font families, and the current text state + * note that this system is quite flexible, a bold-italic font can be completely different to a + * italic-bold font, and even bold-bold will have to be defined within the family to have meaning + * This function is to be called whenever the currentTextState is changed, it will update + * the currentFont setting to whatever the appropriatte family one is. + * If the user calls selectFont themselves then that will reset the currentBaseFont, and the currentFont + * This function will change the currentFont to whatever it should be, but will not change the + * currentBaseFont. + */ + private function setCurrentFont() + { + // if (strlen($this->currentBaseFont) == 0){ + // // then assume an initial font + // $this->selectFont($this->defaultFont); + // } + // $cf = substr($this->currentBaseFont,strrpos($this->currentBaseFont,'/')+1); + // if (strlen($this->currentTextState) + // && isset($this->fontFamilies[$cf]) + // && isset($this->fontFamilies[$cf][$this->currentTextState])){ + // // then we are in some state or another + // // and this font has a family, and the current setting exists within it + // // select the font, then return it + // $nf = substr($this->currentBaseFont,0,strrpos($this->currentBaseFont,'/')+1).$this->fontFamilies[$cf][$this->currentTextState]; + // $this->selectFont($nf,'',0); + // $this->currentFont = $nf; + // $this->currentFontNum = $this->fonts[$nf]['fontNum']; + // } else { + // // the this font must not have the right family member for the current state + // // simply assume the base font + $this->currentFont = $this->currentBaseFont; + $this->currentFontNum = $this->fonts[$this->currentFont]['fontNum']; + // } + } + + /** + * function for the user to find out what the ID is of the first page that was created during + * startup - useful if they wish to add something to it later. + */ + function getFirstPageId() + { + return $this->firstPageId; + } + + /** + * add content to the currently active object + */ + private function addContent($content) + { + $this->objects[$this->currentContents]['c'] .= $content; + } + + /** + * sets the color for fill operations + */ + function setColor($color, $force = false) + { + $new_color = array($color[0], $color[1], $color[2], isset($color[3]) ? $color[3] : null); + + if (!$force && $this->currentColor == $new_color) { + return; + } + + if (isset($new_color[3])) { + //$this->currentColor = $new_color; + $this->addContent(vsprintf("\n%.3F %.3F %.3F %.3F k", $this->currentColor)); + } else { + if (isset($new_color[2])) { + //$this->currentColor = $new_color; + $this->addContent(vsprintf("\n%.3F %.3F %.3F rg", $new_color)); + } + } + } + + /** + * sets the color for fill operations + */ + function setFillRule($fillRule) + { + if (!in_array($fillRule, array("nonzero", "evenodd"))) { + return; + } + + $this->fillRule = $fillRule; + } + + /** + * sets the color for stroke operations + */ + function setStrokeColor($color, $force = false) + { + $new_color = array($color[0], $color[1], $color[2], isset($color[3]) ? $color[3] : null); + + if (!$force && $this->currentStrokeColor == $new_color) { + return; + } + + if (isset($new_color[3])) { + //$this->currentStrokeColor = $new_color; + $this->addContent(vsprintf("\n%.3F %.3F %.3F %.3F K", $this->currentStrokeColor)); + } else { + if (isset($new_color[2])) { + //$this->currentStrokeColor = $new_color; + $this->addContent(vsprintf("\n%.3F %.3F %.3F RG", $new_color)); + } + } + } + + /** + * Set the graphics state for compositions + */ + function setGraphicsState($parameters) + { + // Create a new graphics state object + // FIXME: should actually keep track of states that have already been created... + $this->numObj++; + $this->o_extGState($this->numObj, 'new', $parameters); + $this->addContent("\n/GS$this->numStates gs"); + } + + /** + * Set current blend mode & opacity for lines. + * + * Valid blend modes are: + * + * Normal, Multiply, Screen, Overlay, Darken, Lighten, + * ColorDogde, ColorBurn, HardLight, SoftLight, Difference, + * Exclusion + * + * @param string $mode the blend mode to use + * @param float $opacity 0.0 fully transparent, 1.0 fully opaque + */ + function setLineTransparency($mode, $opacity) + { + static $blend_modes = array( + "Normal", + "Multiply", + "Screen", + "Overlay", + "Darken", + "Lighten", + "ColorDogde", + "ColorBurn", + "HardLight", + "SoftLight", + "Difference", + "Exclusion" + ); + + if (!in_array($mode, $blend_modes)) { + $mode = "Normal"; + } + + // Only create a new graphics state if required + if ($mode === $this->currentLineTransparency["mode"] && + $opacity == $this->currentLineTransparency["opacity"] + ) { + return; + } + + $this->currentLineTransparency["mode"] = $mode; + $this->currentLineTransparency["opacity"] = $opacity; + + $options = array( + "BM" => "/$mode", + "CA" => (float)$opacity + ); + + $this->setGraphicsState($options); + } + + /** + * Set current blend mode & opacity for filled objects. + * + * Valid blend modes are: + * + * Normal, Multiply, Screen, Overlay, Darken, Lighten, + * ColorDogde, ColorBurn, HardLight, SoftLight, Difference, + * Exclusion + * + * @param string $mode the blend mode to use + * @param float $opacity 0.0 fully transparent, 1.0 fully opaque + */ + function setFillTransparency($mode, $opacity) + { + static $blend_modes = array( + "Normal", + "Multiply", + "Screen", + "Overlay", + "Darken", + "Lighten", + "ColorDogde", + "ColorBurn", + "HardLight", + "SoftLight", + "Difference", + "Exclusion" + ); + + if (!in_array($mode, $blend_modes)) { + $mode = "Normal"; + } + + if ($mode === $this->currentFillTransparency["mode"] && + $opacity == $this->currentFillTransparency["opacity"] + ) { + return; + } + + $this->currentFillTransparency["mode"] = $mode; + $this->currentFillTransparency["opacity"] = $opacity; + + $options = array( + "BM" => "/$mode", + "ca" => (float)$opacity, + ); + + $this->setGraphicsState($options); + } + + function lineTo($x, $y) + { + $this->addContent(sprintf("\n%.3F %.3F l", $x, $y)); + } + + function moveTo($x, $y) + { + $this->addContent(sprintf("\n%.3F %.3F m", $x, $y)); + } + + /** + * draw a bezier curve based on 4 control points + */ + function curveTo($x1, $y1, $x2, $y2, $x3, $y3) + { + $this->addContent(sprintf("\n%.3F %.3F %.3F %.3F %.3F %.3F c", $x1, $y1, $x2, $y2, $x3, $y3)); + } + + /** + * draw a bezier curve based on 4 control points + */ + function quadTo($cpx, $cpy, $x, $y) + { + $this->addContent(sprintf("\n%.3F %.3F %.3F %.3F v", $cpx, $cpy, $x, $y)); + } + + function closePath() + { + $this->addContent(' h'); + } + + function endPath() + { + $this->addContent(' n'); + } + + /** + * draw an ellipse + * note that the part and filled ellipse are just special cases of this function + * + * draws an ellipse in the current line style + * centered at $x0,$y0, radii $r1,$r2 + * if $r2 is not set, then a circle is drawn + * from $astart to $afinish, measured in degrees, running anti-clockwise from the right hand side of the ellipse. + * nSeg is not allowed to be less than 2, as this will simply draw a line (and will even draw a + * pretty crappy shape at 2, as we are approximating with bezier curves. + */ + function ellipse( + $x0, + $y0, + $r1, + $r2 = 0, + $angle = 0, + $nSeg = 8, + $astart = 0, + $afinish = 360, + $close = true, + $fill = false, + $stroke = true, + $incomplete = false + ) { + if ($r1 == 0) { + return; + } + + if ($r2 == 0) { + $r2 = $r1; + } + + if ($nSeg < 2) { + $nSeg = 2; + } + + $astart = deg2rad((float)$astart); + $afinish = deg2rad((float)$afinish); + $totalAngle = $afinish - $astart; + + $dt = $totalAngle / $nSeg; + $dtm = $dt / 3; + + if ($angle != 0) { + $a = -1 * deg2rad((float)$angle); + + $this->addContent( + sprintf("\n q %.3F %.3F %.3F %.3F %.3F %.3F cm", cos($a), -sin($a), sin($a), cos($a), $x0, $y0) + ); + + $x0 = 0; + $y0 = 0; + } + + $t1 = $astart; + $a0 = $x0 + $r1 * cos($t1); + $b0 = $y0 + $r2 * sin($t1); + $c0 = -$r1 * sin($t1); + $d0 = $r2 * cos($t1); + + if (!$incomplete) { + $this->addContent(sprintf("\n%.3F %.3F m ", $a0, $b0)); + } + + for ($i = 1; $i <= $nSeg; $i++) { + // draw this bit of the total curve + $t1 = $i * $dt + $astart; + $a1 = $x0 + $r1 * cos($t1); + $b1 = $y0 + $r2 * sin($t1); + $c1 = -$r1 * sin($t1); + $d1 = $r2 * cos($t1); + + $this->addContent( + sprintf( + "\n%.3F %.3F %.3F %.3F %.3F %.3F c", + ($a0 + $c0 * $dtm), + ($b0 + $d0 * $dtm), + ($a1 - $c1 * $dtm), + ($b1 - $d1 * $dtm), + $a1, + $b1 + ) + ); + + $a0 = $a1; + $b0 = $b1; + $c0 = $c1; + $d0 = $d1; + } + + if (!$incomplete) { + if ($fill) { + $this->addContent(' f'); + } + + if ($stroke) { + if ($close) { + $this->addContent(' s'); // small 's' signifies closing the path as well + } else { + $this->addContent(' S'); + } + } + } + + if ($angle != 0) { + $this->addContent(' Q'); + } + } + + /** + * this sets the line drawing style. + * width, is the thickness of the line in user units + * cap is the type of cap to put on the line, values can be 'butt','round','square' + * where the diffference between 'square' and 'butt' is that 'square' projects a flat end past the + * end of the line. + * join can be 'miter', 'round', 'bevel' + * dash is an array which sets the dash pattern, is a series of length values, which are the lengths of the + * on and off dashes. + * (2) represents 2 on, 2 off, 2 on , 2 off ... + * (2,1) is 2 on, 1 off, 2 on, 1 off.. etc + * phase is a modifier on the dash pattern which is used to shift the point at which the pattern starts. + */ + function setLineStyle($width = 1, $cap = '', $join = '', $dash = '', $phase = 0) + { + // this is quite inefficient in that it sets all the parameters whenever 1 is changed, but will fix another day + $string = ''; + + if ($width > 0) { + $string .= sprintf("%.3F w", $width); + } + + $ca = array('butt' => 0, 'round' => 1, 'square' => 2); + + if (isset($ca[$cap])) { + $string .= " $ca[$cap] J"; + } + + $ja = array('miter' => 0, 'round' => 1, 'bevel' => 2); + + if (isset($ja[$join])) { + $string .= " $ja[$join] j"; + } + + if (is_array($dash)) { + $string .= ' [ ' . implode(' ', $dash) . " ] $phase d"; + } + + $this->currentLineStyle = $string; + $this->addContent("\n$string"); + } + + function rect($x1, $y1, $width, $height) + { + $this->addContent(sprintf("\n%.3F %.3F %.3F %.3F re", $x1, $y1, $width, $height)); + } + + function stroke() + { + $this->addContent("\nS"); + } + + function fill() + { + $this->addContent("\nf".($this->fillRule === "evenodd" ? "*" : "")); + } + + function fillStroke() + { + $this->addContent("\nb".($this->fillRule === "evenodd" ? "*" : "")); + } + + /** + * save the current graphic state + */ + function save() + { + $this->addContent("\nq"); + } + + /** + * restore the last graphic state + */ + function restore() + { + $this->addContent("\nQ"); + } + + /** + * scale + * + * @param float $s_x scaling factor for width as percent + * @param float $s_y scaling factor for height as percent + * @param float $x Origin abscisse + * @param float $y Origin ordinate + */ + function scale($s_x, $s_y, $x, $y) + { + $y = $this->currentPageSize["height"] - $y; + + $tm = array( + $s_x, 0, + 0, $s_y, + $x * (1 - $s_x), $y * (1 - $s_y) + ); + + $this->transform($tm); + } + + /** + * translate + * + * @param float $t_x movement to the right + * @param float $t_y movement to the bottom + */ + function translate($t_x, $t_y) + { + $tm = array( + 1, 0, + 0, 1, + $t_x, -$t_y + ); + + $this->transform($tm); + } + + /** + * rotate + * + * @param float $angle angle in degrees for counter-clockwise rotation + * @param float $x Origin abscisse + * @param float $y Origin ordinate + */ + function rotate($angle, $x, $y) + { + $y = $this->currentPageSize["height"] - $y; + + $a = deg2rad($angle); + $cos_a = cos($a); + $sin_a = sin($a); + + $tm = array( + $cos_a, -$sin_a, + $sin_a, $cos_a, + $x - $sin_a * $y - $cos_a * $x, $y - $cos_a * $y + $sin_a * $x, + ); + + $this->transform($tm); + } + + /** + * skew + * + * @param float $angle_x + * @param float $angle_y + * @param float $x Origin abscisse + * @param float $y Origin ordinate + */ + function skew($angle_x, $angle_y, $x, $y) + { + $y = $this->currentPageSize["height"] - $y; + + $tan_x = tan(deg2rad($angle_x)); + $tan_y = tan(deg2rad($angle_y)); + + $tm = array( + 1, -$tan_y, + -$tan_x, 1, + $tan_x * $y, $tan_y * $x, + ); + + $this->transform($tm); + } + + /** + * apply graphic transformations + * + * @param array $tm transformation matrix + */ + function transform($tm) + { + $this->addContent(vsprintf("\n %.3F %.3F %.3F %.3F %.3F %.3F cm", $tm)); + } + + /** + * add a new page to the document + * this also makes the new page the current active object + */ + function newPage($insert = 0, $id = 0, $pos = 'after') + { + // if there is a state saved, then go up the stack closing them + // then on the new page, re-open them with the right setings + + if ($this->nStateStack) { + for ($i = $this->nStateStack; $i >= 1; $i--) { + $this->restoreState($i); + } + } + + $this->numObj++; + + if ($insert) { + // the id from the ezPdf class is the id of the contents of the page, not the page object itself + // query that object to find the parent + $rid = $this->objects[$id]['onPage']; + $opt = array('rid' => $rid, 'pos' => $pos); + $this->o_page($this->numObj, 'new', $opt); + } else { + $this->o_page($this->numObj, 'new'); + } + + // if there is a stack saved, then put that onto the page + if ($this->nStateStack) { + for ($i = 1; $i <= $this->nStateStack; $i++) { + $this->saveState($i); + } + } + + // and if there has been a stroke or fill color set, then transfer them + if (isset($this->currentColor)) { + $this->setColor($this->currentColor, true); + } + + if (isset($this->currentStrokeColor)) { + $this->setStrokeColor($this->currentStrokeColor, true); + } + + // if there is a line style set, then put this in too + if (mb_strlen($this->currentLineStyle, '8bit')) { + $this->addContent("\n$this->currentLineStyle"); + } + + // the call to the o_page object set currentContents to the present page, so this can be returned as the page id + return $this->currentContents; + } + + /** + * output the pdf code, streaming it to the browser + * the relevant headers are set so that hopefully the browser will recognise it + */ + function stream($options = '') + { + // setting the options allows the adjustment of the headers + // values at the moment are: + // 'Content-Disposition' => 'filename' - sets the filename, though not too sure how well this will + // work as in my trial the browser seems to use the filename of the php file with .pdf on the end + // 'Accept-Ranges' => 1 or 0 - if this is not set to 1, then this header is not included, off by default + // this header seems to have caused some problems despite tha fact that it is supposed to solve + // them, so I am leaving it off by default. + // 'compress' = > 1 or 0 - apply content stream compression, this is on (1) by default + // 'Attachment' => 1 or 0 - if 1, force the browser to open a download dialog + if (!is_array($options)) { + $options = array(); + } + + if (headers_sent()) { + die("Unable to stream pdf: headers already sent"); + } + + $debug = empty($options['compression']); + $tmp = ltrim($this->output($debug)); + + header("Cache-Control: private"); + header("Content-type: application/pdf"); + + //FIXME: I don't know that this is sufficient for determining content length (i.e. what about transport compression?) + header("Content-Length: " . mb_strlen($tmp, '8bit')); + $fileName = (isset($options['Content-Disposition']) ? $options['Content-Disposition'] : 'file.pdf'); + + if (!isset($options["Attachment"])) { + $options["Attachment"] = true; + } + + $attachment = $options["Attachment"] ? "attachment" : "inline"; + + // detect the character encoding of the incoming file + $encoding = mb_detect_encoding($fileName); + $fallbackfilename = mb_convert_encoding($fileName, "ISO-8859-1", $encoding); + $encodedfallbackfilename = rawurlencode($fallbackfilename); + $encodedfilename = rawurlencode($fileName); + + header( + "Content-Disposition: $attachment; filename=" . $encodedfallbackfilename . "; filename*=UTF-8''$encodedfilename" + ); + + if (isset($options['Accept-Ranges']) && $options['Accept-Ranges'] == 1) { + //FIXME: Is this the correct value ... spec says 1#range-unit + header("Accept-Ranges: " . mb_strlen($tmp, '8bit')); + } + + echo $tmp; + flush(); + } + + /** + * return the height in units of the current font in the given size + */ + function getFontHeight($size) + { + if (!$this->numFonts) { + $this->selectFont($this->defaultFont); + } + + $font = $this->fonts[$this->currentFont]; + + // for the current font, and the given size, what is the height of the font in user units + if (isset($font['Ascender']) && isset($font['Descender'])) { + $h = $font['Ascender'] - $font['Descender']; + } else { + $h = $font['FontBBox'][3] - $font['FontBBox'][1]; + } + + // have to adjust by a font offset for Windows fonts. unfortunately it looks like + // the bounding box calculations are wrong and I don't know why. + if (isset($font['FontHeightOffset'])) { + // For CourierNew from Windows this needs to be -646 to match the + // Adobe native Courier font. + // + // For FreeMono from GNU this needs to be -337 to match the + // Courier font. + // + // Both have been added manually to the .afm and .ufm files. + $h += (int)$font['FontHeightOffset']; + } + + return $size * $h / 1000; + } + + function getFontXHeight($size) + { + if (!$this->numFonts) { + $this->selectFont($this->defaultFont); + } + + $font = $this->fonts[$this->currentFont]; + + // for the current font, and the given size, what is the height of the font in user units + if (isset($font['XHeight'])) { + $xh = $font['Ascender'] - $font['Descender']; + } else { + $xh = $this->getFontHeight($size) / 2; + } + + return $size * $xh / 1000; + } + + /** + * return the font descender, this will normally return a negative number + * if you add this number to the baseline, you get the level of the bottom of the font + * it is in the pdf user units + */ + function getFontDescender($size) + { + // note that this will most likely return a negative value + if (!$this->numFonts) { + $this->selectFont($this->defaultFont); + } + + //$h = $this->fonts[$this->currentFont]['FontBBox'][1]; + $h = $this->fonts[$this->currentFont]['Descender']; + + return $size * $h / 1000; + } + + /** + * filter the text, this is applied to all text just before being inserted into the pdf document + * it escapes the various things that need to be escaped, and so on + * + * @access private + */ + function filterText($text, $bom = true, $convert_encoding = true) + { + if (!$this->numFonts) { + $this->selectFont($this->defaultFont); + } + + if ($convert_encoding) { + $cf = $this->currentFont; + if (isset($this->fonts[$cf]) && $this->fonts[$cf]['isUnicode']) { + //$text = html_entity_decode($text, ENT_QUOTES, 'UTF-8'); + $text = $this->utf8toUtf16BE($text, $bom); + } else { + //$text = html_entity_decode($text, ENT_QUOTES); + $text = mb_convert_encoding($text, self::$targetEncoding, 'UTF-8'); + } + } + + // the chr(13) substitution fixes a bug seen in TCPDF (bug #1421290) + return strtr($text, array(')' => '\\)', '(' => '\\(', '\\' => '\\\\', chr(13) => '\r')); + } + + /** + * given a start position and information about how text is to be laid out, calculate where + * on the page the text will end + */ + private function getTextPosition($x, $y, $angle, $size, $wa, $text) + { + // given this information return an array containing x and y for the end position as elements 0 and 1 + $w = $this->getTextWidth($size, $text); + + // need to adjust for the number of spaces in this text + $words = explode(' ', $text); + $nspaces = count($words) - 1; + $w += $wa * $nspaces; + $a = deg2rad((float)$angle); + + return array(cos($a) * $w + $x, -sin($a) * $w + $y); + } + + /** + * Callback method used by smallCaps + * + * @param array $matches + * + * @return string + */ + function toUpper($matches) + { + return mb_strtoupper($matches[0]); + } + + function concatMatches($matches) + { + $str = ""; + foreach ($matches as $match) { + $str .= $match[0]; + } + + return $str; + } + + /** + * add text to the document, at a specified location, size and angle on the page + */ + function registerText($font, $text) + { + if (!$this->isUnicode || in_array(mb_strtolower(basename($font)), self::$coreFonts)) { + return; + } + + if (!isset($this->stringSubsets[$font])) { + $this->stringSubsets[$font] = array(); + } + + $this->stringSubsets[$font] = array_unique( + array_merge($this->stringSubsets[$font], $this->utf8toCodePointsArray($text)) + ); + } + + /** + * add text to the document, at a specified location, size and angle on the page + */ + function addText($x, $y, $size, $text, $angle = 0, $wordSpaceAdjust = 0, $charSpaceAdjust = 0, $smallCaps = false) + { + if (!$this->numFonts) { + $this->selectFont($this->defaultFont); + } + + $text = str_replace(array("\r", "\n"), "", $text); + + if ($smallCaps) { + preg_match_all("/(\P{Ll}+)/u", $text, $matches, PREG_SET_ORDER); + $lower = $this->concatMatches($matches); + d($lower); + + preg_match_all("/(\p{Ll}+)/u", $text, $matches, PREG_SET_ORDER); + $other = $this->concatMatches($matches); + d($other); + + //$text = preg_replace_callback("/\p{Ll}/u", array($this, "toUpper"), $text); + } + + // if there are any open callbacks, then they should be called, to show the start of the line + if ($this->nCallback > 0) { + for ($i = $this->nCallback; $i > 0; $i--) { + // call each function + $info = array( + 'x' => $x, + 'y' => $y, + 'angle' => $angle, + 'status' => 'sol', + 'p' => $this->callback[$i]['p'], + 'nCallback' => $this->callback[$i]['nCallback'], + 'height' => $this->callback[$i]['height'], + 'descender' => $this->callback[$i]['descender'] + ); + + $func = $this->callback[$i]['f']; + $this->$func($info); + } + } + + if ($angle == 0) { + $this->addContent(sprintf("\nBT %.3F %.3F Td", $x, $y)); + } else { + $a = deg2rad((float)$angle); + $this->addContent( + sprintf("\nBT %.3F %.3F %.3F %.3F %.3F %.3F Tm", cos($a), -sin($a), sin($a), cos($a), $x, $y) + ); + } + + if ($wordSpaceAdjust != 0 || $wordSpaceAdjust != $this->wordSpaceAdjust) { + $this->wordSpaceAdjust = $wordSpaceAdjust; + $this->addContent(sprintf(" %.3F Tw", $wordSpaceAdjust)); + } + + if ($charSpaceAdjust != 0 || $charSpaceAdjust != $this->charSpaceAdjust) { + $this->charSpaceAdjust = $charSpaceAdjust; + $this->addContent(sprintf(" %.3F Tc", $charSpaceAdjust)); + } + + $len = mb_strlen($text); + $start = 0; + + if ($start < $len) { + $part = $text; // OAR - Don't need this anymore, given that $start always equals zero. substr($text, $start); + $place_text = $this->filterText($part, false); + // modify unicode text so that extra word spacing is manually implemented (bug #) + $cf = $this->currentFont; + if ($this->fonts[$cf]['isUnicode'] && $wordSpaceAdjust != 0) { + $space_scale = 1000 / $size; + //$place_text = str_replace(' ', ') ( ) '.($this->getTextWidth($size, chr(32), $wordSpaceAdjust)*-75).' (', $place_text); + $place_text = str_replace(' ', ' ) ' . (-round($space_scale * $wordSpaceAdjust)) . ' (', $place_text); + } + $this->addContent(" /F$this->currentFontNum " . sprintf('%.1F Tf ', $size)); + $this->addContent(" [($place_text)] TJ"); + } + + $this->addContent(' ET'); + + // if there are any open callbacks, then they should be called, to show the end of the line + if ($this->nCallback > 0) { + for ($i = $this->nCallback; $i > 0; $i--) { + // call each function + $tmp = $this->getTextPosition($x, $y, $angle, $size, $wordSpaceAdjust, $text); + $info = array( + 'x' => $tmp[0], + 'y' => $tmp[1], + 'angle' => $angle, + 'status' => 'eol', + 'p' => $this->callback[$i]['p'], + 'nCallback' => $this->callback[$i]['nCallback'], + 'height' => $this->callback[$i]['height'], + 'descender' => $this->callback[$i]['descender'] + ); + $func = $this->callback[$i]['f']; + $this->$func($info); + } + } + } + + /** + * calculate how wide a given text string will be on a page, at a given size. + * this can be called externally, but is also used by the other class functions + */ + function getTextWidth($size, $text, $word_spacing = 0, $char_spacing = 0) + { + static $ord_cache = array(); + + // this function should not change any of the settings, though it will need to + // track any directives which change during calculation, so copy them at the start + // and put them back at the end. + $store_currentTextState = $this->currentTextState; + + if (!$this->numFonts) { + $this->selectFont($this->defaultFont); + } + + $text = str_replace(array("\r", "\n"), "", $text); + + // converts a number or a float to a string so it can get the width + $text = "$text"; + + // hmm, this is where it all starts to get tricky - use the font information to + // calculate the width of each character, add them up and convert to user units + $w = 0; + $cf = $this->currentFont; + $current_font = $this->fonts[$cf]; + $space_scale = 1000 / ($size > 0 ? $size : 1); + $n_spaces = 0; + + if ($current_font['isUnicode']) { + // for Unicode, use the code points array to calculate width rather + // than just the string itself + $unicode = $this->utf8toCodePointsArray($text); + + foreach ($unicode as $char) { + // check if we have to replace character + if (isset($current_font['differences'][$char])) { + $char = $current_font['differences'][$char]; + } + + if (isset($current_font['C'][$char])) { + $char_width = $current_font['C'][$char]; + + // add the character width + $w += $char_width; + + // add additional padding for space + if (isset($current_font['codeToName'][$char]) && $current_font['codeToName'][$char] === 'space') { // Space + $w += $word_spacing * $space_scale; + $n_spaces++; + } + } + } + + // add additionnal char spacing + if ($char_spacing != 0) { + $w += $char_spacing * $space_scale * (count($unicode) + $n_spaces); + } + + } else { + // If CPDF is in Unicode mode but the current font does not support Unicode we need to convert the character set to Windows-1252 + if ($this->isUnicode) { + $text = mb_convert_encoding($text, 'Windows-1252', 'UTF-8'); + } + + $len = mb_strlen($text, 'Windows-1252'); + + for ($i = 0; $i < $len; $i++) { + $c = $text[$i]; + $char = isset($ord_cache[$c]) ? $ord_cache[$c] : ($ord_cache[$c] = ord($c)); + + // check if we have to replace character + if (isset($current_font['differences'][$char])) { + $char = $current_font['differences'][$char]; + } + + if (isset($current_font['C'][$char])) { + $char_width = $current_font['C'][$char]; + + // add the character width + $w += $char_width; + + // add additional padding for space + if (isset($current_font['codeToName'][$char]) && $current_font['codeToName'][$char] === 'space') { // Space + $w += $word_spacing * $space_scale; + $n_spaces++; + } + } + } + + // add additionnal char spacing + if ($char_spacing != 0) { + $w += $char_spacing * $space_scale * ($len + $n_spaces); + } + } + + $this->currentTextState = $store_currentTextState; + $this->setCurrentFont(); + + return $w * $size / 1000; + } + + /** + * this will be called at a new page to return the state to what it was on the + * end of the previous page, before the stack was closed down + * This is to get around not being able to have open 'q' across pages + * + */ + function saveState($pageEnd = 0) + { + if ($pageEnd) { + // this will be called at a new page to return the state to what it was on the + // end of the previous page, before the stack was closed down + // This is to get around not being able to have open 'q' across pages + $opt = $this->stateStack[$pageEnd]; + // ok to use this as stack starts numbering at 1 + $this->setColor($opt['col'], true); + $this->setStrokeColor($opt['str'], true); + $this->addContent("\n" . $opt['lin']); + // $this->currentLineStyle = $opt['lin']; + } else { + $this->nStateStack++; + $this->stateStack[$this->nStateStack] = array( + 'col' => $this->currentColor, + 'str' => $this->currentStrokeColor, + 'lin' => $this->currentLineStyle + ); + } + + $this->save(); + } + + /** + * restore a previously saved state + */ + function restoreState($pageEnd = 0) + { + if (!$pageEnd) { + $n = $this->nStateStack; + $this->currentColor = $this->stateStack[$n]['col']; + $this->currentStrokeColor = $this->stateStack[$n]['str']; + $this->addContent("\n" . $this->stateStack[$n]['lin']); + $this->currentLineStyle = $this->stateStack[$n]['lin']; + $this->stateStack[$n] = null; + unset($this->stateStack[$n]); + $this->nStateStack--; + } + + $this->restore(); + } + + /** + * make a loose object, the output will go into this object, until it is closed, then will revert to + * the current one. + * this object will not appear until it is included within a page. + * the function will return the object number + */ + function openObject() + { + $this->nStack++; + $this->stack[$this->nStack] = array('c' => $this->currentContents, 'p' => $this->currentPage); + // add a new object of the content type, to hold the data flow + $this->numObj++; + $this->o_contents($this->numObj, 'new'); + $this->currentContents = $this->numObj; + $this->looseObjects[$this->numObj] = 1; + + return $this->numObj; + } + + /** + * open an existing object for editing + */ + function reopenObject($id) + { + $this->nStack++; + $this->stack[$this->nStack] = array('c' => $this->currentContents, 'p' => $this->currentPage); + $this->currentContents = $id; + + // also if this object is the primary contents for a page, then set the current page to its parent + if (isset($this->objects[$id]['onPage'])) { + $this->currentPage = $this->objects[$id]['onPage']; + } + } + + /** + * close an object + */ + function closeObject() + { + // close the object, as long as there was one open in the first place, which will be indicated by + // an objectId on the stack. + if ($this->nStack > 0) { + $this->currentContents = $this->stack[$this->nStack]['c']; + $this->currentPage = $this->stack[$this->nStack]['p']; + $this->nStack--; + // easier to probably not worry about removing the old entries, they will be overwritten + // if there are new ones. + } + } + + /** + * stop an object from appearing on pages from this point on + */ + function stopObject($id) + { + // if an object has been appearing on pages up to now, then stop it, this page will + // be the last one that could contian it. + if (isset($this->addLooseObjects[$id])) { + $this->addLooseObjects[$id] = ''; + } + } + + /** + * after an object has been created, it wil only show if it has been added, using this function. + */ + function addObject($id, $options = 'add') + { + // add the specified object to the page + if (isset($this->looseObjects[$id]) && $this->currentContents != $id) { + // then it is a valid object, and it is not being added to itself + switch ($options) { + case 'all': + // then this object is to be added to this page (done in the next block) and + // all future new pages. + $this->addLooseObjects[$id] = 'all'; + + case 'add': + if (isset($this->objects[$this->currentContents]['onPage'])) { + // then the destination contents is the primary for the page + // (though this object is actually added to that page) + $this->o_page($this->objects[$this->currentContents]['onPage'], 'content', $id); + } + break; + + case 'even': + $this->addLooseObjects[$id] = 'even'; + $pageObjectId = $this->objects[$this->currentContents]['onPage']; + if ($this->objects[$pageObjectId]['info']['pageNum'] % 2 == 0) { + $this->addObject($id); + // hacky huh :) + } + break; + + case 'odd': + $this->addLooseObjects[$id] = 'odd'; + $pageObjectId = $this->objects[$this->currentContents]['onPage']; + if ($this->objects[$pageObjectId]['info']['pageNum'] % 2 == 1) { + $this->addObject($id); + // hacky huh :) + } + break; + + case 'next': + $this->addLooseObjects[$id] = 'all'; + break; + + case 'nexteven': + $this->addLooseObjects[$id] = 'even'; + break; + + case 'nextodd': + $this->addLooseObjects[$id] = 'odd'; + break; + } + } + } + + /** + * return a storable representation of a specific object + */ + function serializeObject($id) + { + if (array_key_exists($id, $this->objects)) { + return serialize($this->objects[$id]); + } + } + + /** + * restore an object from its stored representation. returns its new object id. + */ + function restoreSerializedObject($obj) + { + $obj_id = $this->openObject(); + $this->objects[$obj_id] = unserialize($obj); + $this->closeObject(); + + return $obj_id; + } + + /** + * add content to the documents info object + */ + function addInfo($label, $value = 0) + { + // this will only work if the label is one of the valid ones. + // modify this so that arrays can be passed as well. + // if $label is an array then assume that it is key => value pairs + // else assume that they are both scalar, anything else will probably error + if (is_array($label)) { + foreach ($label as $l => $v) { + $this->o_info($this->infoObject, $l, $v); + } + } else { + $this->o_info($this->infoObject, $label, $value); + } + } + + /** + * set the viewer preferences of the document, it is up to the browser to obey these. + */ + function setPreferences($label, $value = 0) + { + // this will only work if the label is one of the valid ones. + if (is_array($label)) { + foreach ($label as $l => $v) { + $this->o_catalog($this->catalogId, 'viewerPreferences', array($l => $v)); + } + } else { + $this->o_catalog($this->catalogId, 'viewerPreferences', array($label => $value)); + } + } + + /** + * extract an integer from a position in a byte stream + */ + private function getBytes(&$data, $pos, $num) + { + // return the integer represented by $num bytes from $pos within $data + $ret = 0; + for ($i = 0; $i < $num; $i++) { + $ret *= 256; + $ret += ord($data[$pos + $i]); + } + + return $ret; + } + + /** + * Check if image already added to pdf image directory. + * If yes, need not to create again (pass empty data) + */ + function image_iscached($imgname) + { + return isset($this->imagelist[$imgname]); + } + + /** + * add a PNG image into the document, from a GD object + * this should work with remote files + * + * @param string $file The PNG file + * @param float $x X position + * @param float $y Y position + * @param float $w Width + * @param float $h Height + * @param resource $img A GD resource + * @param bool $is_mask true if the image is a mask + * @param bool $mask true if the image is masked + */ + function addImagePng($file, $x, $y, $w = 0.0, $h = 0.0, &$img, $is_mask = false, $mask = null) + { + if (!function_exists("imagepng")) { + throw new Exception("The PHP GD extension is required, but is not installed."); + } + + //if already cached, need not to read again + if (isset($this->imagelist[$file])) { + $data = null; + } else { + // Example for transparency handling on new image. Retain for current image + // $tIndex = imagecolortransparent($img); + // if ($tIndex > 0) { + // $tColor = imagecolorsforindex($img, $tIndex); + // $new_tIndex = imagecolorallocate($new_img, $tColor['red'], $tColor['green'], $tColor['blue']); + // imagefill($new_img, 0, 0, $new_tIndex); + // imagecolortransparent($new_img, $new_tIndex); + // } + // blending mode (literal/blending) on drawing into current image. not relevant when not saved or not drawn + //imagealphablending($img, true); + + //default, but explicitely set to ensure pdf compatibility + imagesavealpha($img, false/*!$is_mask && !$mask*/); + + $error = 0; + + ob_start(); + @imagepng($img); + $data = ob_get_clean(); + + if ($data == '') { + $error = 1; + $errormsg = 'trouble writing file from GD'; + } + + if ($error) { + $this->addMessage('PNG error - (' . $file . ') ' . $errormsg); + + return; + } + } //End isset($this->imagelist[$file]) (png Duplicate removal) + + $this->addPngFromBuf($file, $x, $y, $w, $h, $data, $is_mask, $mask); + } + + protected function addImagePngAlpha($file, $x, $y, $w, $h, $byte) + { + // generate images + $img = imagecreatefrompng($file); + + if ($img === false) { + return; + } + + // FIXME The pixel transformation doesn't work well with 8bit PNGs + $eight_bit = ($byte & 4) !== 4; + + $wpx = imagesx($img); + $hpx = imagesy($img); + + imagesavealpha($img, false); + + // create temp alpha file + $tempfile_alpha = tempnam($this->tmp, "cpdf_img_"); + @unlink($tempfile_alpha); + $tempfile_alpha = "$tempfile_alpha.png"; + + // create temp plain file + $tempfile_plain = tempnam($this->tmp, "cpdf_img_"); + @unlink($tempfile_plain); + $tempfile_plain = "$tempfile_plain.png"; + + $imgalpha = imagecreate($wpx, $hpx); + imagesavealpha($imgalpha, false); + + // generate gray scale palette (0 -> 255) + for ($c = 0; $c < 256; ++$c) { + imagecolorallocate($imgalpha, $c, $c, $c); + } + + // Use PECL gmagick + Graphics Magic to process transparent PNG images + if (extension_loaded("gmagick")) { + $gmagick = new Gmagick($file); + $gmagick->setimageformat('png'); + + // Get opacity channel (negative of alpha channel) + $alpha_channel_neg = clone $gmagick; + $alpha_channel_neg->separateimagechannel(Gmagick::CHANNEL_OPACITY); + + // Negate opacity channel + $alpha_channel = new Gmagick(); + $alpha_channel->newimage($wpx, $hpx, "#FFFFFF", "png"); + $alpha_channel->compositeimage($alpha_channel_neg, Gmagick::COMPOSITE_DIFFERENCE, 0, 0); + $alpha_channel->separateimagechannel(Gmagick::CHANNEL_RED); + $alpha_channel->writeimage($tempfile_alpha); + + // Cast to 8bit+palette + $imgalpha_ = imagecreatefrompng($tempfile_alpha); + imagecopy($imgalpha, $imgalpha_, 0, 0, 0, 0, $wpx, $hpx); + imagedestroy($imgalpha_); + imagepng($imgalpha, $tempfile_alpha); + + // Make opaque image + $color_channels = new Gmagick(); + $color_channels->newimage($wpx, $hpx, "#FFFFFF", "png"); + $color_channels->compositeimage($gmagick, Gmagick::COMPOSITE_COPYRED, 0, 0); + $color_channels->compositeimage($gmagick, Gmagick::COMPOSITE_COPYGREEN, 0, 0); + $color_channels->compositeimage($gmagick, Gmagick::COMPOSITE_COPYBLUE, 0, 0); + $color_channels->writeimage($tempfile_plain); + + $imgplain = imagecreatefrompng($tempfile_plain); + } // Use PECL imagick + ImageMagic to process transparent PNG images + elseif (extension_loaded("imagick")) { + // Native cloning was added to pecl-imagick in svn commit 263814 + // the first version containing it was 3.0.1RC1 + static $imagickClonable = null; + if ($imagickClonable === null) { + $imagickClonable = version_compare(phpversion('imagick'), '3.0.1rc1') > 0; + } + + $imagick = new Imagick($file); + $imagick->setFormat('png'); + + // Get opacity channel (negative of alpha channel) + $alpha_channel = $imagickClonable ? clone $imagick : $imagick->clone(); + $alpha_channel->separateImageChannel(Imagick::CHANNEL_ALPHA); + $alpha_channel->negateImage(true); + $alpha_channel->writeImage($tempfile_alpha); + + // Cast to 8bit+palette + $imgalpha_ = imagecreatefrompng($tempfile_alpha); + imagecopy($imgalpha, $imgalpha_, 0, 0, 0, 0, $wpx, $hpx); + imagedestroy($imgalpha_); + imagepng($imgalpha, $tempfile_alpha); + + // Make opaque image + $color_channels = new Imagick(); + $color_channels->newImage($wpx, $hpx, "#FFFFFF", "png"); + $color_channels->compositeImage($imagick, Imagick::COMPOSITE_COPYRED, 0, 0); + $color_channels->compositeImage($imagick, Imagick::COMPOSITE_COPYGREEN, 0, 0); + $color_channels->compositeImage($imagick, Imagick::COMPOSITE_COPYBLUE, 0, 0); + $color_channels->writeImage($tempfile_plain); + + $imgplain = imagecreatefrompng($tempfile_plain); + } else { + // allocated colors cache + $allocated_colors = array(); + + // extract alpha channel + for ($xpx = 0; $xpx < $wpx; ++$xpx) { + for ($ypx = 0; $ypx < $hpx; ++$ypx) { + $color = imagecolorat($img, $xpx, $ypx); + $col = imagecolorsforindex($img, $color); + $alpha = $col['alpha']; + + if ($eight_bit) { + // with gamma correction + $gammacorr = 2.2; + $pixel = pow((((127 - $alpha) * 255 / 127) / 255), $gammacorr) * 255; + } else { + // without gamma correction + $pixel = (127 - $alpha) * 2; + + $key = $col['red'] . $col['green'] . $col['blue']; + + if (!isset($allocated_colors[$key])) { + $pixel_img = imagecolorallocate($img, $col['red'], $col['green'], $col['blue']); + $allocated_colors[$key] = $pixel_img; + } else { + $pixel_img = $allocated_colors[$key]; + } + + imagesetpixel($img, $xpx, $ypx, $pixel_img); + } + + imagesetpixel($imgalpha, $xpx, $ypx, $pixel); + } + } + + // extract image without alpha channel + $imgplain = imagecreatetruecolor($wpx, $hpx); + imagecopy($imgplain, $img, 0, 0, 0, 0, $wpx, $hpx); + imagedestroy($img); + + imagepng($imgalpha, $tempfile_alpha); + imagepng($imgplain, $tempfile_plain); + } + + // embed mask image + $this->addImagePng($tempfile_alpha, $x, $y, $w, $h, $imgalpha, true); + imagedestroy($imgalpha); + + // embed image, masked with previously embedded mask + $this->addImagePng($tempfile_plain, $x, $y, $w, $h, $imgplain, false, true); + imagedestroy($imgplain); + + // remove temp files + unlink($tempfile_alpha); + unlink($tempfile_plain); + } + + /** + * add a PNG image into the document, from a file + * this should work with remote files + */ + function addPngFromFile($file, $x, $y, $w = 0, $h = 0) + { + if (!function_exists("imagecreatefrompng")) { + throw new Exception("The PHP GD extension is required, but is not installed."); + } + + //if already cached, need not to read again + if (isset($this->imagelist[$file])) { + $img = null; + } else { + $info = file_get_contents($file, false, null, 24, 5); + $meta = unpack("CbitDepth/CcolorType/CcompressionMethod/CfilterMethod/CinterlaceMethod", $info); + $bit_depth = $meta["bitDepth"]; + $color_type = $meta["colorType"]; + + // http://www.w3.org/TR/PNG/#11IHDR + // 3 => indexed + // 4 => greyscale with alpha + // 6 => fullcolor with alpha + $is_alpha = in_array($color_type, array(4, 6)) || ($color_type == 3 && $bit_depth != 4); + + if ($is_alpha) { // exclude grayscale alpha + return $this->addImagePngAlpha($file, $x, $y, $w, $h, $color_type); + } + + //png files typically contain an alpha channel. + //pdf file format or class.pdf does not support alpha blending. + //on alpha blended images, more transparent areas have a color near black. + //This appears in the result on not storing the alpha channel. + //Correct would be the box background image or its parent when transparent. + //But this would make the image dependent on the background. + //Therefore create an image with white background and copy in + //A more natural background than black is white. + //Therefore create an empty image with white background and merge the + //image in with alpha blending. + $imgtmp = @imagecreatefrompng($file); + if (!$imgtmp) { + return; + } + $sx = imagesx($imgtmp); + $sy = imagesy($imgtmp); + $img = imagecreatetruecolor($sx, $sy); + imagealphablending($img, true); + + // @todo is it still needed ?? + $ti = imagecolortransparent($imgtmp); + if ($ti >= 0) { + $tc = imagecolorsforindex($imgtmp, $ti); + $ti = imagecolorallocate($img, $tc['red'], $tc['green'], $tc['blue']); + imagefill($img, 0, 0, $ti); + imagecolortransparent($img, $ti); + } else { + imagefill($img, 1, 1, imagecolorallocate($img, 255, 255, 255)); + } + + imagecopy($img, $imgtmp, 0, 0, 0, 0, $sx, $sy); + imagedestroy($imgtmp); + } + $this->addImagePng($file, $x, $y, $w, $h, $img); + + if ($img) { + imagedestroy($img); + } + } + + /** + * add a PNG image into the document, from a memory buffer of the file + */ + function addPngFromBuf($file, $x, $y, $w = 0.0, $h = 0.0, &$data, $is_mask = false, $mask = null) + { + if (isset($this->imagelist[$file])) { + $data = null; + $info['width'] = $this->imagelist[$file]['w']; + $info['height'] = $this->imagelist[$file]['h']; + $label = $this->imagelist[$file]['label']; + } else { + if ($data == null) { + $this->addMessage('addPngFromBuf error - data not present!'); + + return; + } + + $error = 0; + + if (!$error) { + $header = chr(137) . chr(80) . chr(78) . chr(71) . chr(13) . chr(10) . chr(26) . chr(10); + + if (mb_substr($data, 0, 8, '8bit') != $header) { + $error = 1; + + $errormsg = 'this file does not have a valid header'; + } + } + + if (!$error) { + // set pointer + $p = 8; + $len = mb_strlen($data, '8bit'); + + // cycle through the file, identifying chunks + $haveHeader = 0; + $info = array(); + $idata = ''; + $pdata = ''; + + while ($p < $len) { + $chunkLen = $this->getBytes($data, $p, 4); + $chunkType = mb_substr($data, $p + 4, 4, '8bit'); + + switch ($chunkType) { + case 'IHDR': + // this is where all the file information comes from + $info['width'] = $this->getBytes($data, $p + 8, 4); + $info['height'] = $this->getBytes($data, $p + 12, 4); + $info['bitDepth'] = ord($data[$p + 16]); + $info['colorType'] = ord($data[$p + 17]); + $info['compressionMethod'] = ord($data[$p + 18]); + $info['filterMethod'] = ord($data[$p + 19]); + $info['interlaceMethod'] = ord($data[$p + 20]); + + //print_r($info); + $haveHeader = 1; + if ($info['compressionMethod'] != 0) { + $error = 1; + + //debugpng + if (DEBUGPNG) { + print '[addPngFromFile unsupported compression method ' . $file . ']'; + } + + $errormsg = 'unsupported compression method'; + } + + if ($info['filterMethod'] != 0) { + $error = 1; + + //debugpng + if (DEBUGPNG) { + print '[addPngFromFile unsupported filter method ' . $file . ']'; + } + + $errormsg = 'unsupported filter method'; + } + break; + + case 'PLTE': + $pdata .= mb_substr($data, $p + 8, $chunkLen, '8bit'); + break; + + case 'IDAT': + $idata .= mb_substr($data, $p + 8, $chunkLen, '8bit'); + break; + + case 'tRNS': + //this chunk can only occur once and it must occur after the PLTE chunk and before IDAT chunk + //print "tRNS found, color type = ".$info['colorType']."\n"; + $transparency = array(); + + switch ($info['colorType']) { + // indexed color, rbg + case 3: + /* corresponding to entries in the plte chunk + Alpha for palette index 0: 1 byte + Alpha for palette index 1: 1 byte + ...etc... + */ + // there will be one entry for each palette entry. up until the last non-opaque entry. + // set up an array, stretching over all palette entries which will be o (opaque) or 1 (transparent) + $transparency['type'] = 'indexed'; + $trans = 0; + + for ($i = $chunkLen; $i >= 0; $i--) { + if (ord($data[$p + 8 + $i]) == 0) { + $trans = $i; + } + } + + $transparency['data'] = $trans; + break; + + // grayscale + case 0: + /* corresponding to entries in the plte chunk + Gray: 2 bytes, range 0 .. (2^bitdepth)-1 + */ + // $transparency['grayscale'] = $this->PRVT_getBytes($data,$p+8,2); // g = grayscale + $transparency['type'] = 'indexed'; + $transparency['data'] = ord($data[$p + 8 + 1]); + break; + + // truecolor + case 2: + /* corresponding to entries in the plte chunk + Red: 2 bytes, range 0 .. (2^bitdepth)-1 + Green: 2 bytes, range 0 .. (2^bitdepth)-1 + Blue: 2 bytes, range 0 .. (2^bitdepth)-1 + */ + $transparency['r'] = $this->getBytes($data, $p + 8, 2); + // r from truecolor + $transparency['g'] = $this->getBytes($data, $p + 10, 2); + // g from truecolor + $transparency['b'] = $this->getBytes($data, $p + 12, 2); + // b from truecolor + + $transparency['type'] = 'color-key'; + break; + + //unsupported transparency type + default: + if (DEBUGPNG) { + print '[addPngFromFile unsupported transparency type ' . $file . ']'; + } + break; + } + + // KS End new code + break; + + default: + break; + } + + $p += $chunkLen + 12; + } + + if (!$haveHeader) { + $error = 1; + + //debugpng + if (DEBUGPNG) { + print '[addPngFromFile information header is missing ' . $file . ']'; + } + + $errormsg = 'information header is missing'; + } + + if (isset($info['interlaceMethod']) && $info['interlaceMethod']) { + $error = 1; + + //debugpng + if (DEBUGPNG) { + print '[addPngFromFile no support for interlaced images in pdf ' . $file . ']'; + } + + $errormsg = 'There appears to be no support for interlaced images in pdf.'; + } + } + + if (!$error && $info['bitDepth'] > 8) { + $error = 1; + + //debugpng + if (DEBUGPNG) { + print '[addPngFromFile bit depth of 8 or less is supported ' . $file . ']'; + } + + $errormsg = 'only bit depth of 8 or less is supported'; + } + + if (!$error) { + switch ($info['colorType']) { + case 3: + $color = 'DeviceRGB'; + $ncolor = 1; + break; + + case 2: + $color = 'DeviceRGB'; + $ncolor = 3; + break; + + case 0: + $color = 'DeviceGray'; + $ncolor = 1; + break; + + default: + $error = 1; + + //debugpng + if (DEBUGPNG) { + print '[addPngFromFile alpha channel not supported: ' . $info['colorType'] . ' ' . $file . ']'; + } + + $errormsg = 'transparancey alpha channel not supported, transparency only supported for palette images.'; + } + } + + if ($error) { + $this->addMessage('PNG error - (' . $file . ') ' . $errormsg); + + return; + } + + //print_r($info); + // so this image is ok... add it in. + $this->numImages++; + $im = $this->numImages; + $label = "I$im"; + $this->numObj++; + + // $this->o_image($this->numObj,'new',array('label' => $label,'data' => $idata,'iw' => $w,'ih' => $h,'type' => 'png','ic' => $info['width'])); + $options = array( + 'label' => $label, + 'data' => $idata, + 'bitsPerComponent' => $info['bitDepth'], + 'pdata' => $pdata, + 'iw' => $info['width'], + 'ih' => $info['height'], + 'type' => 'png', + 'color' => $color, + 'ncolor' => $ncolor, + 'masked' => $mask, + 'isMask' => $is_mask + ); + + if (isset($transparency)) { + $options['transparency'] = $transparency; + } + + $this->o_image($this->numObj, 'new', $options); + $this->imagelist[$file] = array('label' => $label, 'w' => $info['width'], 'h' => $info['height']); + } + + if ($is_mask) { + return; + } + + if ($w <= 0 && $h <= 0) { + $w = $info['width']; + $h = $info['height']; + } + + if ($w <= 0) { + $w = $h / $info['height'] * $info['width']; + } + + if ($h <= 0) { + $h = $w * $info['height'] / $info['width']; + } + + $this->addContent(sprintf("\nq\n%.3F 0 0 %.3F %.3F %.3F cm /%s Do\nQ", $w, $h, $x, $y, $label)); + } + + /** + * add a JPEG image into the document, from a file + */ + function addJpegFromFile($img, $x, $y, $w = 0, $h = 0) + { + // attempt to add a jpeg image straight from a file, using no GD commands + // note that this function is unable to operate on a remote file. + + if (!file_exists($img)) { + return; + } + + if ($this->image_iscached($img)) { + $data = null; + $imageWidth = $this->imagelist[$img]['w']; + $imageHeight = $this->imagelist[$img]['h']; + $channels = $this->imagelist[$img]['c']; + } else { + $tmp = getimagesize($img); + $imageWidth = $tmp[0]; + $imageHeight = $tmp[1]; + + if (isset($tmp['channels'])) { + $channels = $tmp['channels']; + } else { + $channels = 3; + } + + $data = file_get_contents($img); + } + + if ($w <= 0 && $h <= 0) { + $w = $imageWidth; + } + + if ($w == 0) { + $w = $h / $imageHeight * $imageWidth; + } + + if ($h == 0) { + $h = $w * $imageHeight / $imageWidth; + } + + $this->addJpegImage_common($data, $x, $y, $w, $h, $imageWidth, $imageHeight, $channels, $img); + } + + /** + * common code used by the two JPEG adding functions + */ + private function addJpegImage_common( + &$data, + $x, + $y, + $w = 0, + $h = 0, + $imageWidth, + $imageHeight, + $channels = 3, + $imgname + ) { + if ($this->image_iscached($imgname)) { + $label = $this->imagelist[$imgname]['label']; + //debugpng + //if (DEBUGPNG) print '[addJpegImage_common Duplicate '.$imgname.']'; + + } else { + if ($data == null) { + $this->addMessage('addJpegImage_common error - (' . $imgname . ') data not present!'); + + return; + } + + // note that this function is not to be called externally + // it is just the common code between the GD and the file options + $this->numImages++; + $im = $this->numImages; + $label = "I$im"; + $this->numObj++; + + $this->o_image( + $this->numObj, + 'new', + array( + 'label' => $label, + 'data' => &$data, + 'iw' => $imageWidth, + 'ih' => $imageHeight, + 'channels' => $channels + ) + ); + + $this->imagelist[$imgname] = array( + 'label' => $label, + 'w' => $imageWidth, + 'h' => $imageHeight, + 'c' => $channels + ); + } + + $this->addContent(sprintf("\nq\n%.3F 0 0 %.3F %.3F %.3F cm /%s Do\nQ ", $w, $h, $x, $y, $label)); + } + + /** + * specify where the document should open when it first starts + */ + function openHere($style, $a = 0, $b = 0, $c = 0) + { + // this function will open the document at a specified page, in a specified style + // the values for style, and the required paramters are: + // 'XYZ' left, top, zoom + // 'Fit' + // 'FitH' top + // 'FitV' left + // 'FitR' left,bottom,right + // 'FitB' + // 'FitBH' top + // 'FitBV' left + $this->numObj++; + $this->o_destination( + $this->numObj, + 'new', + array('page' => $this->currentPage, 'type' => $style, 'p1' => $a, 'p2' => $b, 'p3' => $c) + ); + $id = $this->catalogId; + $this->o_catalog($id, 'openHere', $this->numObj); + } + + /** + * Add JavaScript code to the PDF document + * + * @param string $code + * + * @return void + */ + function addJavascript($code) + { + $this->javascript .= $code; + } + + /** + * create a labelled destination within the document + */ + function addDestination($label, $style, $a = 0, $b = 0, $c = 0) + { + // associates the given label with the destination, it is done this way so that a destination can be specified after + // it has been linked to + // styles are the same as the 'openHere' function + $this->numObj++; + $this->o_destination( + $this->numObj, + 'new', + array('page' => $this->currentPage, 'type' => $style, 'p1' => $a, 'p2' => $b, 'p3' => $c) + ); + $id = $this->numObj; + + // store the label->idf relationship, note that this means that labels can be used only once + $this->destinations["$label"] = $id; + } + + /** + * define font families, this is used to initialize the font families for the default fonts + * and for the user to add new ones for their fonts. The default bahavious can be overridden should + * that be desired. + */ + function setFontFamily($family, $options = '') + { + if (!is_array($options)) { + if ($family === 'init') { + // set the known family groups + // these font families will be used to enable bold and italic markers to be included + // within text streams. html forms will be used... + $this->fontFamilies['Helvetica.afm'] = + array( + 'b' => 'Helvetica-Bold.afm', + 'i' => 'Helvetica-Oblique.afm', + 'bi' => 'Helvetica-BoldOblique.afm', + 'ib' => 'Helvetica-BoldOblique.afm' + ); + + $this->fontFamilies['Courier.afm'] = + array( + 'b' => 'Courier-Bold.afm', + 'i' => 'Courier-Oblique.afm', + 'bi' => 'Courier-BoldOblique.afm', + 'ib' => 'Courier-BoldOblique.afm' + ); + + $this->fontFamilies['Times-Roman.afm'] = + array( + 'b' => 'Times-Bold.afm', + 'i' => 'Times-Italic.afm', + 'bi' => 'Times-BoldItalic.afm', + 'ib' => 'Times-BoldItalic.afm' + ); + } + } else { + + // the user is trying to set a font family + // note that this can also be used to set the base ones to something else + if (mb_strlen($family)) { + $this->fontFamilies[$family] = $options; + } + } + } + + /** + * used to add messages for use in debugging + */ + function addMessage($message) + { + $this->messages .= $message . "\n"; + } + + /** + * a few functions which should allow the document to be treated transactionally. + */ + function transaction($action) + { + switch ($action) { + case 'start': + // store all the data away into the checkpoint variable + $data = get_object_vars($this); + $this->checkpoint = $data; + unset($data); + break; + + case 'commit': + if (is_array($this->checkpoint) && isset($this->checkpoint['checkpoint'])) { + $tmp = $this->checkpoint['checkpoint']; + $this->checkpoint = $tmp; + unset($tmp); + } else { + $this->checkpoint = ''; + } + break; + + case 'rewind': + // do not destroy the current checkpoint, but move us back to the state then, so that we can try again + if (is_array($this->checkpoint)) { + // can only abort if were inside a checkpoint + $tmp = $this->checkpoint; + + foreach ($tmp as $k => $v) { + if ($k !== 'checkpoint') { + $this->$k = $v; + } + } + unset($tmp); + } + break; + + case 'abort': + if (is_array($this->checkpoint)) { + // can only abort if were inside a checkpoint + $tmp = $this->checkpoint; + foreach ($tmp as $k => $v) { + $this->$k = $v; + } + unset($tmp); + } + break; + } + } +} diff --git a/lib/dompdf/lib/php-svg-lib/src/Svg/Surface/SurfaceCpdf.php b/lib/dompdf/lib/php-svg-lib/src/Svg/Surface/SurfaceCpdf.php new file mode 100644 index 0000000..fc85797 --- /dev/null +++ b/lib/dompdf/lib/php-svg-lib/src/Svg/Surface/SurfaceCpdf.php @@ -0,0 +1,486 @@ + + * @license GNU LGPLv3+ http://www.gnu.org/copyleft/lesser.html + */ + +namespace Svg\Surface; + +use Svg\Document; +use Svg\Style; + +class SurfaceCpdf implements SurfaceInterface +{ + const DEBUG = false; + + /** @var \CPdf\CPdf */ + private $canvas; + + private $width; + private $height; + + /** @var Style */ + private $style; + + public function __construct(Document $doc, $canvas = null) + { + if (self::DEBUG) echo __FUNCTION__ . "\n"; + + $dimensions = $doc->getDimensions(); + $w = $dimensions["width"]; + $h = $dimensions["height"]; + + if (!$canvas) { + $canvas = new \CPdf\CPdf(array(0, 0, $w, $h)); + $refl = new \ReflectionClass($canvas); + $canvas->fontcache = realpath(dirname($refl->getFileName()) . "/../../fonts/")."/"; + } + + // Flip PDF coordinate system so that the origin is in + // the top left rather than the bottom left + $canvas->transform(array( + 1, 0, + 0, -1, + 0, $h + )); + + $this->width = $w; + $this->height = $h; + + $this->canvas = $canvas; + } + + function out() + { + if (self::DEBUG) echo __FUNCTION__ . "\n"; + return $this->canvas->output(); + } + + public function save() + { + if (self::DEBUG) echo __FUNCTION__ . "\n"; + $this->canvas->save(); + } + + public function restore() + { + if (self::DEBUG) echo __FUNCTION__ . "\n"; + $this->canvas->restore(); + } + + public function scale($x, $y) + { + if (self::DEBUG) echo __FUNCTION__ . "\n"; + + $this->transform($x, 0, 0, $y, 0, 0); + } + + public function rotate($angle) + { + if (self::DEBUG) echo __FUNCTION__ . "\n"; + + $a = deg2rad($angle); + $cos_a = cos($a); + $sin_a = sin($a); + + $this->transform( + $cos_a, $sin_a, + -$sin_a, $cos_a, + 0, 0 + ); + } + + public function translate($x, $y) + { + if (self::DEBUG) echo __FUNCTION__ . "\n"; + + $this->transform( + 1, 0, + 0, 1, + $x, $y + ); + } + + public function transform($a, $b, $c, $d, $e, $f) + { + if (self::DEBUG) echo __FUNCTION__ . "\n"; + + $this->canvas->transform(array($a, $b, $c, $d, $e, $f)); + } + + public function beginPath() + { + if (self::DEBUG) echo __FUNCTION__ . "\n"; + // TODO: Implement beginPath() method. + } + + public function closePath() + { + if (self::DEBUG) echo __FUNCTION__ . "\n"; + $this->canvas->closePath(); + } + + public function fillStroke() + { + if (self::DEBUG) echo __FUNCTION__ . "\n"; + $this->canvas->fillStroke(); + } + + public function clip() + { + if (self::DEBUG) echo __FUNCTION__ . "\n"; + $this->canvas->clip(); + } + + public function fillText($text, $x, $y, $maxWidth = null) + { + if (self::DEBUG) echo __FUNCTION__ . "\n"; + $this->canvas->addText($x, $y, $this->style->fontSize, $text); + } + + public function strokeText($text, $x, $y, $maxWidth = null) + { + if (self::DEBUG) echo __FUNCTION__ . "\n"; + $this->canvas->addText($x, $y, $this->style->fontSize, $text); + } + + public function drawImage($image, $sx, $sy, $sw = null, $sh = null, $dx = null, $dy = null, $dw = null, $dh = null) + { + if (self::DEBUG) echo __FUNCTION__ . "\n"; + + if (strpos($image, "data:") === 0) { + $parts = explode(',', $image, 2); + + $data = $parts[1]; + $base64 = false; + + $token = strtok($parts[0], ';'); + while ($token !== false) { + if ($token == 'base64') { + $base64 = true; + } + + $token = strtok(';'); + } + + if ($base64) { + $data = base64_decode($data); + } + } + else { + $data = file_get_contents($image); + } + + $image = tempnam("", "svg"); + file_put_contents($image, $data); + + $img = $this->image($image, $sx, $sy, $sw, $sh, "normal"); + + + unlink($image); + } + + public static function getimagesize($filename) + { + static $cache = array(); + + if (isset($cache[$filename])) { + return $cache[$filename]; + } + + list($width, $height, $type) = getimagesize($filename); + + if ($width == null || $height == null) { + $data = file_get_contents($filename, null, null, 0, 26); + + if (substr($data, 0, 2) === "BM") { + $meta = unpack('vtype/Vfilesize/Vreserved/Voffset/Vheadersize/Vwidth/Vheight', $data); + $width = (int)$meta['width']; + $height = (int)$meta['height']; + $type = IMAGETYPE_BMP; + } + } + + return $cache[$filename] = array($width, $height, $type); + } + + function image($img, $x, $y, $w, $h, $resolution = "normal") + { + list($width, $height, $type) = $this->getimagesize($img); + + switch ($type) { + case IMAGETYPE_JPEG: + $this->canvas->addJpegFromFile($img, $x, $y - $h, $w, $h); + break; + + case IMAGETYPE_GIF: + case IMAGETYPE_BMP: + // @todo use cache for BMP and GIF + $img = $this->_convert_gif_bmp_to_png($img, $type); + + case IMAGETYPE_PNG: + $this->canvas->addPngFromFile($img, $x, $y - $h, $w, $h); + break; + + default: + } + } + + public function lineTo($x, $y) + { + if (self::DEBUG) echo __FUNCTION__ . "\n"; + $this->canvas->lineTo($x, $y); + } + + public function moveTo($x, $y) + { + if (self::DEBUG) echo __FUNCTION__ . "\n"; + $this->canvas->moveTo($x, $y); + } + + public function quadraticCurveTo($cpx, $cpy, $x, $y) + { + if (self::DEBUG) echo __FUNCTION__ . "\n"; + + // FIXME not accurate + $this->canvas->quadTo($cpx, $cpy, $x, $y); + } + + public function bezierCurveTo($cp1x, $cp1y, $cp2x, $cp2y, $x, $y) + { + if (self::DEBUG) echo __FUNCTION__ . "\n"; + $this->canvas->curveTo($cp1x, $cp1y, $cp2x, $cp2y, $x, $y); + } + + public function arcTo($x1, $y1, $x2, $y2, $radius) + { + if (self::DEBUG) echo __FUNCTION__ . "\n"; + } + + public function arc($x, $y, $radius, $startAngle, $endAngle, $anticlockwise = false) + { + if (self::DEBUG) echo __FUNCTION__ . "\n"; + $this->canvas->ellipse($x, $y, $radius, $radius, 0, 8, $startAngle, $endAngle, false, false, false, true); + } + + public function circle($x, $y, $radius) + { + if (self::DEBUG) echo __FUNCTION__ . "\n"; + $this->canvas->ellipse($x, $y, $radius, $radius, 0, 8, 0, 360, true, false, false, false); + } + + public function ellipse($x, $y, $radiusX, $radiusY, $rotation, $startAngle, $endAngle, $anticlockwise) + { + if (self::DEBUG) echo __FUNCTION__ . "\n"; + $this->canvas->ellipse($x, $y, $radiusX, $radiusY, 0, 8, 0, 360, false, false, false, false); + } + + public function fillRect($x, $y, $w, $h) + { + if (self::DEBUG) echo __FUNCTION__ . "\n"; + $this->rect($x, $y, $w, $h); + $this->fill(); + } + + public function rect($x, $y, $w, $h, $rx = 0, $ry = 0) + { + if (self::DEBUG) echo __FUNCTION__ . "\n"; + + $canvas = $this->canvas; + + if ($rx <= 0.000001/* && $ry <= 0.000001*/) { + $canvas->rect($x, $y, $w, $h); + + return; + } + + $rx = min($rx, $w / 2); + $rx = min($rx, $h / 2); + + /* Define a path for a rectangle with corners rounded by a given radius. + * Start from the lower left corner and proceed counterclockwise. + */ + $this->moveTo($x + $rx, $y); + + /* Start of the arc segment in the lower right corner */ + $this->lineTo($x + $w - $rx, $y); + + /* Arc segment in the lower right corner */ + $this->arc($x + $w - $rx, $y + $rx, $rx, 270, 360); + + /* Start of the arc segment in the upper right corner */ + $this->lineTo($x + $w, $y + $h - $rx ); + + /* Arc segment in the upper right corner */ + $this->arc($x + $w - $rx, $y + $h - $rx, $rx, 0, 90); + + /* Start of the arc segment in the upper left corner */ + $this->lineTo($x + $rx, $y + $h); + + /* Arc segment in the upper left corner */ + $this->arc($x + $rx, $y + $h - $rx, $rx, 90, 180); + + /* Start of the arc segment in the lower left corner */ + $this->lineTo($x , $y + $rx); + + /* Arc segment in the lower left corner */ + $this->arc($x + $rx, $y + $rx, $rx, 180, 270); + } + + public function fill() + { + if (self::DEBUG) echo __FUNCTION__ . "\n"; + $this->canvas->fill(); + } + + public function strokeRect($x, $y, $w, $h) + { + if (self::DEBUG) echo __FUNCTION__ . "\n"; + $this->rect($x, $y, $w, $h); + $this->stroke(); + } + + public function stroke() + { + if (self::DEBUG) echo __FUNCTION__ . "\n"; + $this->canvas->stroke(); + } + + public function endPath() + { + if (self::DEBUG) echo __FUNCTION__ . "\n"; + $this->canvas->endPath(); + } + + public function measureText($text) + { + if (self::DEBUG) echo __FUNCTION__ . "\n"; + $style = $this->getStyle(); + $this->setFont($style->fontFamily, $style->fontStyle, $style->fontWeight); + + return $this->canvas->getTextWidth($this->getStyle()->fontSize, $text); + } + + public function getStyle() + { + if (self::DEBUG) echo __FUNCTION__ . "\n"; + return $this->style; + } + + public function setStyle(Style $style) + { + if (self::DEBUG) echo __FUNCTION__ . "\n"; + + $this->style = $style; + $canvas = $this->canvas; + + if (is_array($style->stroke) && $stroke = $style->stroke) { + $canvas->setStrokeColor(array((float)$stroke[0]/255, (float)$stroke[1]/255, (float)$stroke[2]/255), true); + } + + if (is_array($style->fill) && $fill = $style->fill) { + $canvas->setColor(array((float)$fill[0]/255, (float)$fill[1]/255, (float)$fill[2]/255), true); + } + + if ($fillRule = strtolower($style->fillRule)) { + $canvas->setFillRule($fillRule); + } + + $opacity = $style->opacity; + if ($opacity !== null && $opacity < 1.0) { + $canvas->setLineTransparency("Normal", $opacity); + $canvas->currentLineTransparency = null; + + $canvas->setFillTransparency("Normal", $opacity); + $canvas->currentFillTransparency = null; + } + else { + $fillOpacity = $style->fillOpacity; + if ($fillOpacity !== null && $fillOpacity < 1.0) { + $canvas->setFillTransparency("Normal", $fillOpacity); + $canvas->currentFillTransparency = null; + } + + $strokeOpacity = $style->strokeOpacity; + if ($strokeOpacity !== null && $strokeOpacity < 1.0) { + $canvas->setLineTransparency("Normal", $strokeOpacity); + $canvas->currentLineTransparency = null; + } + } + + $dashArray = null; + if ($style->strokeDasharray) { + $dashArray = preg_split('/\s*,\s*/', $style->strokeDasharray); + } + + $canvas->setLineStyle( + $style->strokeWidth, + $style->strokeLinecap, + $style->strokeLinejoin, + $dashArray + ); + + $this->setFont($style->fontFamily, $style->fontStyle, $style->fontWeight); + } + + public function setFont($family, $style, $weight) + { + $map = array( + "serif" => "Times", + "sans-serif" => "Helvetica", + "fantasy" => "Symbol", + "cursive" => "Times", + "monospace" => "Courier", + + "arial" => "Helvetica", + "verdana" => "Helvetica", + ); + + $styleMap = array( + 'Helvetica' => array( + 'b' => 'Helvetica-Bold', + 'i' => 'Helvetica-Oblique', + 'bi' => 'Helvetica-BoldOblique', + ), + 'Courier' => array( + 'b' => 'Courier-Bold', + 'i' => 'Courier-Oblique', + 'bi' => 'Courier-BoldOblique', + ), + 'Times' => array( + '' => 'Times-Roman', + 'b' => 'Times-Bold', + 'i' => 'Times-Italic', + 'bi' => 'Times-BoldItalic', + ), + ); + + $family = strtolower($family); + $style = strtolower($style); + $weight = strtolower($weight); + + if (isset($map[$family])) { + $family = $map[$family]; + } + + if (isset($styleMap[$family])) { + $key = ""; + + if ($weight === "bold" || $weight === "bolder" || (is_numeric($weight) && $weight >= 600)) { + $key .= "b"; + } + + if ($style === "italic" || $style === "oblique") { + $key .= "i"; + } + + if (isset($styleMap[$family][$key])) { + $family = $styleMap[$family][$key]; + } + } + + $this->canvas->selectFont("$family.afm"); + } +} diff --git a/lib/dompdf/lib/php-svg-lib/src/Svg/Surface/SurfaceGmagick.php b/lib/dompdf/lib/php-svg-lib/src/Svg/Surface/SurfaceGmagick.php new file mode 100644 index 0000000..5d41906 --- /dev/null +++ b/lib/dompdf/lib/php-svg-lib/src/Svg/Surface/SurfaceGmagick.php @@ -0,0 +1,308 @@ + + * @license GNU LGPLv3+ http://www.gnu.org/copyleft/lesser.html + */ + +namespace Svg\Surface; + +use Svg\Style; + +class SurfaceGmagick implements SurfaceInterface +{ + const DEBUG = false; + + /** @var \GmagickDraw */ + private $canvas; + + private $width; + private $height; + + /** @var Style */ + private $style; + + public function __construct($w, $h) + { + if (self::DEBUG) { + echo __FUNCTION__ . "\n"; + } + $this->width = $w; + $this->height = $h; + + $canvas = new \GmagickDraw(); + + $this->canvas = $canvas; + } + + function out() + { + if (self::DEBUG) { + echo __FUNCTION__ . "\n"; + } + + $image = new \Gmagick(); + $image->newimage($this->width, $this->height); + $image->drawimage($this->canvas); + + $tmp = tempnam("", "gm"); + + $image->write($tmp); + + return file_get_contents($tmp); + } + + public function save() + { + if (self::DEBUG) { + echo __FUNCTION__ . "\n"; + } + $this->canvas->save(); + } + + public function restore() + { + if (self::DEBUG) echo __FUNCTION__ . "\n"; + $this->canvas->restore(); + } + + public function scale($x, $y) + { + if (self::DEBUG) echo __FUNCTION__ . "\n"; + $this->canvas->scale($x, $y); + } + + public function rotate($angle) + { + if (self::DEBUG) echo __FUNCTION__ . "\n"; + $this->canvas->rotate($angle); + } + + public function translate($x, $y) + { + if (self::DEBUG) echo __FUNCTION__ . "\n"; + $this->canvas->translate($x, $y); + } + + public function transform($a, $b, $c, $d, $e, $f) + { + if (self::DEBUG) echo __FUNCTION__ . "\n"; + $this->canvas->concat($a, $b, $c, $d, $e, $f); + } + + public function beginPath() + { + if (self::DEBUG) echo __FUNCTION__ . "\n"; + // TODO: Implement beginPath() method. + } + + public function closePath() + { + if (self::DEBUG) echo __FUNCTION__ . "\n"; + $this->canvas->closepath(); + } + + public function fillStroke() + { + if (self::DEBUG) echo __FUNCTION__ . "\n"; + $this->canvas->fill_stroke(); + } + + public function clip() + { + if (self::DEBUG) echo __FUNCTION__ . "\n"; + $this->canvas->clip(); + } + + public function fillText($text, $x, $y, $maxWidth = null) + { + if (self::DEBUG) echo __FUNCTION__ . "\n"; + $this->canvas->set_text_pos($x, $y); + $this->canvas->show($text); + } + + public function strokeText($text, $x, $y, $maxWidth = null) + { + if (self::DEBUG) echo __FUNCTION__ . "\n"; + // TODO: Implement drawImage() method. + } + + public function drawImage($image, $sx, $sy, $sw = null, $sh = null, $dx = null, $dy = null, $dw = null, $dh = null) + { + if (self::DEBUG) echo __FUNCTION__ . "\n"; + + if (strpos($image, "data:") === 0) { + $data = substr($image, strpos($image, ";") + 1); + if (strpos($data, "base64") === 0) { + $data = base64_decode(substr($data, 7)); + } + + $image = tempnam("", "svg"); + file_put_contents($image, $data); + } + + $img = $this->canvas->load_image("auto", $image, ""); + + $sy = $sy - $sh; + $this->canvas->fit_image($img, $sx, $sy, 'boxsize={' . "$sw $sh" . '} fitmethod=entire'); + } + + public function lineTo($x, $y) + { + if (self::DEBUG) echo __FUNCTION__ . "\n"; + $this->canvas->lineto($x, $y); + } + + public function moveTo($x, $y) + { + if (self::DEBUG) echo __FUNCTION__ . "\n"; + $this->canvas->moveto($x, $y); + } + + public function quadraticCurveTo($cpx, $cpy, $x, $y) + { + if (self::DEBUG) echo __FUNCTION__ . "\n"; + // TODO: Implement quadraticCurveTo() method. + } + + public function bezierCurveTo($cp1x, $cp1y, $cp2x, $cp2y, $x, $y) + { + if (self::DEBUG) echo __FUNCTION__ . "\n"; + $this->canvas->curveto($cp1x, $cp1y, $cp2x, $cp2y, $x, $y); + } + + public function arcTo($x1, $y1, $x2, $y2, $radius) + { + if (self::DEBUG) echo __FUNCTION__ . "\n"; + } + + public function arc($x, $y, $radius, $startAngle, $endAngle, $anticlockwise = false) + { + if (self::DEBUG) echo __FUNCTION__ . "\n"; + $this->canvas->arc($x, $y, $radius, $startAngle, $endAngle); + } + + public function circle($x, $y, $radius) + { + if (self::DEBUG) echo __FUNCTION__ . "\n"; + $this->canvas->circle($x, $y, $radius); + } + + public function ellipse($x, $y, $radiusX, $radiusY, $rotation, $startAngle, $endAngle, $anticlockwise) + { + if (self::DEBUG) echo __FUNCTION__ . "\n"; + $this->canvas->ellipse($x, $y, $radiusX, $radiusY); + } + + public function fillRect($x, $y, $w, $h) + { + if (self::DEBUG) echo __FUNCTION__ . "\n"; + $this->rect($x, $y, $w, $h); + $this->fill(); + } + + public function rect($x, $y, $w, $h, $rx = 0, $ry = 0) + { + if (self::DEBUG) echo __FUNCTION__ . "\n"; + $this->canvas->rect($x, $y, $w, $h); + } + + public function fill() + { + if (self::DEBUG) echo __FUNCTION__ . "\n"; + $this->canvas->fill(); + } + + public function strokeRect($x, $y, $w, $h) + { + if (self::DEBUG) echo __FUNCTION__ . "\n"; + $this->rect($x, $y, $w, $h); + $this->stroke(); + } + + public function stroke() + { + if (self::DEBUG) echo __FUNCTION__ . "\n"; + $this->canvas->stroke(); + } + + public function endPath() + { + if (self::DEBUG) echo __FUNCTION__ . "\n"; + //$this->canvas->endPath(); + } + + public function measureText($text) + { + if (self::DEBUG) echo __FUNCTION__ . "\n"; + $style = $this->getStyle(); + $font = $this->getFont($style->fontFamily, $style->fontStyle); + + return $this->canvas->stringwidth($text, $font, $this->getStyle()->fontSize); + } + + public function getStyle() + { + if (self::DEBUG) echo __FUNCTION__ . "\n"; + + return $this->style; + } + + public function setStyle(Style $style) + { + if (self::DEBUG) echo __FUNCTION__ . "\n"; + + $this->style = $style; + $canvas = $this->canvas; + + if (is_array($style->stroke) && $stroke = $style->stroke) { + $canvas->setcolor("stroke", "rgb", $stroke[0] / 255, $stroke[1] / 255, $stroke[2] / 255, null); + } + + if (is_array($style->fill) && $fill = $style->fill) { + // $canvas->setcolor("fill", "rgb", $fill[0] / 255, $fill[1] / 255, $fill[2] / 255, null); + } + + $opts = array(); + if ($style->strokeWidth > 0.000001) { + $opts[] = "linewidth=$style->strokeWidth"; + } + + if (in_array($style->strokeLinecap, array("butt", "round", "projecting"))) { + $opts[] = "linecap=$style->strokeLinecap"; + } + + if (in_array($style->strokeLinejoin, array("miter", "round", "bevel"))) { + $opts[] = "linejoin=$style->strokeLinejoin"; + } + + $canvas->set_graphics_option(implode(" ", $opts)); + + $font = $this->getFont($style->fontFamily, $style->fontStyle); + $canvas->setfont($font, $style->fontSize); + } + + private function getFont($family, $style) + { + $map = array( + "serif" => "Times", + "sans-serif" => "Helvetica", + "fantasy" => "Symbol", + "cursive" => "serif", + "monospance" => "Courier", + ); + + $family = strtolower($family); + if (isset($map[$family])) { + $family = $map[$family]; + } + + return $this->canvas->load_font($family, "unicode", "fontstyle=$style"); + } + + public function setFont($family, $style, $weight) + { + // TODO: Implement setFont() method. + } +} \ No newline at end of file diff --git a/lib/dompdf/lib/php-svg-lib/src/Svg/Surface/SurfaceInterface.php b/lib/dompdf/lib/php-svg-lib/src/Svg/Surface/SurfaceInterface.php new file mode 100644 index 0000000..fb007ed --- /dev/null +++ b/lib/dompdf/lib/php-svg-lib/src/Svg/Surface/SurfaceInterface.php @@ -0,0 +1,90 @@ + + * @license GNU LGPLv3+ http://www.gnu.org/copyleft/lesser.html + */ + +namespace Svg\Surface; + +use Svg\Style; + +/** + * Interface Surface, like CanvasRenderingContext2D + * + * @package Svg + */ +interface SurfaceInterface +{ + public function save(); + + public function restore(); + + // transformations (default transform is the identity matrix) + public function scale($x, $y); + + public function rotate($angle); + + public function translate($x, $y); + + public function transform($a, $b, $c, $d, $e, $f); + + // path ends + public function beginPath(); + + public function closePath(); + + public function fill(); + + public function stroke(); + + public function endPath(); + + public function fillStroke(); + + public function clip(); + + // text (see also the CanvasDrawingStyles interface) + public function fillText($text, $x, $y, $maxWidth = null); + + public function strokeText($text, $x, $y, $maxWidth = null); + + public function measureText($text); + + // drawing images + public function drawImage($image, $sx, $sy, $sw = null, $sh = null, $dx = null, $dy = null, $dw = null, $dh = null); + + // paths + public function lineTo($x, $y); + + public function moveTo($x, $y); + + public function quadraticCurveTo($cpx, $cpy, $x, $y); + + public function bezierCurveTo($cp1x, $cp1y, $cp2x, $cp2y, $x, $y); + + public function arcTo($x1, $y1, $x2, $y2, $radius); + + public function circle($x, $y, $radius); + + public function arc($x, $y, $radius, $startAngle, $endAngle, $anticlockwise = false); + + public function ellipse($x, $y, $radiusX, $radiusY, $rotation, $startAngle, $endAngle, $anticlockwise); + + // Rectangle + public function rect($x, $y, $w, $h, $rx = 0, $ry = 0); + + public function fillRect($x, $y, $w, $h); + + public function strokeRect($x, $y, $w, $h); + + public function setStyle(Style $style); + + /** + * @return Style + */ + public function getStyle(); + + public function setFont($family, $style, $weight); +} \ No newline at end of file diff --git a/lib/dompdf/lib/php-svg-lib/src/Svg/Surface/SurfacePDFLib.php b/lib/dompdf/lib/php-svg-lib/src/Svg/Surface/SurfacePDFLib.php new file mode 100644 index 0000000..a4d1734 --- /dev/null +++ b/lib/dompdf/lib/php-svg-lib/src/Svg/Surface/SurfacePDFLib.php @@ -0,0 +1,422 @@ + + * @license GNU LGPLv3+ http://www.gnu.org/copyleft/lesser.html + */ + +namespace Svg\Surface; + +use Svg\Style; +use Svg\Document; + +class SurfacePDFLib implements SurfaceInterface +{ + const DEBUG = false; + + private $canvas; + + private $width; + private $height; + + /** @var Style */ + private $style; + + public function __construct(Document $doc, $canvas = null) + { + if (self::DEBUG) echo __FUNCTION__ . "\n"; + + $dimensions = $doc->getDimensions(); + $w = $dimensions["width"]; + $h = $dimensions["height"]; + + if (!$canvas) { + $canvas = new \PDFlib(); + + /* all strings are expected as utf8 */ + $canvas->set_option("stringformat=utf8"); + $canvas->set_option("errorpolicy=return"); + + /* open new PDF file; insert a file name to create the PDF on disk */ + if ($canvas->begin_document("", "") == 0) { + die("Error: " . $canvas->get_errmsg()); + } + $canvas->set_info("Creator", "PDFlib starter sample"); + $canvas->set_info("Title", "starter_graphics"); + + $canvas->begin_page_ext($w, $h, ""); + } + + // Flip PDF coordinate system so that the origin is in + // the top left rather than the bottom left + $canvas->setmatrix( + 1, 0, + 0, -1, + 0, $h + ); + + $this->width = $w; + $this->height = $h; + + $this->canvas = $canvas; + } + + function out() + { + if (self::DEBUG) echo __FUNCTION__ . "\n"; + + $this->canvas->end_page_ext(""); + $this->canvas->end_document(""); + + return $this->canvas->get_buffer(); + } + + public function save() + { + if (self::DEBUG) echo __FUNCTION__ . "\n"; + $this->canvas->save(); + } + + public function restore() + { + if (self::DEBUG) echo __FUNCTION__ . "\n"; + $this->canvas->restore(); + } + + public function scale($x, $y) + { + if (self::DEBUG) echo __FUNCTION__ . "\n"; + $this->canvas->scale($x, $y); + } + + public function rotate($angle) + { + if (self::DEBUG) echo __FUNCTION__ . "\n"; + $this->canvas->rotate($angle); + } + + public function translate($x, $y) + { + if (self::DEBUG) echo __FUNCTION__ . "\n"; + $this->canvas->translate($x, $y); + } + + public function transform($a, $b, $c, $d, $e, $f) + { + if (self::DEBUG) echo __FUNCTION__ . "\n"; + $this->canvas->concat($a, $b, $c, $d, $e, $f); + } + + public function beginPath() + { + if (self::DEBUG) echo __FUNCTION__ . "\n"; + // TODO: Implement beginPath() method. + } + + public function closePath() + { + if (self::DEBUG) echo __FUNCTION__ . "\n"; + $this->canvas->closepath(); + } + + public function fillStroke() + { + if (self::DEBUG) echo __FUNCTION__ . "\n"; + $this->canvas->fill_stroke(); + } + + public function clip() + { + if (self::DEBUG) echo __FUNCTION__ . "\n"; + $this->canvas->clip(); + } + + public function fillText($text, $x, $y, $maxWidth = null) + { + if (self::DEBUG) echo __FUNCTION__ . "\n"; + $this->canvas->set_text_pos($x, $y); + $this->canvas->show($text); + } + + public function strokeText($text, $x, $y, $maxWidth = null) + { + if (self::DEBUG) echo __FUNCTION__ . "\n"; + // TODO: Implement drawImage() method. + } + + public function drawImage($image, $sx, $sy, $sw = null, $sh = null, $dx = null, $dy = null, $dw = null, $dh = null) + { + if (self::DEBUG) echo __FUNCTION__ . "\n"; + + if (strpos($image, "data:") === 0) { + $data = substr($image, strpos($image, ";") + 1); + if (strpos($data, "base64") === 0) { + $data = base64_decode(substr($data, 7)); + } + } + else { + $data = file_get_contents($image); + } + + $image = tempnam("", "svg"); + file_put_contents($image, $data); + + $img = $this->canvas->load_image("auto", $image, ""); + + $sy = $sy - $sh; + $this->canvas->fit_image($img, $sx, $sy, 'boxsize={' . "$sw $sh" . '} fitmethod=entire'); + + unlink($image); + } + + public function lineTo($x, $y) + { + if (self::DEBUG) echo __FUNCTION__ . "\n"; + $this->canvas->lineto($x, $y); + } + + public function moveTo($x, $y) + { + if (self::DEBUG) echo __FUNCTION__ . "\n"; + $this->canvas->moveto($x, $y); + } + + public function quadraticCurveTo($cpx, $cpy, $x, $y) + { + if (self::DEBUG) echo __FUNCTION__ . "\n"; + + // FIXME not accurate + $this->canvas->curveTo($cpx, $cpy, $cpx, $cpy, $x, $y); + } + + public function bezierCurveTo($cp1x, $cp1y, $cp2x, $cp2y, $x, $y) + { + if (self::DEBUG) echo __FUNCTION__ . "\n"; + $this->canvas->curveto($cp1x, $cp1y, $cp2x, $cp2y, $x, $y); + } + + public function arcTo($x1, $y1, $x2, $y2, $radius) + { + if (self::DEBUG) echo __FUNCTION__ . "\n"; + } + + public function arc($x, $y, $radius, $startAngle, $endAngle, $anticlockwise = false) + { + if (self::DEBUG) echo __FUNCTION__ . "\n"; + $this->canvas->arc($x, $y, $radius, $startAngle, $endAngle); + } + + public function circle($x, $y, $radius) + { + if (self::DEBUG) echo __FUNCTION__ . "\n"; + $this->canvas->circle($x, $y, $radius); + } + + public function ellipse($x, $y, $radiusX, $radiusY, $rotation, $startAngle, $endAngle, $anticlockwise) + { + if (self::DEBUG) echo __FUNCTION__ . "\n"; + $this->canvas->ellipse($x, $y, $radiusX, $radiusY); + } + + public function fillRect($x, $y, $w, $h) + { + if (self::DEBUG) echo __FUNCTION__ . "\n"; + $this->rect($x, $y, $w, $h); + $this->fill(); + } + + public function rect($x, $y, $w, $h, $rx = 0, $ry = 0) + { + if (self::DEBUG) echo __FUNCTION__ . "\n"; + + $canvas = $this->canvas; + + if ($rx <= 0.000001/* && $ry <= 0.000001*/) { + $canvas->rect($x, $y, $w, $h); + + return; + } + + /* Define a path for a rectangle with corners rounded by a given radius. + * Start from the lower left corner and proceed counterclockwise. + */ + $canvas->moveto($x + $rx, $y); + + /* Start of the arc segment in the lower right corner */ + $canvas->lineto($x + $w - $rx, $y); + + /* Arc segment in the lower right corner */ + $canvas->arc($x + $w - $rx, $y + $rx, $rx, 270, 360); + + /* Start of the arc segment in the upper right corner */ + $canvas->lineto($x + $w, $y + $h - $rx ); + + /* Arc segment in the upper right corner */ + $canvas->arc($x + $w - $rx, $y + $h - $rx, $rx, 0, 90); + + /* Start of the arc segment in the upper left corner */ + $canvas->lineto($x + $rx, $y + $h); + + /* Arc segment in the upper left corner */ + $canvas->arc($x + $rx, $y + $h - $rx, $rx, 90, 180); + + /* Start of the arc segment in the lower left corner */ + $canvas->lineto($x , $y + $rx); + + /* Arc segment in the lower left corner */ + $canvas->arc($x + $rx, $y + $rx, $rx, 180, 270); + } + + public function fill() + { + if (self::DEBUG) echo __FUNCTION__ . "\n"; + $this->canvas->fill(); + } + + public function strokeRect($x, $y, $w, $h) + { + if (self::DEBUG) echo __FUNCTION__ . "\n"; + $this->rect($x, $y, $w, $h); + $this->stroke(); + } + + public function stroke() + { + if (self::DEBUG) echo __FUNCTION__ . "\n"; + $this->canvas->stroke(); + } + + public function endPath() + { + if (self::DEBUG) echo __FUNCTION__ . "\n"; + $this->canvas->endPath(); + } + + public function measureText($text) + { + if (self::DEBUG) echo __FUNCTION__ . "\n"; + $style = $this->getStyle(); + $font = $this->getFont($style->fontFamily, $style->fontStyle); + + return $this->canvas->stringwidth($text, $font, $this->getStyle()->fontSize); + } + + public function getStyle() + { + if (self::DEBUG) echo __FUNCTION__ . "\n"; + return $this->style; + } + + public function setStyle(Style $style) + { + if (self::DEBUG) echo __FUNCTION__ . "\n"; + + $this->style = $style; + $canvas = $this->canvas; + + if ($stroke = $style->stroke && is_array($style->stroke)) { + $canvas->setcolor( + "stroke", + "rgb", + $stroke[0] / 255, + $stroke[1] / 255, + $stroke[2] / 255, + null + ); + } + + if ($fill = $style->fill && is_array($style->fill)) { + $canvas->setcolor( + "fill", + "rgb", + $fill[0] / 255, + $fill[1] / 255, + $fill[2] / 255, + null + ); + } + + if ($fillRule = strtolower($style->fillRule)) { + $map = array( + "nonzero" => "winding", + "evenodd" => "evenodd", + ); + + if (isset($map[$fillRule])) { + $fillRule = $map[$fillRule]; + + $canvas->set_parameter("fillrule", $fillRule); + } + } + + $opts = array(); + if ($style->strokeWidth > 0.000001) { + $opts[] = "linewidth=$style->strokeWidth"; + } + + if (in_array($style->strokeLinecap, array("butt", "round", "projecting"))) { + $opts[] = "linecap=$style->strokeLinecap"; + } + + if (in_array($style->strokeLinejoin, array("miter", "round", "bevel"))) { + $opts[] = "linejoin=$style->strokeLinejoin"; + } + + $canvas->set_graphics_option(implode(" ", $opts)); + + $opts = array(); + $opacity = $style->opacity; + if ($opacity !== null && $opacity < 1.0) { + $opts[] = "opacityfill=$opacity"; + $opts[] = "opacitystroke=$opacity"; + } + else { + $fillOpacity = $style->fillOpacity; + if ($fillOpacity !== null && $fillOpacity < 1.0) { + $opts[] = "opacityfill=$fillOpacity"; + } + + $strokeOpacity = $style->strokeOpacity; + if ($strokeOpacity !== null && $strokeOpacity < 1.0) { + $opts[] = "opacitystroke=$strokeOpacity"; + } + } + + if (count($opts)) { + $gs = $canvas->create_gstate(implode(" ", $opts)); + $canvas->set_gstate($gs); + } + + $font = $this->getFont($style->fontFamily, $style->fontStyle); + if ($font) { + $canvas->setfont($font, $style->fontSize); + } + } + + private function getFont($family, $style) + { + $map = array( + "serif" => "Times", + "sans-serif" => "Helvetica", + "fantasy" => "Symbol", + "cursive" => "Times", + "monospace" => "Courier", + + "arial" => "Helvetica", + "verdana" => "Helvetica", + ); + + $family = strtolower($family); + if (isset($map[$family])) { + $family = $map[$family]; + } + + return $this->canvas->load_font($family, "unicode", "fontstyle=$style"); + } + + public function setFont($family, $style, $weight) + { + // TODO: Implement setFont() method. + } +} \ No newline at end of file diff --git a/lib/dompdf/lib/php-svg-lib/src/Svg/Tag/AbstractTag.php b/lib/dompdf/lib/php-svg-lib/src/Svg/Tag/AbstractTag.php new file mode 100644 index 0000000..7101ade --- /dev/null +++ b/lib/dompdf/lib/php-svg-lib/src/Svg/Tag/AbstractTag.php @@ -0,0 +1,183 @@ + + * @license GNU LGPLv3+ http://www.gnu.org/copyleft/lesser.html + */ + +namespace Svg\Tag; + +use Svg\Document; +use Svg\Style; + +abstract class AbstractTag +{ + /** @var Document */ + protected $document; + + public $tagName; + + /** @var Style */ + protected $style; + + protected $attributes = array(); + + protected $hasShape = true; + + /** @var self[] */ + protected $children = array(); + + public function __construct(Document $document, $tagName) + { + $this->document = $document; + $this->tagName = $tagName; + } + + public function getDocument(){ + return $this->document; + } + + /** + * @return Group|null + */ + public function getParentGroup() { + $stack = $this->getDocument()->getStack(); + for ($i = count($stack)-2; $i >= 0; $i--) { + $tag = $stack[$i]; + + if ($tag instanceof Group || $tag instanceof Document) { + return $tag; + } + } + + return null; + } + + public function handle($attributes) + { + $this->attributes = $attributes; + + if (!$this->getDocument()->inDefs) { + $this->before($attributes); + $this->start($attributes); + } + } + + public function handleEnd() + { + if (!$this->getDocument()->inDefs) { + $this->end(); + $this->after(); + } + } + + protected function before($attributes) + { + } + + protected function start($attributes) + { + } + + protected function end() + { + } + + protected function after() + { + } + + public function getAttributes() + { + return $this->attributes; + } + + protected function setStyle(Style $style) + { + $this->style = $style; + + if ($style->display === "none") { + $this->hasShape = false; + } + } + + /** + * @return Style + */ + public function getStyle() + { + return $this->style; + } + + /** + * Make a style object from the tag and its attributes + * + * @param array $attributes + * + * @return Style + */ + protected function makeStyle($attributes) { + $style = new Style(); + $style->inherit($this); + $style->fromStyleSheets($this, $attributes); + $style->fromAttributes($attributes); + + return $style; + } + + protected function applyTransform($attributes) + { + + if (isset($attributes["transform"])) { + $surface = $this->document->getSurface(); + + $transform = $attributes["transform"]; + + $match = array(); + preg_match_all( + '/(matrix|translate|scale|rotate|skewX|skewY)\((.*?)\)/is', + $transform, + $match, + PREG_SET_ORDER + ); + + $transformations = array(); + if (count($match[0])) { + foreach ($match as $_match) { + $arguments = preg_split('/[ ,]+/', $_match[2]); + array_unshift($arguments, $_match[1]); + $transformations[] = $arguments; + } + } + + foreach ($transformations as $t) { + switch ($t[0]) { + case "matrix": + $surface->transform($t[1], $t[2], $t[3], $t[4], $t[5], $t[6]); + break; + + case "translate": + $surface->translate($t[1], isset($t[2]) ? $t[2] : 0); + break; + + case "scale": + $surface->scale($t[1], isset($t[2]) ? $t[2] : $t[1]); + break; + + case "rotate": + $surface->rotate($t[1]); + break; + + case "skewX": + $surface->skewX($t[1]); + break; + + case "skewY": + $surface->skewY($t[1]); + break; + } + } + } + } +} diff --git a/lib/dompdf/lib/php-svg-lib/src/Svg/Tag/Anchor.php b/lib/dompdf/lib/php-svg-lib/src/Svg/Tag/Anchor.php new file mode 100644 index 0000000..9a4b3fe --- /dev/null +++ b/lib/dompdf/lib/php-svg-lib/src/Svg/Tag/Anchor.php @@ -0,0 +1,14 @@ + + * @license GNU LGPLv3+ http://www.gnu.org/copyleft/lesser.html + */ + +namespace Svg\Tag; + +class Anchor extends Group +{ + +} \ No newline at end of file diff --git a/lib/dompdf/lib/php-svg-lib/src/Svg/Tag/Circle.php b/lib/dompdf/lib/php-svg-lib/src/Svg/Tag/Circle.php new file mode 100644 index 0000000..2e516b4 --- /dev/null +++ b/lib/dompdf/lib/php-svg-lib/src/Svg/Tag/Circle.php @@ -0,0 +1,31 @@ + + * @license GNU LGPLv3+ http://www.gnu.org/copyleft/lesser.html + */ + +namespace Svg\Tag; + +class Circle extends Shape +{ + protected $cx = 0; + protected $cy = 0; + protected $r; + + public function start($attributes) + { + if (isset($attributes['cx'])) { + $this->cx = $attributes['cx']; + } + if (isset($attributes['cy'])) { + $this->cy = $attributes['cy']; + } + if (isset($attributes['r'])) { + $this->r = $attributes['r']; + } + + $this->document->getSurface()->circle($this->cx, $this->cy, $this->r); + } +} \ No newline at end of file diff --git a/lib/dompdf/lib/php-svg-lib/src/Svg/Tag/ClipPath.php b/lib/dompdf/lib/php-svg-lib/src/Svg/Tag/ClipPath.php new file mode 100644 index 0000000..54ee084 --- /dev/null +++ b/lib/dompdf/lib/php-svg-lib/src/Svg/Tag/ClipPath.php @@ -0,0 +1,33 @@ + + * @license GNU LGPLv3+ http://www.gnu.org/copyleft/lesser.html + */ + +namespace Svg\Tag; + +use Svg\Style; + +class ClipPath extends AbstractTag +{ + protected function before($attributes) + { + $surface = $this->document->getSurface(); + + $surface->save(); + + $style = $this->makeStyle($attributes); + + $this->setStyle($style); + $surface->setStyle($style); + + $this->applyTransform($attributes); + } + + protected function after() + { + $this->document->getSurface()->restore(); + } +} \ No newline at end of file diff --git a/lib/dompdf/lib/php-svg-lib/src/Svg/Tag/Ellipse.php b/lib/dompdf/lib/php-svg-lib/src/Svg/Tag/Ellipse.php new file mode 100644 index 0000000..483e51e --- /dev/null +++ b/lib/dompdf/lib/php-svg-lib/src/Svg/Tag/Ellipse.php @@ -0,0 +1,37 @@ + + * @license GNU LGPLv3+ http://www.gnu.org/copyleft/lesser.html + */ + +namespace Svg\Tag; + +class Ellipse extends Shape +{ + protected $cx = 0; + protected $cy = 0; + protected $rx = 0; + protected $ry = 0; + + public function start($attributes) + { + parent::start($attributes); + + if (isset($attributes['cx'])) { + $this->cx = $attributes['cx']; + } + if (isset($attributes['cy'])) { + $this->cy = $attributes['cy']; + } + if (isset($attributes['rx'])) { + $this->rx = $attributes['rx']; + } + if (isset($attributes['ry'])) { + $this->ry = $attributes['ry']; + } + + $this->document->getSurface()->ellipse($this->cx, $this->cy, $this->rx, $this->ry, 0, 0, 360, false); + } +} \ No newline at end of file diff --git a/lib/dompdf/lib/php-svg-lib/src/Svg/Tag/Group.php b/lib/dompdf/lib/php-svg-lib/src/Svg/Tag/Group.php new file mode 100644 index 0000000..542bfbd --- /dev/null +++ b/lib/dompdf/lib/php-svg-lib/src/Svg/Tag/Group.php @@ -0,0 +1,33 @@ + + * @license GNU LGPLv3+ http://www.gnu.org/copyleft/lesser.html + */ + +namespace Svg\Tag; + +use Svg\Style; + +class Group extends AbstractTag +{ + protected function before($attributes) + { + $surface = $this->document->getSurface(); + + $surface->save(); + + $style = $this->makeStyle($attributes); + + $this->setStyle($style); + $surface->setStyle($style); + + $this->applyTransform($attributes); + } + + protected function after() + { + $this->document->getSurface()->restore(); + } +} \ No newline at end of file diff --git a/lib/dompdf/lib/php-svg-lib/src/Svg/Tag/Image.php b/lib/dompdf/lib/php-svg-lib/src/Svg/Tag/Image.php new file mode 100644 index 0000000..f356b28 --- /dev/null +++ b/lib/dompdf/lib/php-svg-lib/src/Svg/Tag/Image.php @@ -0,0 +1,62 @@ + + * @license GNU LGPLv3+ http://www.gnu.org/copyleft/lesser.html + */ + +namespace Svg\Tag; + +class Image extends AbstractTag +{ + protected $x = 0; + protected $y = 0; + protected $width = 0; + protected $height = 0; + protected $href = null; + + protected function before($attributes) + { + parent::before($attributes); + + $surface = $this->document->getSurface(); + $surface->save(); + + $this->applyTransform($attributes); + } + + public function start($attributes) + { + $document = $this->document; + $height = $this->document->getHeight(); + $this->y = $height; + + if (isset($attributes['x'])) { + $this->x = $attributes['x']; + } + if (isset($attributes['y'])) { + $this->y = $height - $attributes['y']; + } + + if (isset($attributes['width'])) { + $this->width = $attributes['width']; + } + if (isset($attributes['height'])) { + $this->height = $attributes['height']; + } + + if (isset($attributes['xlink:href'])) { + $this->href = $attributes['xlink:href']; + } + + $document->getSurface()->transform(1, 0, 0, -1, 0, $height); + + $document->getSurface()->drawImage($this->href, $this->x, $this->y, $this->width, $this->height); + } + + protected function after() + { + $this->document->getSurface()->restore(); + } +} \ No newline at end of file diff --git a/lib/dompdf/lib/php-svg-lib/src/Svg/Tag/Line.php b/lib/dompdf/lib/php-svg-lib/src/Svg/Tag/Line.php new file mode 100644 index 0000000..42504bc --- /dev/null +++ b/lib/dompdf/lib/php-svg-lib/src/Svg/Tag/Line.php @@ -0,0 +1,38 @@ + + * @license GNU LGPLv3+ http://www.gnu.org/copyleft/lesser.html + */ + +namespace Svg\Tag; + +class Line extends Shape +{ + protected $x1 = 0; + protected $y1 = 0; + + protected $x2 = 0; + protected $y2 = 0; + + public function start($attributes) + { + if (isset($attributes['x1'])) { + $this->x1 = $attributes['x1']; + } + if (isset($attributes['y1'])) { + $this->y1 = $attributes['y1']; + } + if (isset($attributes['x2'])) { + $this->x2 = $attributes['x2']; + } + if (isset($attributes['y2'])) { + $this->y2 = $attributes['y2']; + } + + $surface = $this->document->getSurface(); + $surface->moveTo($this->x1, $this->y1); + $surface->lineTo($this->x2, $this->y2); + } +} \ No newline at end of file diff --git a/lib/dompdf/lib/php-svg-lib/src/Svg/Tag/LinearGradient.php b/lib/dompdf/lib/php-svg-lib/src/Svg/Tag/LinearGradient.php new file mode 100644 index 0000000..605ec23 --- /dev/null +++ b/lib/dompdf/lib/php-svg-lib/src/Svg/Tag/LinearGradient.php @@ -0,0 +1,83 @@ + + * @license GNU LGPLv3+ http://www.gnu.org/copyleft/lesser.html + */ + +namespace Svg\Tag; + + +use Svg\Gradient; +use Svg\Style; + +class LinearGradient extends AbstractTag +{ + protected $x1; + protected $y1; + protected $x2; + protected $y2; + + /** @var Gradient\Stop[] */ + protected $stops = array(); + + public function start($attributes) + { + parent::start($attributes); + + if (isset($attributes['x1'])) { + $this->x1 = $attributes['x1']; + } + if (isset($attributes['y1'])) { + $this->y1 = $attributes['y1']; + } + if (isset($attributes['x2'])) { + $this->x2 = $attributes['x2']; + } + if (isset($attributes['y2'])) { + $this->y2 = $attributes['y2']; + } + } + + public function getStops() { + if (empty($this->stops)) { + foreach ($this->children as $_child) { + if ($_child->tagName != "stop") { + continue; + } + + $_stop = new Gradient\Stop(); + $_attributes = $_child->attributes; + + // Style + if (isset($_attributes["style"])) { + $_style = Style::parseCssStyle($_attributes["style"]); + + if (isset($_style["stop-color"])) { + $_stop->color = Style::parseColor($_style["stop-color"]); + } + + if (isset($_style["stop-opacity"])) { + $_stop->opacity = max(0, min(1.0, $_style["stop-opacity"])); + } + } + + // Attributes + if (isset($_attributes["offset"])) { + $_stop->offset = $_attributes["offset"]; + } + if (isset($_attributes["stop-color"])) { + $_stop->color = Style::parseColor($_attributes["stop-color"]); + } + if (isset($_attributes["stop-opacity"])) { + $_stop->opacity = max(0, min(1.0, $_attributes["stop-opacity"])); + } + + $this->stops[] = $_stop; + } + } + + return $this->stops; + } +} \ No newline at end of file diff --git a/lib/dompdf/lib/php-svg-lib/src/Svg/Tag/Path.php b/lib/dompdf/lib/php-svg-lib/src/Svg/Tag/Path.php new file mode 100644 index 0000000..c43d638 --- /dev/null +++ b/lib/dompdf/lib/php-svg-lib/src/Svg/Tag/Path.php @@ -0,0 +1,528 @@ + + * @license GNU LGPLv3+ http://www.gnu.org/copyleft/lesser.html + */ + +namespace Svg\Tag; + +use Svg\Surface\SurfaceInterface; + +class Path extends Shape +{ + static $commandLengths = array( + 'm' => 2, + 'l' => 2, + 'h' => 1, + 'v' => 1, + 'c' => 6, + 's' => 4, + 'q' => 4, + 't' => 2, + 'a' => 7, + ); + + static $repeatedCommands = array( + 'm' => 'l', + 'M' => 'L', + ); + + public function start($attributes) + { + if (!isset($attributes['d'])) { + $this->hasShape = false; + + return; + } + + $commands = array(); + preg_match_all('/([MZLHVCSQTAmzlhvcsqta])([eE ,\-.\d]+)*/', $attributes['d'], $commands, PREG_SET_ORDER); + + $path = array(); + foreach ($commands as $c) { + if (count($c) == 3) { + $arguments = array(); + preg_match_all('/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:e[-+]?\d+)?)/i', $c[2], $arguments, PREG_PATTERN_ORDER); + $item = $arguments[0]; + $commandLower = strtolower($c[1]); + + if ( + isset(self::$commandLengths[$commandLower]) && + ($commandLength = self::$commandLengths[$commandLower]) && + count($item) > $commandLength + ) { + $repeatedCommand = isset(self::$repeatedCommands[$c[1]]) ? self::$repeatedCommands[$c[1]] : $c[1]; + $command = $c[1]; + + for ($k = 0, $klen = count($item); $k < $klen; $k += $commandLength) { + $_item = array_slice($item, $k, $k + $commandLength); + array_unshift($_item, $command); + $path[] = $_item; + + $command = $repeatedCommand; + } + } else { + array_unshift($item, $c[1]); + $path[] = $item; + } + + } else { + $item = array($c[1]); + + $path[] = $item; + } + } + + $surface = $this->document->getSurface(); + + // From https://github.com/kangax/fabric.js/blob/master/src/shapes/path.class.js + $current = null; // current instruction + $previous = null; + $subpathStartX = 0; + $subpathStartY = 0; + $x = 0; // current x + $y = 0; // current y + $controlX = 0; // current control point x + $controlY = 0; // current control point y + $tempX = null; + $tempY = null; + $tempControlX = null; + $tempControlY = null; + $l = 0; //-((this.width / 2) + $this.pathOffset.x), + $t = 0; //-((this.height / 2) + $this.pathOffset.y), + $methodName = null; + + foreach ($path as $current) { + switch ($current[0]) { // first letter + case 'l': // lineto, relative + $x += $current[1]; + $y += $current[2]; + $surface->lineTo($x + $l, $y + $t); + break; + + case 'L': // lineto, absolute + $x = $current[1]; + $y = $current[2]; + $surface->lineTo($x + $l, $y + $t); + break; + + case 'h': // horizontal lineto, relative + $x += $current[1]; + $surface->lineTo($x + $l, $y + $t); + break; + + case 'H': // horizontal lineto, absolute + $x = $current[1]; + $surface->lineTo($x + $l, $y + $t); + break; + + case 'v': // vertical lineto, relative + $y += $current[1]; + $surface->lineTo($x + $l, $y + $t); + break; + + case 'V': // verical lineto, absolute + $y = $current[1]; + $surface->lineTo($x + $l, $y + $t); + break; + + case 'm': // moveTo, relative + $x += $current[1]; + $y += $current[2]; + $subpathStartX = $x; + $subpathStartY = $y; + $surface->moveTo($x + $l, $y + $t); + break; + + case 'M': // moveTo, absolute + $x = $current[1]; + $y = $current[2]; + $subpathStartX = $x; + $subpathStartY = $y; + $surface->moveTo($x + $l, $y + $t); + break; + + case 'c': // bezierCurveTo, relative + $tempX = $x + $current[5]; + $tempY = $y + $current[6]; + $controlX = $x + $current[3]; + $controlY = $y + $current[4]; + $surface->bezierCurveTo( + $x + $current[1] + $l, // x1 + $y + $current[2] + $t, // y1 + $controlX + $l, // x2 + $controlY + $t, // y2 + $tempX + $l, + $tempY + $t + ); + $x = $tempX; + $y = $tempY; + break; + + case 'C': // bezierCurveTo, absolute + $x = $current[5]; + $y = $current[6]; + $controlX = $current[3]; + $controlY = $current[4]; + $surface->bezierCurveTo( + $current[1] + $l, + $current[2] + $t, + $controlX + $l, + $controlY + $t, + $x + $l, + $y + $t + ); + break; + + case 's': // shorthand cubic bezierCurveTo, relative + + // transform to absolute x,y + $tempX = $x + $current[3]; + $tempY = $y + $current[4]; + + if (!preg_match('/[CcSs]/', $previous[0])) { + // If there is no previous command or if the previous command was not a C, c, S, or s, + // the control point is coincident with the current point + $controlX = $x; + $controlY = $y; + } else { + // calculate reflection of previous control points + $controlX = 2 * $x - $controlX; + $controlY = 2 * $y - $controlY; + } + + $surface->bezierCurveTo( + $controlX + $l, + $controlY + $t, + $x + $current[1] + $l, + $y + $current[2] + $t, + $tempX + $l, + $tempY + $t + ); + // set control point to 2nd one of this command + // "... the first control point is assumed to be + // the reflection of the second control point on + // the previous command relative to the current point." + $controlX = $x + $current[1]; + $controlY = $y + $current[2]; + + $x = $tempX; + $y = $tempY; + break; + + case 'S': // shorthand cubic bezierCurveTo, absolute + $tempX = $current[3]; + $tempY = $current[4]; + + if (!preg_match('/[CcSs]/', $previous[0])) { + // If there is no previous command or if the previous command was not a C, c, S, or s, + // the control point is coincident with the current point + $controlX = $x; + $controlY = $y; + } else { + // calculate reflection of previous control points + $controlX = 2 * $x - $controlX; + $controlY = 2 * $y - $controlY; + } + + $surface->bezierCurveTo( + $controlX + $l, + $controlY + $t, + $current[1] + $l, + $current[2] + $t, + $tempX + $l, + $tempY + $t + ); + $x = $tempX; + $y = $tempY; + + // set control point to 2nd one of this command + // "... the first control point is assumed to be + // the reflection of the second control point on + // the previous command relative to the current point." + $controlX = $current[1]; + $controlY = $current[2]; + + break; + + case 'q': // quadraticCurveTo, relative + // transform to absolute x,y + $tempX = $x + $current[3]; + $tempY = $y + $current[4]; + + $controlX = $x + $current[1]; + $controlY = $y + $current[2]; + + $surface->quadraticCurveTo( + $controlX + $l, + $controlY + $t, + $tempX + $l, + $tempY + $t + ); + $x = $tempX; + $y = $tempY; + break; + + case 'Q': // quadraticCurveTo, absolute + $tempX = $current[3]; + $tempY = $current[4]; + + $surface->quadraticCurveTo( + $current[1] + $l, + $current[2] + $t, + $tempX + $l, + $tempY + $t + ); + $x = $tempX; + $y = $tempY; + $controlX = $current[1]; + $controlY = $current[2]; + break; + + case 't': // shorthand quadraticCurveTo, relative + + // transform to absolute x,y + $tempX = $x + $current[1]; + $tempY = $y + $current[2]; + + if (preg_match("/[QqTt]/", $previous[0])) { + // If there is no previous command or if the previous command was not a Q, q, T or t, + // assume the control point is coincident with the current point + $controlX = $x; + $controlY = $y; + } else { + if ($previous[0] === 't') { + // calculate reflection of previous control points for t + $controlX = 2 * $x - $tempControlX; + $controlY = 2 * $y - $tempControlY; + } else { + if ($previous[0] === 'q') { + // calculate reflection of previous control points for q + $controlX = 2 * $x - $controlX; + $controlY = 2 * $y - $controlY; + } + } + } + + $tempControlX = $controlX; + $tempControlY = $controlY; + + $surface->quadraticCurveTo( + $controlX + $l, + $controlY + $t, + $tempX + $l, + $tempY + $t + ); + $x = $tempX; + $y = $tempY; + $controlX = $x + $current[1]; + $controlY = $y + $current[2]; + break; + + case 'T': + $tempX = $current[1]; + $tempY = $current[2]; + + // calculate reflection of previous control points + $controlX = 2 * $x - $controlX; + $controlY = 2 * $y - $controlY; + $surface->quadraticCurveTo( + $controlX + $l, + $controlY + $t, + $tempX + $l, + $tempY + $t + ); + $x = $tempX; + $y = $tempY; + break; + + case 'a': + // TODO: optimize this + $this->drawArc( + $surface, + $x + $l, + $y + $t, + array( + $current[1], + $current[2], + $current[3], + $current[4], + $current[5], + $current[6] + $x + $l, + $current[7] + $y + $t + ) + ); + $x += $current[6]; + $y += $current[7]; + break; + + case 'A': + // TODO: optimize this + $this->drawArc( + $surface, + $x + $l, + $y + $t, + array( + $current[1], + $current[2], + $current[3], + $current[4], + $current[5], + $current[6] + $l, + $current[7] + $t + ) + ); + $x = $current[6]; + $y = $current[7]; + break; + + case 'z': + case 'Z': + $x = $subpathStartX; + $y = $subpathStartY; + $surface->closePath(); + break; + } + $previous = $current; + } + } + + function drawArc(SurfaceInterface $surface, $fx, $fy, $coords) + { + $rx = $coords[0]; + $ry = $coords[1]; + $rot = $coords[2]; + $large = $coords[3]; + $sweep = $coords[4]; + $tx = $coords[5]; + $ty = $coords[6]; + $segs = array( + array(), + array(), + array(), + array(), + ); + + $segsNorm = $this->arcToSegments($tx - $fx, $ty - $fy, $rx, $ry, $large, $sweep, $rot); + + for ($i = 0, $len = count($segsNorm); $i < $len; $i++) { + $segs[$i][0] = $segsNorm[$i][0] + $fx; + $segs[$i][1] = $segsNorm[$i][1] + $fy; + $segs[$i][2] = $segsNorm[$i][2] + $fx; + $segs[$i][3] = $segsNorm[$i][3] + $fy; + $segs[$i][4] = $segsNorm[$i][4] + $fx; + $segs[$i][5] = $segsNorm[$i][5] + $fy; + + call_user_func_array(array($surface, "bezierCurveTo"), $segs[$i]); + } + } + + function arcToSegments($toX, $toY, $rx, $ry, $large, $sweep, $rotateX) + { + $th = $rotateX * M_PI / 180; + $sinTh = sin($th); + $cosTh = cos($th); + $fromX = 0; + $fromY = 0; + + $rx = abs($rx); + $ry = abs($ry); + + $px = -$cosTh * $toX * 0.5 - $sinTh * $toY * 0.5; + $py = -$cosTh * $toY * 0.5 + $sinTh * $toX * 0.5; + $rx2 = $rx * $rx; + $ry2 = $ry * $ry; + $py2 = $py * $py; + $px2 = $px * $px; + $pl = $rx2 * $ry2 - $rx2 * $py2 - $ry2 * $px2; + $root = 0; + + if ($pl < 0) { + $s = sqrt(1 - $pl / ($rx2 * $ry2)); + $rx *= $s; + $ry *= $s; + } else { + $root = ($large == $sweep ? -1.0 : 1.0) * sqrt($pl / ($rx2 * $py2 + $ry2 * $px2)); + } + + $cx = $root * $rx * $py / $ry; + $cy = -$root * $ry * $px / $rx; + $cx1 = $cosTh * $cx - $sinTh * $cy + $toX * 0.5; + $cy1 = $sinTh * $cx + $cosTh * $cy + $toY * 0.5; + $mTheta = $this->calcVectorAngle(1, 0, ($px - $cx) / $rx, ($py - $cy) / $ry); + $dtheta = $this->calcVectorAngle(($px - $cx) / $rx, ($py - $cy) / $ry, (-$px - $cx) / $rx, (-$py - $cy) / $ry); + + if ($sweep == 0 && $dtheta > 0) { + $dtheta -= 2 * M_PI; + } else { + if ($sweep == 1 && $dtheta < 0) { + $dtheta += 2 * M_PI; + } + } + + // $Convert $into $cubic $bezier $segments <= 90deg + $segments = ceil(abs($dtheta / M_PI * 2)); + $result = array(); + $mDelta = $dtheta / $segments; + $mT = 8 / 3 * sin($mDelta / 4) * sin($mDelta / 4) / sin($mDelta / 2); + $th3 = $mTheta + $mDelta; + + for ($i = 0; $i < $segments; $i++) { + $result[$i] = $this->segmentToBezier( + $mTheta, + $th3, + $cosTh, + $sinTh, + $rx, + $ry, + $cx1, + $cy1, + $mT, + $fromX, + $fromY + ); + $fromX = $result[$i][4]; + $fromY = $result[$i][5]; + $mTheta = $th3; + $th3 += $mDelta; + } + + return $result; + } + + function segmentToBezier($th2, $th3, $cosTh, $sinTh, $rx, $ry, $cx1, $cy1, $mT, $fromX, $fromY) + { + $costh2 = cos($th2); + $sinth2 = sin($th2); + $costh3 = cos($th3); + $sinth3 = sin($th3); + $toX = $cosTh * $rx * $costh3 - $sinTh * $ry * $sinth3 + $cx1; + $toY = $sinTh * $rx * $costh3 + $cosTh * $ry * $sinth3 + $cy1; + $cp1X = $fromX + $mT * (-$cosTh * $rx * $sinth2 - $sinTh * $ry * $costh2); + $cp1Y = $fromY + $mT * (-$sinTh * $rx * $sinth2 + $cosTh * $ry * $costh2); + $cp2X = $toX + $mT * ($cosTh * $rx * $sinth3 + $sinTh * $ry * $costh3); + $cp2Y = $toY + $mT * ($sinTh * $rx * $sinth3 - $cosTh * $ry * $costh3); + + return array( + $cp1X, + $cp1Y, + $cp2X, + $cp2Y, + $toX, + $toY + ); + } + + function calcVectorAngle($ux, $uy, $vx, $vy) + { + $ta = atan2($uy, $ux); + $tb = atan2($vy, $vx); + if ($tb >= $ta) { + return $tb - $ta; + } else { + return 2 * M_PI - ($ta - $tb); + } + } +} \ No newline at end of file diff --git a/lib/dompdf/lib/php-svg-lib/src/Svg/Tag/Polygon.php b/lib/dompdf/lib/php-svg-lib/src/Svg/Tag/Polygon.php new file mode 100644 index 0000000..3100c5e --- /dev/null +++ b/lib/dompdf/lib/php-svg-lib/src/Svg/Tag/Polygon.php @@ -0,0 +1,33 @@ + + * @license GNU LGPLv3+ http://www.gnu.org/copyleft/lesser.html + */ + +namespace Svg\Tag; + +class Polygon extends Shape +{ + public function start($attributes) + { + $tmp = array(); + preg_match_all('/([\-]*[0-9\.]+)/', $attributes['points'], $tmp); + + $points = $tmp[0]; + $count = count($points); + + $surface = $this->document->getSurface(); + list($x, $y) = $points; + $surface->moveTo($x, $y); + + for ($i = 2; $i < $count; $i += 2) { + $x = $points[$i]; + $y = $points[$i + 1]; + $surface->lineTo($x, $y); + } + + $surface->closePath(); + } +} \ No newline at end of file diff --git a/lib/dompdf/lib/php-svg-lib/src/Svg/Tag/Polyline.php b/lib/dompdf/lib/php-svg-lib/src/Svg/Tag/Polyline.php new file mode 100644 index 0000000..c2837f5 --- /dev/null +++ b/lib/dompdf/lib/php-svg-lib/src/Svg/Tag/Polyline.php @@ -0,0 +1,31 @@ + + * @license GNU LGPLv3+ http://www.gnu.org/copyleft/lesser.html + */ + +namespace Svg\Tag; + +class Polyline extends Shape +{ + public function start($attributes) + { + $tmp = array(); + preg_match_all('/([\-]*[0-9\.]+)/', $attributes['points'], $tmp); + + $points = $tmp[0]; + $count = count($points); + + $surface = $this->document->getSurface(); + list($x, $y) = $points; + $surface->moveTo($x, $y); + + for ($i = 2; $i < $count; $i += 2) { + $x = $points[$i]; + $y = $points[$i + 1]; + $surface->lineTo($x, $y); + } + } +} \ No newline at end of file diff --git a/lib/dompdf/lib/php-svg-lib/src/Svg/Tag/RadialGradient.php b/lib/dompdf/lib/php-svg-lib/src/Svg/Tag/RadialGradient.php new file mode 100644 index 0000000..93987b3 --- /dev/null +++ b/lib/dompdf/lib/php-svg-lib/src/Svg/Tag/RadialGradient.php @@ -0,0 +1,17 @@ + + * @license GNU LGPLv3+ http://www.gnu.org/copyleft/lesser.html + */ + +namespace Svg\Tag; + +class RadialGradient extends AbstractTag +{ + public function start($attributes) + { + + } +} \ No newline at end of file diff --git a/lib/dompdf/lib/php-svg-lib/src/Svg/Tag/Rect.php b/lib/dompdf/lib/php-svg-lib/src/Svg/Tag/Rect.php new file mode 100644 index 0000000..7d32127 --- /dev/null +++ b/lib/dompdf/lib/php-svg-lib/src/Svg/Tag/Rect.php @@ -0,0 +1,45 @@ + + * @license GNU LGPLv3+ http://www.gnu.org/copyleft/lesser.html + */ + +namespace Svg\Tag; + +class Rect extends Shape +{ + protected $x = 0; + protected $y = 0; + protected $width = 0; + protected $height = 0; + protected $rx = 0; + protected $ry = 0; + + public function start($attributes) + { + if (isset($attributes['x'])) { + $this->x = $attributes['x']; + } + if (isset($attributes['y'])) { + $this->y = $attributes['y']; + } + + if (isset($attributes['width'])) { + $this->width = $attributes['width']; + } + if (isset($attributes['height'])) { + $this->height = $attributes['height']; + } + + if (isset($attributes['rx'])) { + $this->rx = $attributes['rx']; + } + if (isset($attributes['ry'])) { + $this->ry = $attributes['ry']; + } + + $this->document->getSurface()->rect($this->x, $this->y, $this->width, $this->height, $this->rx, $this->ry); + } +} \ No newline at end of file diff --git a/lib/dompdf/lib/php-svg-lib/src/Svg/Tag/Shape.php b/lib/dompdf/lib/php-svg-lib/src/Svg/Tag/Shape.php new file mode 100644 index 0000000..0a2bfae --- /dev/null +++ b/lib/dompdf/lib/php-svg-lib/src/Svg/Tag/Shape.php @@ -0,0 +1,63 @@ + + * @license GNU LGPLv3+ http://www.gnu.org/copyleft/lesser.html + */ + +namespace Svg\Tag; + +use Svg\Style; + +class Shape extends AbstractTag +{ + protected function before($attributes) + { + $surface = $this->document->getSurface(); + + $surface->save(); + + $style = $this->makeStyle($attributes); + + $this->setStyle($style); + $surface->setStyle($style); + + $this->applyTransform($attributes); + } + + protected function after() + { + $surface = $this->document->getSurface(); + + if ($this->hasShape) { + $style = $surface->getStyle(); + + $fill = $style->fill && is_array($style->fill); + $stroke = $style->stroke && is_array($style->stroke); + + if ($fill) { + if ($stroke) { + $surface->fillStroke(); + } else { +// if (is_string($style->fill)) { +// /** @var LinearGradient|RadialGradient $gradient */ +// $gradient = $this->getDocument()->getDef($style->fill); +// +// var_dump($gradient->getStops()); +// } + + $surface->fill(); + } + } + elseif ($stroke) { + $surface->stroke(); + } + else { + $surface->endPath(); + } + } + + $surface->restore(); + } +} \ No newline at end of file diff --git a/lib/dompdf/lib/php-svg-lib/src/Svg/Tag/Stop.php b/lib/dompdf/lib/php-svg-lib/src/Svg/Tag/Stop.php new file mode 100644 index 0000000..666a2ac --- /dev/null +++ b/lib/dompdf/lib/php-svg-lib/src/Svg/Tag/Stop.php @@ -0,0 +1,17 @@ + + * @license GNU LGPLv3+ http://www.gnu.org/copyleft/lesser.html + */ + +namespace Svg\Tag; + +class Stop extends AbstractTag +{ + public function start($attributes) + { + + } +} \ No newline at end of file diff --git a/lib/dompdf/lib/php-svg-lib/src/Svg/Tag/StyleTag.php b/lib/dompdf/lib/php-svg-lib/src/Svg/Tag/StyleTag.php new file mode 100644 index 0000000..cda5493 --- /dev/null +++ b/lib/dompdf/lib/php-svg-lib/src/Svg/Tag/StyleTag.php @@ -0,0 +1,27 @@ + + * @license GNU LGPLv3+ http://www.gnu.org/copyleft/lesser.html + */ + +namespace Svg\Tag; + +use Sabberworm\CSS; + +class StyleTag extends AbstractTag +{ + protected $text = ""; + + public function end() + { + $parser = new CSS\Parser($this->text); + $this->document->appendStyleSheet($parser->parse()); + } + + public function appendText($text) + { + $this->text .= $text; + } +} \ No newline at end of file diff --git a/lib/dompdf/lib/php-svg-lib/src/Svg/Tag/Text.php b/lib/dompdf/lib/php-svg-lib/src/Svg/Tag/Text.php new file mode 100644 index 0000000..83b5afe --- /dev/null +++ b/lib/dompdf/lib/php-svg-lib/src/Svg/Tag/Text.php @@ -0,0 +1,70 @@ + + * @license GNU LGPLv3+ http://www.gnu.org/copyleft/lesser.html + */ + +namespace Svg\Tag; + +class Text extends Shape +{ + protected $x = 0; + protected $y = 0; + protected $text = ""; + + public function start($attributes) + { + $document = $this->document; + $height = $this->document->getHeight(); + $this->y = $height; + + if (isset($attributes['x'])) { + $this->x = $attributes['x']; + } + if (isset($attributes['y'])) { + $this->y = $height - $attributes['y']; + } + + $document->getSurface()->transform(1, 0, 0, -1, 0, $height); + } + + public function end() + { + $surface = $this->document->getSurface(); + $x = $this->x; + $y = $this->y; + $style = $surface->getStyle(); + $surface->setFont($style->fontFamily, $style->fontStyle, $style->fontWeight); + + switch ($style->textAnchor) { + case "middle": + $width = $surface->measureText($this->text); + $x -= $width / 2; + break; + + case "end": + $width = $surface->measureText($this->text); + $x -= $width; + break; + } + + $surface->fillText($this->getText(), $x, $y); + } + + protected function after() + { + $this->document->getSurface()->restore(); + } + + public function appendText($text) + { + $this->text .= $text; + } + + public function getText() + { + return trim($this->text); + } +} diff --git a/lib/dompdf/lib/php-svg-lib/src/Svg/Tag/UseTag.php b/lib/dompdf/lib/php-svg-lib/src/Svg/Tag/UseTag.php new file mode 100644 index 0000000..b88a6cc --- /dev/null +++ b/lib/dompdf/lib/php-svg-lib/src/Svg/Tag/UseTag.php @@ -0,0 +1,96 @@ + + * @license GNU LGPLv3+ http://www.gnu.org/copyleft/lesser.html + */ + +namespace Svg\Tag; + +class UseTag extends AbstractTag +{ + protected $x = 0; + protected $y = 0; + protected $width; + protected $height; + + /** @var AbstractTag */ + protected $reference; + + protected function before($attributes) + { + if (isset($attributes['x'])) { + $this->x = $attributes['x']; + } + if (isset($attributes['y'])) { + $this->y = $attributes['y']; + } + + if (isset($attributes['width'])) { + $this->width = $attributes['width']; + } + if (isset($attributes['height'])) { + $this->height = $attributes['height']; + } + + parent::before($attributes); + + $document = $this->getDocument(); + + $link = $attributes["xlink:href"]; + $this->reference = $document->getDef($link); + + if ($this->reference) { + $this->reference->before($attributes); + } + + $surface = $document->getSurface(); + $surface->save(); + + $surface->translate($this->x, $this->y); + } + + protected function after() { + parent::after(); + + if ($this->reference) { + $this->reference->after(); + } + + $this->getDocument()->getSurface()->restore(); + } + + public function handle($attributes) + { + parent::handle($attributes); + + if (!$this->reference) { + return; + } + + $attributes = array_merge($this->reference->attributes, $attributes); + + $this->reference->handle($attributes); + + foreach ($this->reference->children as $_child) { + $_attributes = array_merge($_child->attributes, $attributes); + $_child->handle($_attributes); + } + } + + public function handleEnd() + { + parent::handleEnd(); + + if (!$this->reference) { + return; + } + + $this->reference->handleEnd(); + + foreach ($this->reference->children as $_child) { + $_child->handleEnd(); + } + } +} \ No newline at end of file diff --git a/lib/dompdf/lib/php-svg-lib/src/autoload.php b/lib/dompdf/lib/php-svg-lib/src/autoload.php new file mode 100644 index 0000000..b0e2b9c --- /dev/null +++ b/lib/dompdf/lib/php-svg-lib/src/autoload.php @@ -0,0 +1,17 @@ + + * @license GNU LGPLv3+ http://www.gnu.org/copyleft/lesser.html + */ + +spl_autoload_register(function($class) { + if (0 === strpos($class, "Svg")) { + $file = str_replace('\\', DIRECTORY_SEPARATOR, $class); + $file = realpath(__DIR__ . DIRECTORY_SEPARATOR . $file . '.php'); + if (file_exists($file)) { + include_once $file; + } + } +}); \ No newline at end of file diff --git a/lib/dompdf/lib/php-svg-lib/tests/Svg/StyleTest.php b/lib/dompdf/lib/php-svg-lib/tests/Svg/StyleTest.php new file mode 100644 index 0000000..cce3d84 --- /dev/null +++ b/lib/dompdf/lib/php-svg-lib/tests/Svg/StyleTest.php @@ -0,0 +1,60 @@ +assertEquals("none", Style::parseColor("none")); + $this->assertEquals(array(255, 0, 0), Style::parseColor("RED")); + $this->assertEquals(array(0, 0, 255), Style::parseColor("blue")); + $this->assertEquals(null, Style::parseColor("foo")); + $this->assertEquals(array(0, 0, 0), Style::parseColor("black")); + $this->assertEquals(array(255, 255, 255), Style::parseColor("white")); + $this->assertEquals(array(0, 0, 0), Style::parseColor("#000000")); + $this->assertEquals(array(255, 255, 255), Style::parseColor("#ffffff")); + $this->assertEquals(array(0, 0, 0), Style::parseColor("rgb(0,0,0)")); + $this->assertEquals(array(255, 255, 255), Style::parseColor("rgb(255,255,255)")); + $this->assertEquals(array(0, 0, 0), Style::parseColor("rgb(0, 0, 0)")); + $this->assertEquals(array(255, 255, 255), Style::parseColor("rgb(255, 255, 255)")); + } + + public function test_fromAttributes() + { + $style = new Style(); + + $attributes = array( + "color" => "blue", + "fill" => "#fff", + "stroke" => "none", + ); + + $style->fromAttributes($attributes); + + $this->assertEquals(array(0, 0, 255), $style->color); + $this->assertEquals(array(255, 255, 255), $style->fill); + $this->assertEquals("none", $style->stroke); + } + + public function test_convertSize() + { + $this->assertEquals(1, Style::convertSize(1)); + $this->assertEquals(10, Style::convertSize("10px")); // FIXME + $this->assertEquals(10, Style::convertSize("10pt")); + $this->assertEquals(8, Style::convertSize("80%", 10, 72)); + } + +} + diff --git a/lib/dompdf/lib/res/broken_image.png b/lib/dompdf/lib/res/broken_image.png new file mode 100644 index 0000000..771a1a3 Binary files /dev/null and b/lib/dompdf/lib/res/broken_image.png differ diff --git a/lib/dompdf/lib/res/html.css b/lib/dompdf/lib/res/html.css new file mode 100644 index 0000000..05d4a60 --- /dev/null +++ b/lib/dompdf/lib/res/html.css @@ -0,0 +1,521 @@ +/** + * dompdf default stylesheet. + * + * @package dompdf + * @link http://dompdf.github.com/ + * @author Benj Carson + * @author Blake Ross + * @author Fabien Ménager + * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + * + * Portions from Mozilla + * @link https://dxr.mozilla.org/mozilla-central/source/layout/style/res/html.css + * @license http://mozilla.org/MPL/2.0/ Mozilla Public License, v. 2.0 + * + * Portions from W3C + * @link https://drafts.csswg.org/css-ui-3/#default-style-sheet + * + */ + +@page { + margin: 1.2cm; +} + +html { + display: -dompdf-page; + counter-reset: page; +} + +/* blocks */ + +article, +aside, +details, +div, +dt, +figcaption, +footer, +form, +header, +hgroup, +main, +nav, +noscript, +section, +summary { + display: block; +} + +body { + page-break-before: avoid; + display: block; + counter-increment: page; +} + +p, dl, multicol { + display: block; + margin: 1em 0; +} + +dd { + display: block; + margin-left: 40px; +} + +blockquote, figure { + display: block; + margin: 1em 40px; +} + +address { + display: block; + font-style: italic; +} + +center { + display: block; + text-align: center; +} + +blockquote[type=cite] { + display: block; + margin: 1em 0; + padding-left: 1em; + border-left: solid; + border-color: blue; + border-width: thin; +} + +h1, h2, h3, h4, h5, h6 { + display: block; + font-weight: bold; +} + +h1 { + font-size: 2em; + margin: .67em 0; +} + +h2 { + font-size: 1.5em; + margin: .83em 0; +} + +h3 { + font-size: 1.17em; + margin: 1em 0; +} + +h4 { + margin: 1.33em 0; +} + +h5 { + font-size: 0.83em; + margin: 1.67em 0; +} + +h6 { + font-size: 0.67em; + margin: 2.33em 0; +} + +listing { + display: block; + font-family: fixed; + font-size: medium; + white-space: pre; + margin: 1em 0; +} + +plaintext, pre, xmp { + display: block; + font-family: fixed; + white-space: pre; + margin: 1em 0; +} + +/* tables */ + +table { + display: table; + border-spacing: 2px; + border-collapse: separate; + margin-top: 0; + margin-bottom: 0; + text-indent: 0; + text-align: left; /* quirk */ +} + +table[border] { + border-style: outset; + border-color: gray; +} + +/* This won't work (???) */ +/* +table[border] td, +table[border] th { + border: 1pt solid grey; +}*/ + +/* make sure backgrounds are inherited in tables -- see bug 4510 */ +td, th, tr { + background: inherit; +} + +/* caption inherits from table not table-outer */ +caption { + display: table-caption; + text-align: center; +} + +tr { + display: table-row; + vertical-align: inherit; +} + +col { + display: table-column; +} + +colgroup { + display: table-column-group; +} + +tbody { + display: table-row-group; + vertical-align: middle; +} + +thead { + display: table-header-group; + vertical-align: middle; +} + +tfoot { + display: table-footer-group; + vertical-align: middle; +} + +/* To simulate tbody auto-insertion */ +table > tr { + vertical-align: middle; +} + +td { + display: table-cell; + vertical-align: inherit; + text-align: inherit; + padding: 1px; +} + +th { + display: table-cell; + vertical-align: inherit; + font-weight: bold; + padding: 1px; +} + +/* inlines */ +q { + quotes: '"' '"' "'" "'"; /* FIXME only the first level is used */ +} + +q:before { + content: open-quote; +} + +q:after { + content: close-quote; +} + +:link { + color: #00c; + text-decoration: underline; +} + +b, strong { + font-weight: bolder; +} + +i, cite, em, var, dfn { + font-style: italic; +} + +tt, code, kbd, samp { + font-family: fixed; +} + +u, ins { + text-decoration: underline; +} + +s, strike, del { + text-decoration: line-through; +} + +big { + font-size: larger; +} + +small { + font-size: smaller; +} + +sub { + vertical-align: sub; + font-size: smaller; + line-height: normal; +} + +sup { + vertical-align: super; + font-size: smaller; + line-height: normal; +} + +nobr { + white-space: nowrap; +} + +mark { + background: yellow; + color: black; +} + +/* titles */ + +abbr[title], acronym[title] { + text-decoration: dotted underline; +} + +/* lists */ + +ul, menu, dir { + display: block; + list-style-type: disc; + margin: 1em 0; + padding-left: 40px; +} + +ol { + display: block; + list-style-type: decimal; + margin: 1em 0; + padding-left: 40px; +} + +li { + display: list-item; +} + +/*li:before { + display: -dompdf-list-bullet !important; + content: counter(-dompdf-default-counter) ". "; + padding-right: 0.5em; +}*/ + +/* nested lists have no top/bottom margins */ +:matches(ul, ol, dir, menu, dl) ul, +:matches(ul, ol, dir, menu, dl) ol, +:matches(ul, ol, dir, menu, dl) dir, +:matches(ul, ol, dir, menu, dl) menu, +:matches(ul, ol, dir, menu, dl) dl { + margin-top: 0; + margin-bottom: 0; +} + +/* 2 deep unordered lists use a circle */ +:matches(ul, ol, dir, menu) ul, +:matches(ul, ol, dir, menu) ul, +:matches(ul, ol, dir, menu) ul, +:matches(ul, ol, dir, menu) ul { + list-style-type: circle; +} + +/* 3 deep (or more) unordered lists use a square */ +:matches(ul, ol, dir, menu) :matches(ul, ol, dir, menu) ul, +:matches(ul, ol, dir, menu) :matches(ul, ol, dir, menu) menu, +:matches(ul, ol, dir, menu) :matches(ul, ol, dir, menu) dir { + list-style-type: square; +} + +/* forms */ +/* From https://drafts.csswg.org/css-ui-3/#default-style-sheet */ +form { + display: block; +} + +input, button, select { + display: inline-block; + font-family: sans-serif; +} + +input[type=text], +input[type=password], +select { + width: 12em; +} + +input[type=text], +input[type=password], +input[type=button], +input[type=submit], +input[type=reset], +input[type=file], +button, +textarea, +select { + background: #FFF; + border: 1px solid #999; + padding: 2px; + margin: 2px; +} + +input[type=button], +input[type=submit], +input[type=reset], +input[type=file], +button { + background: #CCC; + text-align: center; +} + +input[type=file] { + width: 8em; +} + +input[type=text]:before, +input[type=button]:before, +input[type=submit]:before, +input[type=reset]:before { + content: attr(value); +} + +input[type=file]:before { + content: "Choose a file"; +} + +input[type=password][value]:before { + font-family: "DejaVu Sans" !important; + content: "\2022\2022\2022\2022\2022\2022\2022\2022"; + line-height: 1em; +} + +input[type=checkbox], +input[type=radio], +select:after { + font-family: "DejaVu Sans" !important; + font-size: 18px; + line-height: 1; +} + +input[type=checkbox]:before { + content: "\2610"; +} + +input[type=checkbox][checked]:before { + content: "\2611"; +} + +input[type=radio]:before { + content: "\25CB"; +} + +input[type=radio][checked]:before { + content: "\25C9"; +} + +textarea { + display: block; + height: 3em; + overflow: hidden; + font-family: monospace; + white-space: pre-wrap; + word-wrap: break-word; +} + +select { + position: relative!important; + overflow: hidden!important; +} + +select:after { + position: absolute; + right: 0; + top: 0; + height: 5em; + width: 1.4em; + text-align: center; + background: #CCC; + content: "\25BE"; +} + +select option { + display: none; +} + +select option[selected] { + display: inline; +} + +fieldset { + display: block; + margin: 0.6em 2px 2px; + padding: 0.75em; + border: 1pt groove #666; + position: relative; +} + +fieldset > legend { + position: absolute; + top: -0.6em; + left: 0.75em; + padding: 0 0.3em; + background: white; +} + +legend { + display: inline-block; +} + +/* leafs */ + +hr { + display: block; + height: 0; + border: 1px inset; + margin: 0.5em auto 0.5em auto; +} + +hr[size="1"] { + border-style: solid none none none; +} + +iframe { + border: 2px inset; +} + +noframes { + display: block; +} + +br { + display: -dompdf-br; +} + +img, img_generated { + display: -dompdf-image; +} + +dompdf_generated { + display: inline; +} + +/* hidden elements */ +area, base, basefont, head, meta, script, style, title, +noembed, param { + display: none; + -dompdf-keep: yes; +} diff --git a/lib/dompdf/src/Adapter/CPDF.php b/lib/dompdf/src/Adapter/CPDF.php new file mode 100644 index 0000000..40a7dae --- /dev/null +++ b/lib/dompdf/src/Adapter/CPDF.php @@ -0,0 +1,1123 @@ + + * @author Orion Richardson + * @author Helmut Tischer + * @author Fabien Ménager + * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + */ + +// FIXME: Need to sanity check inputs to this class +namespace Dompdf\Adapter; + +use Dompdf\Canvas; +use Dompdf\Dompdf; +use Dompdf\Helpers; +use Dompdf\Exception; +use Dompdf\Image\Cache; +use Dompdf\PhpEvaluator; + +/** + * PDF rendering interface + * + * Dompdf\Adapter\CPDF provides a simple stateless interface to the stateful one + * provided by the Cpdf class. + * + * Unless otherwise mentioned, all dimensions are in points (1/72 in). The + * coordinate origin is in the top left corner, and y values increase + * downwards. + * + * See {@link http://www.ros.co.nz/pdf/} for more complete documentation + * on the underlying {@link Cpdf} class. + * + * @package dompdf + */ +class CPDF implements Canvas +{ + + /** + * Dimensions of paper sizes in points + * + * @var array; + */ + static $PAPER_SIZES = array( + "4a0" => array(0, 0, 4767.87, 6740.79), + "2a0" => array(0, 0, 3370.39, 4767.87), + "a0" => array(0, 0, 2383.94, 3370.39), + "a1" => array(0, 0, 1683.78, 2383.94), + "a2" => array(0, 0, 1190.55, 1683.78), + "a3" => array(0, 0, 841.89, 1190.55), + "a4" => array(0, 0, 595.28, 841.89), + "a5" => array(0, 0, 419.53, 595.28), + "a6" => array(0, 0, 297.64, 419.53), + "a7" => array(0, 0, 209.76, 297.64), + "a8" => array(0, 0, 147.40, 209.76), + "a9" => array(0, 0, 104.88, 147.40), + "a10" => array(0, 0, 73.70, 104.88), + "b0" => array(0, 0, 2834.65, 4008.19), + "b1" => array(0, 0, 2004.09, 2834.65), + "b2" => array(0, 0, 1417.32, 2004.09), + "b3" => array(0, 0, 1000.63, 1417.32), + "b4" => array(0, 0, 708.66, 1000.63), + "b5" => array(0, 0, 498.90, 708.66), + "b6" => array(0, 0, 354.33, 498.90), + "b7" => array(0, 0, 249.45, 354.33), + "b8" => array(0, 0, 175.75, 249.45), + "b9" => array(0, 0, 124.72, 175.75), + "b10" => array(0, 0, 87.87, 124.72), + "c0" => array(0, 0, 2599.37, 3676.54), + "c1" => array(0, 0, 1836.85, 2599.37), + "c2" => array(0, 0, 1298.27, 1836.85), + "c3" => array(0, 0, 918.43, 1298.27), + "c4" => array(0, 0, 649.13, 918.43), + "c5" => array(0, 0, 459.21, 649.13), + "c6" => array(0, 0, 323.15, 459.21), + "c7" => array(0, 0, 229.61, 323.15), + "c8" => array(0, 0, 161.57, 229.61), + "c9" => array(0, 0, 113.39, 161.57), + "c10" => array(0, 0, 79.37, 113.39), + "ra0" => array(0, 0, 2437.80, 3458.27), + "ra1" => array(0, 0, 1729.13, 2437.80), + "ra2" => array(0, 0, 1218.90, 1729.13), + "ra3" => array(0, 0, 864.57, 1218.90), + "ra4" => array(0, 0, 609.45, 864.57), + "sra0" => array(0, 0, 2551.18, 3628.35), + "sra1" => array(0, 0, 1814.17, 2551.18), + "sra2" => array(0, 0, 1275.59, 1814.17), + "sra3" => array(0, 0, 907.09, 1275.59), + "sra4" => array(0, 0, 637.80, 907.09), + "letter" => array(0, 0, 612.00, 792.00), + "legal" => array(0, 0, 612.00, 1008.00), + "ledger" => array(0, 0, 1224.00, 792.00), + "tabloid" => array(0, 0, 792.00, 1224.00), + "executive" => array(0, 0, 521.86, 756.00), + "folio" => array(0, 0, 612.00, 936.00), + "commercial #10 envelope" => array(0, 0, 684, 297), + "catalog #10 1/2 envelope" => array(0, 0, 648, 864), + "8.5x11" => array(0, 0, 612.00, 792.00), + "8.5x14" => array(0, 0, 612.00, 1008.0), + "11x17" => array(0, 0, 792.00, 1224.00), + ); + + /** + * The Dompdf object + * + * @var Dompdf + */ + private $_dompdf; + + /** + * Instance of Cpdf class + * + * @var Cpdf + */ + private $_pdf; + + /** + * PDF width, in points + * + * @var float + */ + private $_width; + + /** + * PDF height, in points + * + * @var float; + */ + private $_height; + + /** + * Current page number + * + * @var int + */ + private $_page_number; + + /** + * Total number of pages + * + * @var int + */ + private $_page_count; + + /** + * Text to display on every page + * + * @var array + */ + private $_page_text; + + /** + * Array of pages for accesing after rendering is initially complete + * + * @var array + */ + private $_pages; + + /** + * Array of temporary cached images to be deleted when processing is complete + * + * @var array + */ + private $_image_cache; + + /** + * Currently-applied opacity level (0 - 1) + * + * @var float + */ + private $_current_opacity = 1; + + /** + * Class constructor + * + * @param mixed $paper The size of paper to use in this PDF ({@link CPDF::$PAPER_SIZES}) + * @param string $orientation The orientation of the document (either 'landscape' or 'portrait') + * @param Dompdf $dompdf The Dompdf instance + */ + public function __construct($paper = "letter", $orientation = "portrait", Dompdf $dompdf) + { + if (is_array($paper)) { + $size = $paper; + } else if (isset(self::$PAPER_SIZES[mb_strtolower($paper)])) { + $size = self::$PAPER_SIZES[mb_strtolower($paper)]; + } else { + $size = self::$PAPER_SIZES["letter"]; + } + + if (mb_strtolower($orientation) === "landscape") { + list($size[2], $size[3]) = array($size[3], $size[2]); + } + + $this->_dompdf = $dompdf; + + $this->_pdf = new \Cpdf( + $size, + true, + $dompdf->getOptions()->getFontCache(), + $dompdf->getOptions()->getTempDir() + ); + + $this->_pdf->addInfo("Producer", sprintf("%s + CPDF", $dompdf->version)); + $time = substr_replace(date('YmdHisO'), '\'', -2, 0) . '\''; + $this->_pdf->addInfo("CreationDate", "D:$time"); + $this->_pdf->addInfo("ModDate", "D:$time"); + + $this->_width = $size[2] - $size[0]; + $this->_height = $size[3] - $size[1]; + + $this->_page_number = $this->_page_count = 1; + $this->_page_text = array(); + + $this->_pages = array($this->_pdf->getFirstPageId()); + + $this->_image_cache = array(); + } + + /** + * @return Dompdf + */ + public function get_dompdf() + { + return $this->_dompdf; + } + + /** + * Class destructor + * + * Deletes all temporary image files + */ + public function __destruct() + { + foreach ($this->_image_cache as $img) { + // The file might be already deleted by 3rd party tmp cleaner, + // the file might not have been created at all + // (if image outputting commands failed) + // or because the destructor was called twice accidentally. + if (!file_exists($img)) { + continue; + } + + if ($this->_dompdf->getOptions()->getDebugPng()) print '[__destruct unlink ' . $img . ']'; + if (!$this->_dompdf->getOptions()->getDebugKeepTemp()) unlink($img); + } + } + + /** + * Returns the Cpdf instance + * + * @return \Cpdf + */ + public function get_cpdf() + { + return $this->_pdf; + } + + /** + * Add meta information to the PDF + * + * @param string $label label of the value (Creator, Producer, etc.) + * @param string $value the text to set + */ + public function add_info($label, $value) + { + $this->_pdf->addInfo($label, $value); + } + + /** + * Opens a new 'object' + * + * While an object is open, all drawing actions are recored in the object, + * as opposed to being drawn on the current page. Objects can be added + * later to a specific page or to several pages. + * + * The return value is an integer ID for the new object. + * + * @see CPDF_Adapter::close_object() + * @see CPDF_Adapter::add_object() + * + * @return int + */ + public function open_object() + { + $ret = $this->_pdf->openObject(); + $this->_pdf->saveState(); + return $ret; + } + + /** + * Reopens an existing 'object' + * + * @see CPDF_Adapter::open_object() + * @param int $object the ID of a previously opened object + */ + public function reopen_object($object) + { + $this->_pdf->reopenObject($object); + $this->_pdf->saveState(); + } + + /** + * Closes the current 'object' + * + * @see CPDF_Adapter::open_object() + */ + public function close_object() + { + $this->_pdf->restoreState(); + $this->_pdf->closeObject(); + } + + /** + * Adds a specified 'object' to the document + * + * $object int specifying an object created with {@link + * CPDF::open_object()}. $where can be one of: + * - 'add' add to current page only + * - 'all' add to every page from the current one onwards + * - 'odd' add to all odd numbered pages from now on + * - 'even' add to all even numbered pages from now on + * - 'next' add the object to the next page only + * - 'nextodd' add to all odd numbered pages from the next one + * - 'nexteven' add to all even numbered pages from the next one + * + * @see Cpdf::addObject() + * + * @param int $object + * @param string $where + */ + public function add_object($object, $where = 'all') + { + $this->_pdf->addObject($object, $where); + } + + /** + * Stops the specified 'object' from appearing in the document. + * + * The object will stop being displayed on the page following the current + * one. + * + * @param int $object + */ + public function stop_object($object) + { + $this->_pdf->stopObject($object); + } + + /** + * @access private + */ + public function serialize_object($id) + { + // Serialize the pdf object's current state for retrieval later + return $this->_pdf->serializeObject($id); + } + + /** + * @access private + */ + public function reopen_serialized_object($obj) + { + return $this->_pdf->restoreSerializedObject($obj); + } + + //........................................................................ + + /** + * Returns the PDF's width in points + * @return float + */ + public function get_width() + { + return $this->_width; + } + + /** + * Returns the PDF's height in points + * @return float + */ + public function get_height() + { + return $this->_height; + } + + /** + * Returns the current page number + * @return int + */ + public function get_page_number() + { + return $this->_page_number; + } + + /** + * Returns the total number of pages in the document + * @return int + */ + public function get_page_count() + { + return $this->_page_count; + } + + /** + * Sets the current page number + * + * @param int $num + */ + public function set_page_number($num) + { + $this->_page_number = $num; + } + + /** + * Sets the page count + * + * @param int $count + */ + public function set_page_count($count) + { + $this->_page_count = $count; + } + + /** + * Sets the stroke color + * + * See {@link Style::set_color()} for the format of the color array. + * @param array $color + */ + protected function _set_stroke_color($color) + { + $this->_pdf->setStrokeColor($color); + $alpha = isset($color["alpha"]) ? $color["alpha"] : 1; + if ($this->_current_opacity != 1) { + $alpha *= $this->_current_opacity; + } + $this->_set_line_transparency("Normal", $alpha); + } + + /** + * Sets the fill colour + * + * See {@link Style::set_color()} for the format of the colour array. + * @param array $color + */ + protected function _set_fill_color($color) + { + $this->_pdf->setColor($color); + $alpha = isset($color["alpha"]) ? $color["alpha"] : 1; + if ($this->_current_opacity) { + $alpha *= $this->_current_opacity; + } + $this->_set_fill_transparency("Normal", $alpha); + } + + /** + * Sets line transparency + * @see Cpdf::setLineTransparency() + * + * Valid blend modes are (case-sensitive): + * + * Normal, Multiply, Screen, Overlay, Darken, Lighten, + * ColorDodge, ColorBurn, HardLight, SoftLight, Difference, + * Exclusion + * + * @param string $mode the blending mode to use + * @param float $opacity 0.0 fully transparent, 1.0 fully opaque + */ + protected function _set_line_transparency($mode, $opacity) + { + $this->_pdf->setLineTransparency($mode, $opacity); + } + + /** + * Sets fill transparency + * @see Cpdf::setFillTransparency() + * + * Valid blend modes are (case-sensitive): + * + * Normal, Multiply, Screen, Overlay, Darken, Lighten, + * ColorDogde, ColorBurn, HardLight, SoftLight, Difference, + * Exclusion + * + * @param string $mode the blending mode to use + * @param float $opacity 0.0 fully transparent, 1.0 fully opaque + */ + protected function _set_fill_transparency($mode, $opacity) + { + $this->_pdf->setFillTransparency($mode, $opacity); + } + + /** + * Sets the line style + * + * @see Cpdf::setLineStyle() + * + * @param float $width + * @param string $cap + * @param string $join + * @param array $dash + */ + protected function _set_line_style($width, $cap, $join, $dash) + { + $this->_pdf->setLineStyle($width, $cap, $join, $dash); + } + + /** + * Sets the opacity + * + * @param $opacity + * @param $mode + */ + public function set_opacity($opacity, $mode = "Normal") + { + $this->_set_line_transparency($mode, $opacity); + $this->_set_fill_transparency($mode, $opacity); + $this->_current_opacity = $opacity; + } + + public function set_default_view($view, $options = array()) + { + array_unshift($options, $view); + call_user_func_array(array($this->_pdf, "openHere"), $options); + } + + /** + * Remaps y coords from 4th to 1st quadrant + * + * @param float $y + * @return float + */ + protected function y($y) + { + return $this->_height - $y; + } + + /** + * Canvas implementation + * + * @param float $x1 + * @param float $y1 + * @param float $x2 + * @param float $y2 + * @param array $color + * @param float $width + * @param array $style + */ + public function line($x1, $y1, $x2, $y2, $color, $width, $style = array()) + { + $this->_set_stroke_color($color); + $this->_set_line_style($width, "butt", "", $style); + + $this->_pdf->line($x1, $this->y($y1), + $x2, $this->y($y2)); + } + + /** + * @param float $x + * @param float $y + * @param float $r1 + * @param float $r2 + * @param float $astart + * @param float $aend + * @param array $color + * @param float $width + * @param array $style + */ + public function arc($x, $y, $r1, $r2, $astart, $aend, $color, $width, $style = array()) + { + $this->_set_stroke_color($color); + $this->_set_line_style($width, "butt", "", $style); + + $this->_pdf->ellipse($x, $this->y($y), $r1, $r2, 0, 8, $astart, $aend, false, false, true, false); + } + + /** + * Convert a GIF or BMP image to a PNG image + * + * @param string $image_url + * @param integer $type + * + * @throws Exception + * @return string The url of the newly converted image + */ + protected function _convert_gif_bmp_to_png($image_url, $type) + { + $func_name = "imagecreatefrom$type"; + + if (!function_exists($func_name)) { + if (!method_exists("Dompdf\Helpers", $func_name)) { + throw new Exception("Function $func_name() not found. Cannot convert $type image: $image_url. Please install the image PHP extension."); + } + $func_name = "\\Dompdf\\Helpers::" . $func_name; + } + + set_error_handler(array("\\Dompdf\\Helpers", "record_warnings")); + $im = call_user_func($func_name, $image_url); + + if ($im) { + imageinterlace($im, false); + + $tmp_dir = $this->_dompdf->getOptions()->getTempDir(); + $tmp_name = tempnam($tmp_dir, "{$type}dompdf_img_"); + @unlink($tmp_name); + $filename = "$tmp_name.png"; + $this->_image_cache[] = $filename; + + imagepng($im, $filename); + imagedestroy($im); + } else { + $filename = Cache::$broken_image; + } + + restore_error_handler(); + + return $filename; + } + + /** + * @param float $x1 + * @param float $y1 + * @param float $w + * @param float $h + * @param array $color + * @param float $width + * @param array $style + */ + public function rectangle($x1, $y1, $w, $h, $color, $width, $style = array()) + { + $this->_set_stroke_color($color); + $this->_set_line_style($width, "butt", "", $style); + $this->_pdf->rectangle($x1, $this->y($y1) - $h, $w, $h); + } + + /** + * @param float $x1 + * @param float $y1 + * @param float $w + * @param float $h + * @param array $color + */ + public function filled_rectangle($x1, $y1, $w, $h, $color) + { + $this->_set_fill_color($color); + $this->_pdf->filledRectangle($x1, $this->y($y1) - $h, $w, $h); + } + + /** + * @param float $x1 + * @param float $y1 + * @param float $w + * @param float $h + */ + public function clipping_rectangle($x1, $y1, $w, $h) + { + $this->_pdf->clippingRectangle($x1, $this->y($y1) - $h, $w, $h); + } + + /** + * @param float $x1 + * @param float $y1 + * @param float $w + * @param float $h + * @param float $rTL + * @param float $rTR + * @param float $rBR + * @param float $rBL + */ + public function clipping_roundrectangle($x1, $y1, $w, $h, $rTL, $rTR, $rBR, $rBL) + { + $this->_pdf->clippingRectangleRounded($x1, $this->y($y1) - $h, $w, $h, $rTL, $rTR, $rBR, $rBL); + } + + /** + * + */ + public function clipping_end() + { + $this->_pdf->clippingEnd(); + } + + /** + * + */ + public function save() + { + $this->_pdf->saveState(); + } + + /** + * + */ + public function restore() + { + $this->_pdf->restoreState(); + } + + /** + * @param $angle + * @param $x + * @param $y + */ + public function rotate($angle, $x, $y) + { + $this->_pdf->rotate($angle, $x, $y); + } + + /** + * @param $angle_x + * @param $angle_y + * @param $x + * @param $y + */ + public function skew($angle_x, $angle_y, $x, $y) + { + $this->_pdf->skew($angle_x, $angle_y, $x, $y); + } + + /** + * @param $s_x + * @param $s_y + * @param $x + * @param $y + */ + public function scale($s_x, $s_y, $x, $y) + { + $this->_pdf->scale($s_x, $s_y, $x, $y); + } + + /** + * @param $t_x + * @param $t_y + */ + public function translate($t_x, $t_y) + { + $this->_pdf->translate($t_x, $t_y); + } + + /** + * @param $a + * @param $b + * @param $c + * @param $d + * @param $e + * @param $f + */ + public function transform($a, $b, $c, $d, $e, $f) + { + $this->_pdf->transform(array($a, $b, $c, $d, $e, $f)); + } + + /** + * @param array $points + * @param array $color + * @param null $width + * @param array $style + * @param bool $fill + */ + public function polygon($points, $color, $width = null, $style = array(), $fill = false) + { + $this->_set_fill_color($color); + $this->_set_stroke_color($color); + + // Adjust y values + for ($i = 1; $i < count($points); $i += 2) { + $points[$i] = $this->y($points[$i]); + } + + $this->_pdf->polygon($points, count($points) / 2, $fill); + } + + /** + * @param float $x + * @param float $y + * @param float $r1 + * @param array $color + * @param null $width + * @param null $style + * @param bool $fill + */ + public function circle($x, $y, $r1, $color, $width = null, $style = null, $fill = false) + { + $this->_set_fill_color($color); + $this->_set_stroke_color($color); + + if (!$fill && isset($width)) { + $this->_set_line_style($width, "round", "round", $style); + } + + $this->_pdf->ellipse($x, $this->y($y), $r1, 0, 0, 8, 0, 360, 1, $fill); + } + + /** + * @param string $img + * @param float $x + * @param float $y + * @param int $w + * @param int $h + * @param string $resolution + */ + public function image($img, $x, $y, $w, $h, $resolution = "normal") + { + list($width, $height, $type) = Helpers::dompdf_getimagesize($img, $this->get_dompdf()->getHttpContext()); + + $debug_png = $this->_dompdf->getOptions()->getDebugPng(); + + if ($debug_png) { + print "[image:$img|$width|$height|$type]"; + } + + switch ($type) { + case "jpeg": + if ($debug_png) print '!!!jpg!!!'; + $this->_pdf->addJpegFromFile($img, $x, $this->y($y) - $h, $w, $h); + break; + + case "gif": + /** @noinspection PhpMissingBreakStatementInspection */ + case "bmp": + if ($debug_png) print '!!!bmp or gif!!!'; + // @todo use cache for BMP and GIF + $img = $this->_convert_gif_bmp_to_png($img, $type); + + case "png": + if ($debug_png) print '!!!png!!!'; + + $this->_pdf->addPngFromFile($img, $x, $this->y($y) - $h, $w, $h); + break; + + case "svg": + if ($debug_png) print '!!!SVG!!!'; + + $this->_pdf->addSvgFromFile($img, $x, $this->y($y) - $h, $w, $h); + break; + + default: + if ($debug_png) print '!!!unknown!!!'; + } + } + + /** + * @param float $x + * @param float $y + * @param string $text + * @param string $font + * @param float $size + * @param array $color + * @param float $word_space + * @param float $char_space + * @param float $angle + */ + public function text($x, $y, $text, $font, $size, $color = array(0, 0, 0), $word_space = 0.0, $char_space = 0.0, $angle = 0.0) + { + $pdf = $this->_pdf; + + $this->_set_fill_color($color); + + $font .= ".afm"; + $pdf->selectFont($font); + + //FontMetrics::getFontHeight($font, $size) == + //$this->getFontHeight($font, $size) == + //$this->_pdf->selectFont($font),$this->_pdf->getFontHeight($size) + //- FontBBoxheight+FontHeightOffset, scaled to $size, in pt + //$this->_pdf->getFontDescender($size) + //- Descender scaled to size + // + //$this->_pdf->fonts[$this->_pdf->currentFont] sizes: + //['FontBBox'][0] left, ['FontBBox'][1] bottom, ['FontBBox'][2] right, ['FontBBox'][3] top + //Maximum extent of all glyphs of the font from the baseline point + //['Ascender'] maximum height above baseline except accents + //['Descender'] maximum depth below baseline, negative number means below baseline + //['FontHeightOffset'] manual enhancement of .afm files to trim windows fonts. currently not used. + //Values are in 1/1000 pt for a font size of 1 pt + // + //['FontBBox'][1] should be close to ['Descender'] + //['FontBBox'][3] should be close to ['Ascender']+Accents + //in practice, FontBBox values are a little bigger + // + //The text position is referenced to the baseline, not to the lower corner of the FontBBox, + //for what the left,top corner is given. + //FontBBox spans also the background box for the text. + //If the lower corner would be used as reference point, the Descents of the glyphs would + //hang over the background box border. + //Therefore compensate only the extent above the Baseline. + // + //print ' ['.$font.','.$size.','.$pdf->getFontHeight($size).','.$pdf->getFontDescender($size).','.$pdf->fonts[$pdf->currentFont]['FontBBox'][3].','.$pdf->fonts[$pdf->currentFont]['FontBBox'][1].','.$pdf->fonts[$pdf->currentFont]['FontHeightOffset'].','.$pdf->fonts[$pdf->currentFont]['Ascender'].','.$pdf->fonts[$pdf->currentFont]['Descender'].']'; + // + //$pdf->addText($x, $this->y($y) - ($pdf->fonts[$pdf->currentFont]['FontBBox'][3]*$size)/1000, $size, $text, $angle, $word_space, $char_space); + $pdf->addText($x, $this->y($y) - $pdf->getFontHeight($size), $size, $text, $angle, $word_space, $char_space); + } + + /** + * @param string $code + */ + public function javascript($code) + { + $this->_pdf->addJavascript($code); + } + + //........................................................................ + + /** + * Add a named destination (similar to ... in html) + * + * @param string $anchorname The name of the named destination + */ + public function add_named_dest($anchorname) + { + $this->_pdf->addDestination($anchorname, "Fit"); + } + + /** + * Add a link to the pdf + * + * @param string $url The url to link to + * @param float $x The x position of the link + * @param float $y The y position of the link + * @param float $width The width of the link + * @param float $height The height of the link + */ + public function add_link($url, $x, $y, $width, $height) + { + $y = $this->y($y) - $height; + + if (strpos($url, '#') === 0) { + // Local link + $name = substr($url, 1); + if ($name) { + $this->_pdf->addInternalLink($name, $x, $y, $x + $width, $y + $height); + } + } else { + $this->_pdf->addLink(rawurldecode($url), $x, $y, $x + $width, $y + $height); + } + } + + /** + * @param string $text + * @param string $font + * @param float $size + * @param int $word_spacing + * @param int $char_spacing + * @return float|int + */ + public function get_text_width($text, $font, $size, $word_spacing = 0, $char_spacing = 0) + { + $this->_pdf->selectFont($font); + return $this->_pdf->getTextWidth($size, $text, $word_spacing, $char_spacing); + } + + /** + * @param $font + * @param $string + */ + public function register_string_subset($font, $string) + { + $this->_pdf->registerText($font, $string); + } + + /** + * @param string $font + * @param float $size + * @return float|int + */ + public function get_font_height($font, $size) + { + $this->_pdf->selectFont($font); + + $ratio = $this->_dompdf->getOptions()->getFontHeightRatio(); + return $this->_pdf->getFontHeight($size) * $ratio; + } + + /*function get_font_x_height($font, $size) { + $this->_pdf->selectFont($font); + $ratio = $this->_dompdf->getOptions()->getFontHeightRatio(); + return $this->_pdf->getFontXHeight($size) * $ratio; + }*/ + + /** + * @param string $font + * @param float $size + * @return float + */ + public function get_font_baseline($font, $size) + { + $ratio = $this->_dompdf->getOptions()->getFontHeightRatio(); + return $this->get_font_height($font, $size) / $ratio; + } + + /** + * Writes text at the specified x and y coordinates on every page + * + * The strings '{PAGE_NUM}' and '{PAGE_COUNT}' are automatically replaced + * with their current values. + * + * See {@link Style::munge_color()} for the format of the colour array. + * + * @param float $x + * @param float $y + * @param string $text the text to write + * @param string $font the font file to use + * @param float $size the font size, in points + * @param array $color + * @param float $word_space word spacing adjustment + * @param float $char_space char spacing adjustment + * @param float $angle angle to write the text at, measured CW starting from the x-axis + */ + public function page_text($x, $y, $text, $font, $size, $color = array(0, 0, 0), $word_space = 0.0, $char_space = 0.0, $angle = 0.0) + { + $_t = "text"; + $this->_page_text[] = compact("_t", "x", "y", "text", "font", "size", "color", "word_space", "char_space", "angle"); + } + + /** + * Processes a script on every page + * + * The variables $pdf, $PAGE_NUM, and $PAGE_COUNT are available. + * + * This function can be used to add page numbers to all pages + * after the first one, for example. + * + * @param string $code the script code + * @param string $type the language type for script + */ + public function page_script($code, $type = "text/php") + { + $_t = "script"; + $this->_page_text[] = compact("_t", "code", "type"); + } + + /** + * @return int + */ + public function new_page() + { + $this->_page_number++; + $this->_page_count++; + + $ret = $this->_pdf->newPage(); + $this->_pages[] = $ret; + return $ret; + } + + /** + * Add text to each page after rendering is complete + */ + protected function _add_page_text() + { + if (!count($this->_page_text)) { + return; + } + + $page_number = 1; + $eval = null; + + foreach ($this->_pages as $pid) { + $this->reopen_object($pid); + + foreach ($this->_page_text as $pt) { + extract($pt); + + switch ($_t) { + case "text": + $text = str_replace(array("{PAGE_NUM}", "{PAGE_COUNT}"), + array($page_number, $this->_page_count), $text); + $this->text($x, $y, $text, $font, $size, $color, $word_space, $char_space, $angle); + break; + + case "script": + if (!$eval) { + $eval = new PhpEvaluator($this); + } + $eval->evaluate($code, array('PAGE_NUM' => $page_number, 'PAGE_COUNT' => $this->_page_count)); + break; + } + } + + $this->close_object(); + $page_number++; + } + } + + /** + * Streams the PDF directly to the browser + * + * @param string $filename the name of the PDF file + * @param array $options associative array, 'Attachment' => 0 or 1, 'compress' => 1 or 0 + */ + public function stream($filename, $options = null) + { + // Add page text + $this->_add_page_text(); + + $options["Content-Disposition"] = $filename; + $this->_pdf->stream($options); + } + + /** + * Returns the PDF as a string + * + * @param array $options Output options + * @return string + */ + public function output($options = null) + { + $this->_add_page_text(); + + $debug = isset($options["compress"]) && $options["compress"] != 1; + + return $this->_pdf->output($debug); + } + + /** + * Returns logging messages generated by the Cpdf class + * + * @return string + */ + public function get_messages() + { + return $this->_pdf->messages; + } +} diff --git a/lib/dompdf/src/Adapter/GD.php b/lib/dompdf/src/Adapter/GD.php new file mode 100644 index 0000000..c154f26 --- /dev/null +++ b/lib/dompdf/src/Adapter/GD.php @@ -0,0 +1,1118 @@ + + * @author Fabien Ménager+ * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + */ +namespace Dompdf\Adapter; + +use Dompdf\Canvas; +use Dompdf\Dompdf; +use Dompdf\Image\Cache; +use Dompdf\Helpers; + +/** + * Image rendering interface + * + * Renders to an image format supported by GD (jpeg, gif, png, xpm). + * Not super-useful day-to-day but handy nonetheless + * + * @package dompdf + */ +class GD implements Canvas +{ + /** + * @var Dompdf + */ + private $_dompdf; + + /** + * Resource handle for the image + * + * @var resource + */ + private $_img; + + /** + * Resource handle for the image + * + * @var resource[] + */ + private $_imgs; + + /** + * Apparent canvas width in pixels + * + * @var int + */ + private $_width; + + /** + * Apparent canvas height in pixels + * + * @var int + */ + private $_height; + + /** + * Actual image width in pixels + * + * @var int + */ + private $_actual_width; + + /** + * Actual image height in pixels + * + * @var int + */ + private $_actual_height; + + /** + * Current page number + * + * @var int + */ + private $_page_number; + + /** + * Total number of pages + * + * @var int + */ + private $_page_count; + + /** + * Image antialias factor + * + * @var float + */ + private $_aa_factor; + + /** + * Allocated colors + * + * @var array + */ + private $_colors; + + /** + * Background color + * + * @var int + */ + private $_bg_color; + + /** + * Background color array + * + * @var int + */ + private $_bg_color_array; + + /** + * Actual DPI + * + * @var int + */ + private $dpi; + + /** + * Amount to scale font sizes + * + * Font sizes are 72 DPI, GD internally uses 96. Scale them proportionally. + * 72 / 96 = 0.75. + * + * @var float + */ + const FONT_SCALE = 0.75; + + /** + * Class constructor + * + * @param mixed $size The size of image to create: array(x1,y1,x2,y2) or "letter", "legal", etc. + * @param string $orientation The orientation of the document (either 'landscape' or 'portrait') + * @param Dompdf $dompdf + * @param float $aa_factor Anti-aliasing factor, 1 for no AA + * @param array $bg_color Image background color: array(r,g,b,a), 0 <= r,g,b,a <= 1 + */ + public function __construct($size = 'letter', $orientation = "portrait", Dompdf $dompdf, $aa_factor = 1.0, $bg_color = array(1, 1, 1, 0)) + { + + if (!is_array($size)) { + $size = strtolower($size); + + if (isset(CPDF::$PAPER_SIZES[$size])) { + $size = CPDF::$PAPER_SIZES[$size]; + } else { + $size = CPDF::$PAPER_SIZES["letter"]; + } + } + + if (strtolower($orientation) === "landscape") { + list($size[2], $size[3]) = array($size[3], $size[2]); + } + + $this->_dompdf = $dompdf; + + $this->dpi = $this->get_dompdf()->getOptions()->getDpi(); + + if ($aa_factor < 1) { + $aa_factor = 1; + } + + $this->_aa_factor = $aa_factor; + + $size[2] *= $aa_factor; + $size[3] *= $aa_factor; + + $this->_width = $size[2] - $size[0]; + $this->_height = $size[3] - $size[1]; + + $this->_actual_width = $this->_upscale($this->_width); + $this->_actual_height = $this->_upscale($this->_height); + + if (is_null($bg_color) || !is_array($bg_color)) { + // Pure white bg + $bg_color = array(1, 1, 1, 0); + } + + $this->_bg_color_array = $bg_color; + + $this->new_page(); + } + + /** + * @return Dompdf + */ + public function get_dompdf() + { + return $this->_dompdf; + } + + /** + * Return the GF image resource + * + * @return resource + */ + public function get_image() + { + return $this->_img; + } + + /** + * Return the image's width in pixels + * + * @return float + */ + public function get_width() + { + return $this->_width / $this->_aa_factor; + } + + /** + * Return the image's height in pixels + * + * @return float + */ + public function get_height() + { + return $this->_height / $this->_aa_factor; + } + + /** + * Returns the current page number + * @return int + */ + public function get_page_number() + { + return $this->_page_number; + } + + /** + * Returns the total number of pages in the document + * @return int + */ + public function get_page_count() + { + return $this->_page_count; + } + + /** + * Sets the current page number + * + * @param int $num + */ + public function set_page_number($num) + { + $this->_page_number = $num; + } + + /** + * Sets the page count + * + * @param int $count + */ + public function set_page_count($count) + { + $this->_page_count = $count; + } + + /** + * Sets the opacity + * + * @param $opacity + * @param $mode + */ + public function set_opacity($opacity, $mode = "Normal") + { + // FIXME + } + + /** + * Allocate a new color. Allocate with GD as needed and store + * previously allocated colors in $this->_colors. + * + * @param array $color The new current color + * @return int The allocated color + */ + private function _allocate_color($color) + { + $a = isset($color["alpha"]) ? $color["alpha"] : 1; + + if (isset($color["c"])) { + $color = Helpers::cmyk_to_rgb($color); + } + + list($r, $g, $b) = $color; + + $r *= 255; + $g *= 255; + $b *= 255; + $a = 127 - ($a * 127); + + // Clip values + $r = $r > 255 ? 255 : $r; + $g = $g > 255 ? 255 : $g; + $b = $b > 255 ? 255 : $b; + $a = $a > 127 ? 127 : $a; + + $r = $r < 0 ? 0 : $r; + $g = $g < 0 ? 0 : $g; + $b = $b < 0 ? 0 : $b; + $a = $a < 0 ? 0 : $a; + + $key = sprintf("#%02X%02X%02X%02X", $r, $g, $b, $a); + + if (isset($this->_colors[$key])) { + return $this->_colors[$key]; + } + + if ($a != 0) { + $this->_colors[$key] = imagecolorallocatealpha($this->get_image(), $r, $g, $b, $a); + } else { + $this->_colors[$key] = imagecolorallocate($this->get_image(), $r, $g, $b); + } + + return $this->_colors[$key]; + } + + /** + * Scales value up to the current canvas DPI from 72 DPI + * + * @param float $length + * @return float + */ + private function _upscale($length) + { + return ($length * $this->dpi) / 72 * $this->_aa_factor; + } + + /** + * Scales value down from the current canvas DPI to 72 DPI + * + * @param float $length + * @return float + */ + private function _downscale($length) + { + return ($length / $this->dpi * 72) / $this->_aa_factor; + } + + /** + * Draws a line from x1,y1 to x2,y2 + * + * See {@link Style::munge_color()} for the format of the color array. + * See {@link Cpdf::setLineStyle()} for a description of the format of the + * $style parameter (aka dash). + * + * @param float $x1 + * @param float $y1 + * @param float $x2 + * @param float $y2 + * @param array $color + * @param float $width + * @param array $style + */ + public function line($x1, $y1, $x2, $y2, $color, $width, $style = null) + { + + // Scale by the AA factor and DPI + $x1 = $this->_upscale($x1); + $y1 = $this->_upscale($y1); + $x2 = $this->_upscale($x2); + $y2 = $this->_upscale($y2); + $width = $this->_upscale($width); + + $c = $this->_allocate_color($color); + + // Convert the style array if required + if (is_array($style) && count($style) > 0) { + $gd_style = array(); + + if (count($style) == 1) { + for ($i = 0; $i < $style[0] * $this->_aa_factor; $i++) { + $gd_style[] = $c; + } + + for ($i = 0; $i < $style[0] * $this->_aa_factor; $i++) { + $gd_style[] = $this->_bg_color; + } + } else { + $i = 0; + foreach ($style as $length) { + if ($i % 2 == 0) { + // 'On' pattern + for ($i = 0; $i < $style[0] * $this->_aa_factor; $i++) { + $gd_style[] = $c; + } + + } else { + // Off pattern + for ($i = 0; $i < $style[0] * $this->_aa_factor; $i++) { + $gd_style[] = $this->_bg_color; + } + } + $i++; + } + } + + if (!empty($gd_style)) { + imagesetstyle($this->get_image(), $gd_style); + $c = IMG_COLOR_STYLED; + } + } + + imagesetthickness($this->get_image(), $width); + + imageline($this->get_image(), $x1, $y1, $x2, $y2, $c); + } + + /** + * @param float $x1 + * @param float $y1 + * @param float $r1 + * @param float $r2 + * @param float $astart + * @param float $aend + * @param array $color + * @param float $width + * @param array $style + */ + public function arc($x1, $y1, $r1, $r2, $astart, $aend, $color, $width, $style = array()) + { + // @todo + } + + /** + * Draws a rectangle at x1,y1 with width w and height h + * + * See {@link Style::munge_color()} for the format of the color array. + * See {@link Cpdf::setLineStyle()} for a description of the $style + * parameter (aka dash) + * + * @param float $x1 + * @param float $y1 + * @param float $w + * @param float $h + * @param array $color + * @param float $width + * @param array $style + */ + public function rectangle($x1, $y1, $w, $h, $color, $width, $style = null) + { + + // Scale by the AA factor and DPI + $x1 = $this->_upscale($x1); + $y1 = $this->_upscale($y1); + $w = $this->_upscale($w); + $h = $this->_upscale($h); + $width = $this->_upscale($width); + + $c = $this->_allocate_color($color); + + // Convert the style array if required + if (is_array($style) && count($style) > 0) { + $gd_style = array(); + + foreach ($style as $length) { + for ($i = 0; $i < $length; $i++) { + $gd_style[] = $c; + } + } + + if (!empty($gd_style)) { + imagesetstyle($this->get_image(), $gd_style); + $c = IMG_COLOR_STYLED; + } + } + + imagesetthickness($this->get_image(), $width); + + imagerectangle($this->get_image(), $x1, $y1, $x1 + $w, $y1 + $h, $c); + } + + /** + * Draws a filled rectangle at x1,y1 with width w and height h + * + * See {@link Style::munge_color()} for the format of the color array. + * + * @param float $x1 + * @param float $y1 + * @param float $w + * @param float $h + * @param array $color + */ + public function filled_rectangle($x1, $y1, $w, $h, $color) + { + // Scale by the AA factor and DPI + $x1 = $this->_upscale($x1); + $y1 = $this->_upscale($y1); + $w = $this->_upscale($w); + $h = $this->_upscale($h); + + $c = $this->_allocate_color($color); + + imagefilledrectangle($this->get_image(), $x1, $y1, $x1 + $w, $y1 + $h, $c); + } + + /** + * Starts a clipping rectangle at x1,y1 with width w and height h + * + * @param float $x1 + * @param float $y1 + * @param float $w + * @param float $h + */ + public function clipping_rectangle($x1, $y1, $w, $h) + { + // @todo + } + + public function clipping_roundrectangle($x1, $y1, $w, $h, $rTL, $rTR, $rBR, $rBL) + { + // @todo + } + + /** + * Ends the last clipping shape + */ + public function clipping_end() + { + // @todo + } + + /** + * + */ + public function save() + { + $this->get_dompdf()->getOptions()->setDpi(72); + } + + /** + * + */ + public function restore() + { + $this->get_dompdf()->getOptions()->setDpi($this->dpi); + } + + /** + * @param $angle + * @param $x + * @param $y + */ + public function rotate($angle, $x, $y) + { + // @todo + } + + /** + * @param $angle_x + * @param $angle_y + * @param $x + * @param $y + */ + public function skew($angle_x, $angle_y, $x, $y) + { + // @todo + } + + /** + * @param $s_x + * @param $s_y + * @param $x + * @param $y + */ + public function scale($s_x, $s_y, $x, $y) + { + // @todo + } + + /** + * @param $t_x + * @param $t_y + */ + public function translate($t_x, $t_y) + { + // @todo + } + + /** + * @param $a + * @param $b + * @param $c + * @param $d + * @param $e + * @param $f + */ + public function transform($a, $b, $c, $d, $e, $f) + { + // @todo + } + + /** + * Draws a polygon + * + * The polygon is formed by joining all the points stored in the $points + * array. $points has the following structure: + * + * array(0 => x1, + * 1 => y1, + * 2 => x2, + * 3 => y2, + * ... + * ); + *
+ * + * See {@link Style::munge_color()} for the format of the color array. + * See {@link Cpdf::setLineStyle()} for a description of the $style + * parameter (aka dash) + * + * @param array $points + * @param array $color + * @param float $width + * @param array $style + * @param bool $fill Fills the polygon if true + */ + public function polygon($points, $color, $width = null, $style = null, $fill = false) + { + + // Scale each point by the AA factor and DPI + foreach (array_keys($points) as $i) { + $points[$i] = $this->_upscale($points[$i]); + } + + $c = $this->_allocate_color($color); + + // Convert the style array if required + if (is_array($style) && count($style) > 0 && !$fill) { + $gd_style = array(); + + foreach ($style as $length) { + for ($i = 0; $i < $length; $i++) { + $gd_style[] = $c; + } + } + + if (!empty($gd_style)) { + imagesetstyle($this->get_image(), $gd_style); + $c = IMG_COLOR_STYLED; + } + } + + imagesetthickness($this->get_image(), $width); + + if ($fill) { + imagefilledpolygon($this->get_image(), $points, count($points) / 2, $c); + } else { + imagepolygon($this->get_image(), $points, count($points) / 2, $c); + } + } + + /** + * Draws a circle at $x,$y with radius $r + * + * See {@link Style::munge_color()} for the format of the color array. + * See {@link Cpdf::setLineStyle()} for a description of the $style + * parameter (aka dash) + * + * @param float $x + * @param float $y + * @param float $r + * @param array $color + * @param float $width + * @param array $style + * @param bool $fill Fills the circle if true + */ + public function circle($x, $y, $r, $color, $width = null, $style = null, $fill = false) + { + // Scale by the AA factor and DPI + $x = $this->_upscale($x); + $y = $this->_upscale($y); + $r = $this->_upscale($r); + + $c = $this->_allocate_color($color); + + // Convert the style array if required + if (is_array($style) && count($style) > 0 && !$fill) { + $gd_style = array(); + + foreach ($style as $length) { + for ($i = 0; $i < $length; $i++) { + $gd_style[] = $c; + } + } + + if (!empty($gd_style)) { + imagesetstyle($this->get_image(), $gd_style); + $c = IMG_COLOR_STYLED; + } + } + + imagesetthickness($this->get_image(), $width); + + if ($fill) { + imagefilledellipse($this->get_image(), $x, $y, $r, $r, $c); + } else { + imageellipse($this->get_image(), $x, $y, $r, $r, $c); + } + } + + /** + * Add an image to the pdf. + * The image is placed at the specified x and y coordinates with the + * given width and height. + * + * @param string $img_url the path to the image + * @param float $x x position + * @param float $y y position + * @param int $w width (in pixels) + * @param int $h height (in pixels) + * @param string $resolution + * @return void + * + * @throws \Exception + * @internal param string $img_type the type (e.g. extension) of the image + */ + public function image($img_url, $x, $y, $w, $h, $resolution = "normal") + { + $img_type = Cache::detect_type($img_url, $this->get_dompdf()->getHttpContext()); + + if (!$img_type) { + return; + } + + $func_name = "imagecreatefrom$img_type"; + if (!function_exists($func_name)) { + if (!method_exists("Dompdf\Helpers", $func_name)) { + throw new \Exception("Function $func_name() not found. Cannot convert $type image: $img_url. Please install the image PHP extension."); + } + $func_name = "\\Dompdf\\Helpers::" . $func_name; + } + $src = @call_user_func($func_name, $img_url); + + if (!$src) { + return; // Probably should add to $_dompdf_errors or whatever here + } + + // Scale by the AA factor and DPI + $x = $this->_upscale($x); + $y = $this->_upscale($y); + + $w = $this->_upscale($w); + $h = $this->_upscale($h); + + $img_w = imagesx($src); + $img_h = imagesy($src); + + imagecopyresampled($this->get_image(), $src, $x, $y, 0, 0, $w, $h, $img_w, $img_h); + } + + /** + * Writes text at the specified x and y coordinates + * See {@link Style::munge_color()} for the format of the color array. + * + * @param float $x + * @param float $y + * @param string $text the text to write + * @param string $font the font file to use + * @param float $size the font size, in points + * @param array $color + * @param float $word_spacing word spacing adjustment + * @param float $char_spacing + * @param float $angle Text angle + * + * @return void + */ + public function text($x, $y, $text, $font, $size, $color = array(0, 0, 0), $word_spacing = 0.0, $char_spacing = 0.0, $angle = 0.0) + { + // Scale by the AA factor and DPI + $x = $this->_upscale($x); + $y = $this->_upscale($y); + $size = $this->_upscale($size) * self::FONT_SCALE; + + $h = $this->get_font_height_actual($font, $size); + $c = $this->_allocate_color($color); + + // imagettftext() converts numeric entities to their respective + // character. Preserve any originally double encoded entities to be + // represented as is. + // eg:   will render rather than its character. + $text = preg_replace('/&(#(?:x[a-fA-F0-9]+|[0-9]+);)/', '&\1', $text); + + $text = mb_encode_numericentity($text, array(0x0080, 0xff, 0, 0xff), 'UTF-8'); + + $font = $this->get_ttf_file($font); + + // FIXME: word spacing + imagettftext($this->get_image(), $size, $angle, $x, $y + $h, $c, $font, $text); + } + + public function javascript($code) + { + // Not implemented + } + + /** + * Add a named destination (similar to ... in html) + * + * @param string $anchorname The name of the named destination + */ + public function add_named_dest($anchorname) + { + // Not implemented + } + + /** + * Add a link to the pdf + * + * @param string $url The url to link to + * @param float $x The x position of the link + * @param float $y The y position of the link + * @param float $width The width of the link + * @param float $height The height of the link + */ + public function add_link($url, $x, $y, $width, $height) + { + // Not implemented + } + + /** + * Add meta information to the PDF + * + * @param string $label label of the value (Creator, Producer, etc.) + * @param string $value the text to set + */ + public function add_info($label, $value) + { + // N/A + } + + /** + * @param string $view + * @param array $options + */ + public function set_default_view($view, $options = array()) + { + // N/A + } + + /** + * Calculates text size, in points + * + * @param string $text the text to be sized + * @param string $font the desired font + * @param float $size the desired font size + * @param float $word_spacing word spacing, if any + * @param float $char_spacing char spacing, if any + * + * @return float + */ + public function get_text_width($text, $font, $size, $word_spacing = 0.0, $char_spacing = 0.0) + { + $font = $this->get_ttf_file($font); + $size = $this->_upscale($size) * self::FONT_SCALE; + + // imagettfbbox() converts numeric entities to their respective + // character. Preserve any originally double encoded entities to be + // represented as is. + // eg:   will render rather than its character. + $text = preg_replace('/&(#(?:x[a-fA-F0-9]+|[0-9]+);)/', '&\1', $text); + + $text = mb_encode_numericentity($text, array(0x0080, 0xffff, 0, 0xffff), 'UTF-8'); + + // FIXME: word spacing + list($x1, , $x2) = imagettfbbox($size, 0, $font, $text); + + // Add additional 1pt to prevent text overflow issues + return $this->_downscale($x2 - $x1) + 1; + } + + /** + * @param $font + * @return string + */ + public function get_ttf_file($font) + { + if ( stripos($font, ".ttf") === false ) { + $font .= ".ttf"; + } + + if (!file_exists($font)) { + $font_metrics = $this->_dompdf->getFontMetrics(); + $font = $font_metrics->getFont($this->_dompdf->getOptions()->getDefaultFont()) . ".ttf"; + if (!file_exists($font)) { + if (strpos($font, "mono")) { + $font = $font_metrics->getFont("DejaVu Mono") . ".ttf"; + } elseif (strpos($font, "sans") !== false) { + $font = $font_metrics->getFont("DejaVu Sans") . ".ttf"; + } elseif (strpos($font, "serif")) { + $font = $font_metrics->getFont("DejaVu Serif") . ".ttf"; + } else { + $font = $font_metrics->getFont("DejaVu Sans") . ".ttf"; + } + } + } + + return $font; + } + + /** + * Calculates font height, in points + * + * @param string $font + * @param float $size + * @return float + */ + public function get_font_height($font, $size) + { + $size = $this->_upscale($size) * self::FONT_SCALE; + + $height = $this->get_font_height_actual($font, $size); + + return $this->_downscale($height); + } + + private function get_font_height_actual($font, $size) + { + $font = $this->get_ttf_file($font); + $ratio = $this->_dompdf->getOptions()->getFontHeightRatio(); + + // FIXME: word spacing + list(, $y2, , , , $y1) = imagettfbbox($size, 0, $font, "MXjpqytfhl"); // Test string with ascenders, descenders and caps + return ($y2 - $y1) * $ratio; + } + + /** + * @param string $font + * @param float $size + * @return float + */ + public function get_font_baseline($font, $size) + { + $ratio = $this->_dompdf->getOptions()->getFontHeightRatio(); + return $this->get_font_height($font, $size) / $ratio; + } + + /** + * Starts a new page + * + * Subsequent drawing operations will appear on the new page. + */ + public function new_page() + { + $this->_page_number++; + $this->_page_count++; + + $this->_img = imagecreatetruecolor($this->_actual_width, $this->_actual_height); + + $this->_bg_color = $this->_allocate_color($this->_bg_color_array); + imagealphablending($this->_img, true); + imagesavealpha($this->_img, true); + imagefill($this->_img, 0, 0, $this->_bg_color); + + $this->_imgs[] = $this->_img; + } + + public function open_object() + { + // N/A + } + + public function close_object() + { + // N/A + } + + public function add_object() + { + // N/A + } + + public function page_text() + { + // N/A + } + + /** + * Streams the image directly to the browser + * + * @param string $filename the name of the image file (ignored) + * @param array $options associative array, 'type' => jpeg|jpg|png, 'quality' => 0 - 100 (jpeg only) + */ + public function stream($filename, $options = null) + { + $img = $this->_imgs[0]; + + if (isset($options['page']) && isset($this->_imgs[$options['page'] - 1])) { + $img = $this->_imgs[$options['page'] - 1]; + } + + // Perform any antialiasing + if ($this->_aa_factor != 1) { + $dst_w = $this->_actual_width / $this->_aa_factor; + $dst_h = $this->_actual_height / $this->_aa_factor; + $dst = imagecreatetruecolor($dst_w, $dst_h); + imagecopyresampled($dst, $img, 0, 0, 0, 0, + $dst_w, $dst_h, + $this->_actual_width, $this->_actual_height); + } else { + $dst = $img; + } + + if (!isset($options["type"])) + $options["type"] = "png"; + + $type = strtolower($options["type"]); + + header("Cache-Control: private"); + + $filename = str_replace(array("\n", "'"), "", basename($filename, ".$type")); + switch ($type) { + case "jpg": + case "jpeg": + $filename .= ".jpg"; + break; + + case "png": + default: + $filename .= ".png"; + break; + } + $attachment = (isset($options["Attachment"]) && $options["Attachment"]) ? "attachment" : "inline"; + + // detect the character encoding of the incoming file + $encoding = mb_detect_encoding($filename); + $fallbackfilename = mb_convert_encoding($filename, "ISO-8859-1", $encoding); + $encodedfallbackfilename = rawurlencode($fallbackfilename); + $encodedfilename = rawurlencode($filename); + + $contentDisposition = "Content-Disposition: $attachment; filename=\"" . $encodedfallbackfilename . "\""; + if ($encodedfallbackfilename !== $encodedfilename) { + $contentDisposition .= "; filename*=UTF-8''$encodedfilename"; + } + header($contentDisposition); + + switch ($type) { + + case "jpg": + case "jpeg": + if (!isset($options["quality"])) + $options["quality"] = 75; + + header("Content-type: image/jpeg"); + imagejpeg($dst, '', $options["quality"]); + break; + + case "png": + default: + header("Content-type: image/png"); + imagepng($dst); + break; + } + + if ($this->_aa_factor != 1) + imagedestroy($dst); + } + + /** + * Returns the PNG as a string + * + * @param array $options associative array, 'type' => jpeg|jpg|png, 'quality' => 0 - 100 (jpeg only) + * @return string + */ + public function output($options = null) + { + $img = $this->_imgs[0]; + + if (isset($options['page']) && isset($this->_imgs[$options['page'] - 1])) { + $img = $this->_imgs[$options['page'] - 1]; + } + + if ($this->_aa_factor != 1) { + $dst_w = $this->_actual_width / $this->_aa_factor; + $dst_h = $this->_actual_height / $this->_aa_factor; + $dst = imagecreatetruecolor($dst_w, $dst_h); + imagecopyresampled($dst, $img, 0, 0, 0, 0, + $dst_w, $dst_h, + $this->_actual_width, $this->_actual_height); + } else { + $dst = $img; + } + + if (!isset($options["type"])) { + $options["type"] = "png"; + } + + $type = $options["type"]; + + ob_start(); + + switch ($type) { + case "jpg": + case "jpeg": + if (!isset($options["quality"])) { + $options["quality"] = 75; + } + + imagejpeg($dst, '', $options["quality"]); + break; + case "png": + default: + imagepng($dst); + break; + } + + $image = ob_get_clean(); + + if ($this->_aa_factor != 1) { + imagedestroy($dst); + } + + return $image; + } +} diff --git a/lib/dompdf/src/Adapter/PDFLib.php b/lib/dompdf/src/Adapter/PDFLib.php new file mode 100644 index 0000000..9cbe7d1 --- /dev/null +++ b/lib/dompdf/src/Adapter/PDFLib.php @@ -0,0 +1,1361 @@ + + * @author Helmut Tischer+ * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + */ + +namespace Dompdf\Adapter; + +use Dompdf\Canvas; +use Dompdf\Dompdf; +use Dompdf\Helpers; +use Dompdf\Exception; +use Dompdf\FontMetrics; +use Dompdf\Image\Cache; +use Dompdf\PhpEvaluator; + +/** + * PDF rendering interface + * + * Dompdf\Adapter\PDFLib provides a simple, stateless interface to the one + * provided by PDFLib. + * + * Unless otherwise mentioned, all dimensions are in points (1/72 in). + * The coordinate origin is in the top left corner and y values + * increase downwards. + * + * See {@link http://www.pdflib.com/} for more complete documentation + * on the underlying PDFlib functions. + * + * @package dompdf + */ +class PDFLib implements Canvas +{ + + /** + * Dimensions of paper sizes in points + * + * @var array; + */ + static public $PAPER_SIZES = array(); // Set to Dompdf\Adapter\CPDF::$PAPER_SIZES below. + + /** + * Whether to create PDFs in memory or on disk + * + * @var bool + */ + static $IN_MEMORY = true; + + /** + * @var Dompdf + */ + private $_dompdf; + + /** + * Instance of PDFLib class + * + * @var \PDFlib + */ + private $_pdf; + + /** + * Name of temporary file used for PDFs created on disk + * + * @var string + */ + private $_file; + + /** + * PDF width, in points + * + * @var float + */ + private $_width; + + /** + * PDF height, in points + * + * @var float + */ + private $_height; + + /** + * Last fill color used + * + * @var array + */ + private $_last_fill_color; + + /** + * Last stroke color used + * + * @var array + */ + private $_last_stroke_color; + + /** + * The current opacity level + * + * @var array + */ + private $_current_opacity; + + /** + * Cache of image handles + * + * @var array + */ + private $_imgs; + + /** + * Cache of font handles + * + * @var array + */ + private $_fonts; + + /** + * List of objects (templates) to add to multiple pages + * + * @var array + */ + private $_objs; + + /** + * List of gstate objects created for this PDF (for reuse) + * + * @var array + */ + private $_gstates = array(); + + /** + * Current page number + * + * @var int + */ + private $_page_number; + + /** + * Total number of pages + * + * @var int + */ + private $_page_count; + + /** + * Text to display on every page + * + * @var array + */ + private $_page_text; + + /** + * Array of pages for accesing after rendering is initially complete + * + * @var array + */ + private $_pages; + + /** + * Class constructor + * + * @param mixed $paper The size of paper to use either a string (see {@link Dompdf\Adapter\CPDF::$PAPER_SIZES}) or + * an array(xmin,ymin,xmax,ymax) + * @param string $orientation The orientation of the document (either 'landscape' or 'portrait') + * @param Dompdf $dompdf + */ + public function __construct($paper = "letter", $orientation = "portrait", Dompdf $dompdf) + { + if (is_array($paper)) { + $size = $paper; + } else if (isset(self::$PAPER_SIZES[mb_strtolower($paper)])) { + $size = self::$PAPER_SIZES[mb_strtolower($paper)]; + } else { + $size = self::$PAPER_SIZES["letter"]; + } + + if (mb_strtolower($orientation) === "landscape") { + list($size[2], $size[3]) = array($size[3], $size[2]); + } + + $this->_width = $size[2] - $size[0]; + $this->_height = $size[3] - $size[1]; + + $this->_dompdf = $dompdf; + + $this->_pdf = new \PDFLib(); + + $license = $dompdf->getOptions()->getPdflibLicense(); + if (strlen($license) > 0) + $this->_pdf->set_parameter("license", $license); + + $this->_pdf->set_parameter("textformat", "utf8"); + $this->_pdf->set_parameter("fontwarning", "false"); + + // TODO: fetch PDFLib version information for the producer field + $this->_pdf->set_info("Producer Addendum", sprintf("%s + PDFLib", $dompdf->version)); + + // Silence pedantic warnings about missing TZ settings + $tz = @date_default_timezone_get(); + date_default_timezone_set("UTC"); + $this->_pdf->set_info("Date", date("Y-m-d")); + date_default_timezone_set($tz); + + if (self::$IN_MEMORY) + $this->_pdf->begin_document("", ""); + else { + $tmp_dir = $this->_dompdf->getOptions()->getTempDir(); + $tmp_name = tempnam($tmp_dir, "libdompdf_pdf_"); + @unlink($tmp_name); + $this->_file = "$tmp_name.pdf"; + $this->_pdf->begin_document($this->_file, ""); + } + + $this->_pdf->begin_page_ext($this->_width, $this->_height, ""); + + $this->_page_number = $this->_page_count = 1; + $this->_page_text = array(); + + $this->_imgs = array(); + $this->_fonts = array(); + $this->_objs = array(); + } + + /** + * @return Dompdf + */ + function get_dompdf() + { + return $this->_dompdf; + } + + /** + * Close the pdf + */ + protected function _close() + { + $this->_place_objects(); + + // Close all pages + $this->_pdf->suspend_page(""); + for ($p = 1; $p <= $this->_page_count; $p++) { + $this->_pdf->resume_page("pagenumber=$p"); + $this->_pdf->end_page_ext(""); + } + + $this->_pdf->end_document(""); + } + + + /** + * Returns the PDFLib instance + * + * @return PDFLib + */ + public function get_pdflib() + { + return $this->_pdf; + } + + /** + * Add meta information to the PDF + * + * @param string $label label of the value (Creator, Producter, etc.) + * @param string $value the text to set + */ + public function add_info($label, $value) + { + $this->_pdf->set_info($label, $value); + } + + /** + * Opens a new 'object' (template in PDFLib-speak) + * + * While an object is open, all drawing actions are recorded to the + * object instead of being drawn on the current page. Objects can + * be added later to a specific page or to several pages. + * + * The return value is an integer ID for the new object. + * + * @see PDFLib_Adapter::close_object() + * @see PDFLib_Adapter::add_object() + * + * @return int + */ + public function open_object() + { + $this->_pdf->suspend_page(""); + $ret = $this->_pdf->begin_template($this->_width, $this->_height); + $this->_pdf->save(); + $this->_objs[$ret] = array("start_page" => $this->_page_number); + return $ret; + } + + /** + * Reopen an existing object (NOT IMPLEMENTED) + * PDFLib does not seem to support reopening templates. + * + * @param int $object the ID of a previously opened object + * + * @throws Exception + * @return void + */ + public function reopen_object($object) + { + throw new Exception("PDFLib does not support reopening objects."); + } + + /** + * Close the current template + * + * @see PDFLib_Adapter::open_object() + */ + public function close_object() + { + $this->_pdf->restore(); + $this->_pdf->end_template(); + $this->_pdf->resume_page("pagenumber=" . $this->_page_number); + } + + /** + * Adds the specified object to the document + * + * $where can be one of: + * - 'add' add to current page only + * - 'all' add to every page from the current one onwards + * - 'odd' add to all odd numbered pages from now on + * - 'even' add to all even numbered pages from now on + * - 'next' add the object to the next page only + * - 'nextodd' add to all odd numbered pages from the next one + * - 'nexteven' add to all even numbered pages from the next one + * + * @param int $object the object handle returned by open_object() + * @param string $where + */ + public function add_object($object, $where = 'all') + { + + if (mb_strpos($where, "next") !== false) { + $this->_objs[$object]["start_page"]++; + $where = str_replace("next", "", $where); + if ($where == "") + $where = "add"; + } + + $this->_objs[$object]["where"] = $where; + } + + /** + * Stops the specified template from appearing in the document. + * + * The object will stop being displayed on the page following the + * current one. + * + * @param int $object + */ + public function stop_object($object) + { + + if (!isset($this->_objs[$object])) + return; + + $start = $this->_objs[$object]["start_page"]; + $where = $this->_objs[$object]["where"]; + + // Place the object on this page if required + if ($this->_page_number >= $start && + (($this->_page_number % 2 == 0 && $where === "even") || + ($this->_page_number % 2 == 1 && $where === "odd") || + ($where === "all")) + ) { + $this->_pdf->fit_image($object, 0, 0, ""); + } + + $this->_objs[$object] = null; + unset($this->_objs[$object]); + } + + /** + * Add all active objects to the current page + */ + protected function _place_objects() + { + + foreach ($this->_objs as $obj => $props) { + $start = $props["start_page"]; + $where = $props["where"]; + + // Place the object on this page if required + if ($this->_page_number >= $start && + (($this->_page_number % 2 == 0 && $where === "even") || + ($this->_page_number % 2 == 1 && $where === "odd") || + ($where === "all")) + ) { + $this->_pdf->fit_image($obj, 0, 0, ""); + } + } + + } + + /** + * @return float|mixed + */ + public function get_width() + { + return $this->_width; + } + + /** + * @return float|mixed + */ + public function get_height() + { + return $this->_height; + } + + /** + * @return int + */ + public function get_page_number() + { + return $this->_page_number; + } + + /** + * @return int + */ + public function get_page_count() + { + return $this->_page_count; + } + + /** + * @param $num + */ + public function set_page_number($num) + { + $this->_page_number = (int)$num; + } + + /** + * @param int $count + */ + public function set_page_count($count) + { + $this->_page_count = (int)$count; + } + + /** + * Sets the line style + * + * @param float $width + * @param $cap + * @param string $join + * @param array $dash + * + * @return void + */ + protected function _set_line_style($width, $cap, $join, $dash) + { + if (count($dash) == 1) + $dash[] = $dash[0]; + + if (count($dash) > 1) + $this->_pdf->setdashpattern("dasharray={" . implode(" ", $dash) . "}"); + else + $this->_pdf->setdash(0, 0); + + switch ($join) { + case "miter": + $this->_pdf->setlinejoin(0); + break; + + case "round": + $this->_pdf->setlinejoin(1); + break; + + case "bevel": + $this->_pdf->setlinejoin(2); + break; + + default: + break; + } + + switch ($cap) { + case "butt": + $this->_pdf->setlinecap(0); + break; + + case "round": + $this->_pdf->setlinecap(1); + break; + + case "square": + $this->_pdf->setlinecap(2); + break; + + default: + break; + } + + $this->_pdf->setlinewidth($width); + } + + /** + * Sets the line color + * + * @param array $color array(r,g,b) + */ + protected function _set_stroke_color($color) + { + if ($this->_last_stroke_color == $color) { + //return; + } + + $alpha = isset($color["alpha"]) ? $color["alpha"] : 1; + if (isset($this->_current_opacity)) { + $alpha *= $this->_current_opacity; + } + + $this->_last_stroke_color = $color; + + if (isset($color[3])) { + $type = "cmyk"; + list($c1, $c2, $c3, $c4) = array($color[0], $color[1], $color[2], $color[3]); + } elseif (isset($color[2])) { + $type = "rgb"; + list($c1, $c2, $c3, $c4) = array($color[0], $color[1], $color[2], null); + } else { + $type = "gray"; + list($c1, $c2, $c3, $c4) = array($color[0], $color[1], null, null); + } + + $this->_set_stroke_opacity($alpha); + $this->_pdf->setcolor("stroke", $type, $c1, $c2, $c3, $c4); + } + + /** + * Sets the fill color + * + * @param array $color array(r,g,b) + */ + protected function _set_fill_color($color) + { + if ($this->_last_fill_color == $color) + return; + + $alpha = isset($color["alpha"]) ? $color["alpha"] : 1; + if (isset($this->_current_opacity)) { + $alpha *= $this->_current_opacity; + } + + $this->_last_fill_color = $color; + + if (isset($color[3])) { + $type = "cmyk"; + list($c1, $c2, $c3, $c4) = array($color[0], $color[1], $color[2], $color[3]); + } elseif (isset($color[2])) { + $type = "rgb"; + list($c1, $c2, $c3, $c4) = array($color[0], $color[1], $color[2], null); + } else { + $type = "gray"; + list($c1, $c2, $c3, $c4) = array($color[0], $color[1], null, null); + } + + $this->_set_fill_opacity($alpha); + $this->_pdf->setcolor("fill", $type, $c1, $c2, $c3, $c4); + } + + /** + * Sets the fill opacity + * + * @param $opacity + * @param $mode + */ + public function _set_fill_opacity($opacity, $mode = "Normal") + { + if ($mode === "Normal") { + $this->_set_gstate("opacityfill=$opacity"); + } + } + + /** + * Sets the stroke opacity + * + * @param $opacity + * @param $mode + */ + public function _set_stroke_opacity($opacity, $mode = "Normal") + { + if ($mode === "Normal") { + $this->_set_gstate("opacitystroke=$opacity"); + } + } + + /** + * Sets the opacity + * + * @param $opacity + * @param $mode + */ + public function set_opacity($opacity, $mode = "Normal") + { + if ($mode === "Normal") { + $this->_set_gstate("opacityfill=$opacity opacitystroke=$opacity"); + $this->_current_opacity = $opacity; + } + } + + /** + * Sets the gstate + * + * @param $gstate_options + * @return int + */ + public function _set_gstate($gstate_options) + { + if (($gstate = array_search($gstate_options, $this->_gstates)) === false) { + $gstate = $this->_pdf->create_gstate($gstate_options); + $this->_gstates[$gstate] = $gstate_options; + } + return $this->_pdf->set_gstate($gstate); + } + + public function set_default_view($view, $options = array()) + { + // TODO + // http://www.pdflib.com/fileadmin/pdflib/pdf/manuals/PDFlib-8.0.2-API-reference.pdf + /** + * fitheight Fit the page height to the window, with the x coordinate left at the left edge of the window. + * fitrect Fit the rectangle specified by left, bottom, right, and top to the window. + * fitvisible Fit the visible contents of the page (the ArtBox) to the window. + * fitvisibleheight Fit the visible contents of the page to the window with the x coordinate left at the left edge of the window. + * fitvisiblewidth Fit the visible contents of the page to the window with the y coordinate top at the top edge of the window. + * fitwidth Fit the page width to the window, with the y coordinate top at the top edge of the window. + * fitwindow Fit the complete page to the window. + * fixed + */ + //$this->_pdf->set_parameter("openaction", $view); + } + + /** + * Loads a specific font and stores the corresponding descriptor. + * + * @param string $font + * @param string $encoding + * @param string $options + * + * @return int the font descriptor for the font + */ + protected function _load_font($font, $encoding = null, $options = "") + { + // Set up font paths + if ($this->_pdf->get_parameter("FontOutline", 1) === "") { + $families = $this->_dompdf->getFontMetrics()->getFontFamilies(); + foreach ($families as $files) { + foreach ($files as $file) { + $face = basename($file); + $afm = null; + + // Prefer ttfs to afms + if (file_exists("$file.ttf")) { + $outline = "$file.ttf"; + + } else if (file_exists("$file.TTF")) { + $outline = "$file.TTF"; + + } else if (file_exists("$file.pfb")) { + $outline = "$file.pfb"; + if (file_exists("$file.afm")) { + $afm = "$file.afm"; + } + + } else if (file_exists("$file.PFB")) { + $outline = "$file.PFB"; + if (file_exists("$file.AFM")) { + $afm = "$file.AFM"; + } + } else { + continue; + } + + $this->_pdf->set_parameter("FontOutline", "\{$face\}=\{$outline\}"); + + if (!is_null($afm)) { + $this->_pdf->set_parameter("FontAFM", "\{$face\}=\{$afm\}"); + } + } + } + } + + // Check if the font is a native PDF font + // Embed non-native fonts + $test = strtolower(basename($font)); + if (in_array($test, DOMPDF::$nativeFonts)) { + $font = basename($font); + } else { + // Embed non-native fonts + $options .= " embedding=true"; + } + + if (is_null($encoding)) { + // Unicode encoding is only available for the commerical + // version of PDFlib and not PDFlib-Lite + if (strlen($this->_dompdf->getOptions()->getPdflibLicense()) > 0) { + $encoding = "unicode"; + } else { + $encoding = "auto"; + } + } + + $key = "$font:$encoding:$options"; + + if (isset($this->_fonts[$key])) { + return $this->_fonts[$key]; + } else { + $this->_fonts[$key] = $this->_pdf->load_font($font, $encoding, $options); + return $this->_fonts[$key]; + } + } + + /** + * Remaps y coords from 4th to 1st quadrant + * + * @param float $y + * @return float + */ + protected function y($y) + { + return $this->_height - $y; + } + + /** + * @param float $x1 + * @param float $y1 + * @param float $x2 + * @param float $y2 + * @param array $color + * @param float $width + * @param array $style + */ + public function line($x1, $y1, $x2, $y2, $color, $width, $style = null) + { + $this->_set_line_style($width, "butt", "", $style); + $this->_set_stroke_color($color); + + $y1 = $this->y($y1); + $y2 = $this->y($y2); + + $this->_pdf->moveto($x1, $y1); + $this->_pdf->lineto($x2, $y2); + $this->_pdf->stroke(); + } + + /** + * @param float $x1 + * @param float $y1 + * @param float $r1 + * @param float $r2 + * @param float $astart + * @param float $aend + * @param array $color + * @param float $width + * @param array $style + */ + public function arc($x1, $y1, $r1, $r2, $astart, $aend, $color, $width, $style = array()) + { + $this->_set_line_style($width, "butt", "", $style); + $this->_set_stroke_color($color); + + $y1 = $this->y($y1); + + $this->_pdf->arc($x1, $y1, $r1, $astart, $aend); + $this->_pdf->stroke(); + } + + /** + * @param float $x1 + * @param float $y1 + * @param float $w + * @param float $h + * @param array $color + * @param float $width + * @param null $style + */ + public function rectangle($x1, $y1, $w, $h, $color, $width, $style = null) + { + $this->_set_stroke_color($color); + $this->_set_line_style($width, "butt", "", $style); + + $y1 = $this->y($y1) - $h; + + $this->_pdf->rect($x1, $y1, $w, $h); + $this->_pdf->stroke(); + } + + /** + * @param float $x1 + * @param float $y1 + * @param float $w + * @param float $h + * @param array $color + */ + public function filled_rectangle($x1, $y1, $w, $h, $color) + { + $this->_set_fill_color($color); + + $y1 = $this->y($y1) - $h; + + $this->_pdf->rect(floatval($x1), floatval($y1), floatval($w), floatval($h)); + $this->_pdf->fill(); + } + + /** + * @param float $x1 + * @param float $y1 + * @param float $w + * @param float $h + */ + public function clipping_rectangle($x1, $y1, $w, $h) + { + $this->_pdf->save(); + + $y1 = $this->y($y1) - $h; + + $this->_pdf->rect(floatval($x1), floatval($y1), floatval($w), floatval($h)); + $this->_pdf->clip(); + } + + /** + * @param float $x1 + * @param float $y1 + * @param float $w + * @param float $h + * @param float $rTL + * @param float $rTR + * @param float $rBR + * @param float $rBL + */ + public function clipping_roundrectangle($x1, $y1, $w, $h, $rTL, $rTR, $rBR, $rBL) + { + // @todo + $this->clipping_rectangle($x1, $y1, $w, $h); + } + + /** + * + */ + public function clipping_end() + { + $this->_pdf->restore(); + } + + /** + * + */ + public function save() + { + $this->_pdf->save(); + } + + function restore() + { + $this->_pdf->restore(); + } + + /** + * @param $angle + * @param $x + * @param $y + */ + public function rotate($angle, $x, $y) + { + $pdf = $this->_pdf; + $pdf->translate($x, $this->_height - $y); + $pdf->rotate(-$angle); + $pdf->translate(-$x, -$this->_height + $y); + } + + /** + * @param $angle_x + * @param $angle_y + * @param $x + * @param $y + */ + public function skew($angle_x, $angle_y, $x, $y) + { + $pdf = $this->_pdf; + $pdf->translate($x, $this->_height - $y); + $pdf->skew($angle_y, $angle_x); // Needs to be inverted + $pdf->translate(-$x, -$this->_height + $y); + } + + /** + * @param $s_x + * @param $s_y + * @param $x + * @param $y + */ + public function scale($s_x, $s_y, $x, $y) + { + $pdf = $this->_pdf; + $pdf->translate($x, $this->_height - $y); + $pdf->scale($s_x, $s_y); + $pdf->translate(-$x, -$this->_height + $y); + } + + /** + * @param $t_x + * @param $t_y + */ + public function translate($t_x, $t_y) + { + $this->_pdf->translate($t_x, -$t_y); + } + + /** + * @param $a + * @param $b + * @param $c + * @param $d + * @param $e + * @param $f + */ + public function transform($a, $b, $c, $d, $e, $f) + { + $this->_pdf->concat($a, $b, $c, $d, $e, $f); + } + + /** + * @param array $points + * @param array $color + * @param null $width + * @param null $style + * @param bool $fill + */ + public function polygon($points, $color, $width = null, $style = null, $fill = false) + { + $this->_set_fill_color($color); + $this->_set_stroke_color($color); + + if (!$fill && isset($width)) { + $this->_set_line_style($width, "square", "miter", $style); + } + + $y = $this->y(array_pop($points)); + $x = array_pop($points); + $this->_pdf->moveto($x, $y); + + while (count($points) > 1) { + $y = $this->y(array_pop($points)); + $x = array_pop($points); + $this->_pdf->lineto($x, $y); + } + + if ($fill) { + $this->_pdf->fill(); + } else { + $this->_pdf->closepath_stroke(); + } + } + + /** + * @param float $x + * @param float $y + * @param float $r + * @param array $color + * @param null $width + * @param null $style + * @param bool $fill + */ + public function circle($x, $y, $r, $color, $width = null, $style = null, $fill = false) + { + $this->_set_fill_color($color); + $this->_set_stroke_color($color); + + if (!$fill && isset($width)) + $this->_set_line_style($width, "round", "round", $style); + + $y = $this->y($y); + + $this->_pdf->circle($x, $y, $r); + + if ($fill) { + $this->_pdf->fill(); + } else { + $this->_pdf->stroke(); + } + } + + /** + * @param string $img_url + * @param float $x + * @param float $y + * @param int $w + * @param int $h + * @param string $resolution + */ + public function image($img_url, $x, $y, $w, $h, $resolution = "normal") + { + $w = (int)$w; + $h = (int)$h; + + $img_type = Cache::detect_type($img_url, $this->get_dompdf()->getHttpContext()); + + if (!isset($this->_imgs[$img_url])) { + $this->_imgs[$img_url] = $this->_pdf->load_image($img_type, $img_url, ""); + } + + $img = $this->_imgs[$img_url]; + + $y = $this->y($y) - $h; + $this->_pdf->fit_image($img, $x, $y, 'boxsize={' . "$w $h" . '} fitmethod=entire'); + } + + /** + * @param float $x + * @param float $y + * @param string $text + * @param string $font + * @param float $size + * @param array $color + * @param int $word_spacing + * @param int $char_spacing + * @param int $angle + */ + public function text($x, $y, $text, $font, $size, $color = array(0, 0, 0), $word_spacing = 0, $char_spacing = 0, $angle = 0) + { + $fh = $this->_load_font($font); + + $this->_pdf->setfont($fh, $size); + $this->_set_fill_color($color); + + $y = $this->y($y) - $this->get_font_height($font, $size); + + $word_spacing = (float)$word_spacing; + $char_spacing = (float)$char_spacing; + $angle = -(float)$angle; + + $this->_pdf->fit_textline($text, $x, $y, "rotate=$angle wordspacing=$word_spacing charspacing=$char_spacing "); + } + + /** + * @param string $code + */ + public function javascript($code) + { + if (strlen($this->_dompdf->getOptions()->getPdflibLicense()) > 0) { + $this->_pdf->create_action("JavaScript", $code); + } + } + + /** + * Add a named destination (similar to ... in html) + * + * @param string $anchorname The name of the named destination + */ + public function add_named_dest($anchorname) + { + $this->_pdf->add_nameddest($anchorname, ""); + } + + /** + * Add a link to the pdf + * + * @param string $url The url to link to + * @param float $x The x position of the link + * @param float $y The y position of the link + * @param float $width The width of the link + * @param float $height The height of the link + */ + public function add_link($url, $x, $y, $width, $height) + { + $y = $this->y($y) - $height; + if (strpos($url, '#') === 0) { + // Local link + $name = substr($url, 1); + if ($name) { + $this->_pdf->create_annotation($x, $y, $x + $width, $y + $height, 'Link', + "contents={$url} destname=" . substr($url, 1) . " linewidth=0"); + } + } else { + list($proto, $host, $path, $file) = Helpers::explode_url($url); + + if ($proto == "" || $proto === "file://") { + return; // Local links are not allowed + } + $url = Helpers::build_url($proto, $host, $path, $file); + $url = '{' . rawurldecode($url) . '}'; + + $action = $this->_pdf->create_action("URI", "url=" . $url); + $this->_pdf->create_annotation($x, $y, $x + $width, $y + $height, 'Link', "contents={$url} action={activate=$action} linewidth=0"); + } + } + + /** + * @param string $text + * @param string $font + * @param float $size + * @param int $word_spacing + * @param int $letter_spacing + * @return mixed + */ + public function get_text_width($text, $font, $size, $word_spacing = 0, $letter_spacing = 0) + { + $fh = $this->_load_font($font); + + // Determine the additional width due to extra spacing + $num_spaces = mb_substr_count($text, " "); + $delta = $word_spacing * $num_spaces; + + if ($letter_spacing) { + $num_chars = mb_strlen($text); + $delta += ($num_chars - $num_spaces) * $letter_spacing; + } + + return $this->_pdf->stringwidth($text, $fh, $size) + $delta; + } + + /** + * @param string $font + * @param float $size + * @return float + */ + public function get_font_height($font, $size) + { + $fh = $this->_load_font($font); + + $this->_pdf->setfont($fh, $size); + + $asc = $this->_pdf->get_value("ascender", $fh); + $desc = $this->_pdf->get_value("descender", $fh); + + // $desc is usually < 0, + $ratio = $this->_dompdf->getOptions()->getFontHeightRatio(); + return $size * ($asc - $desc) * $ratio; + } + + /** + * @param string $font + * @param float $size + * @return float + */ + public function get_font_baseline($font, $size) + { + $ratio = $this->_dompdf->getOptions()->getFontHeightRatio(); + return $this->get_font_height($font, $size) / $ratio * 1.1; + } + + /** + * Writes text at the specified x and y coordinates on every page + * + * The strings '{PAGE_NUM}' and '{PAGE_COUNT}' are automatically replaced + * with their current values. + * + * See {@link Style::munge_color()} for the format of the color array. + * + * @param float $x + * @param float $y + * @param string $text the text to write + * @param string $font the font file to use + * @param float $size the font size, in points + * @param array $color + * @param float $word_space word spacing adjustment + * @param float $char_space char spacing adjustment + * @param float $angle angle to write the text at, measured CW starting from the x-axis + */ + public function page_text($x, $y, $text, $font, $size, $color = array(0, 0, 0), $word_space = 0.0, $char_space = 0.0, $angle = 0.0) + { + $_t = "text"; + $this->_page_text[] = compact("_t", "x", "y", "text", "font", "size", "color", "word_space", "char_space", "angle"); + } + + //........................................................................ + + /** + * Processes a script on every page + * + * The variables $pdf, $PAGE_NUM, and $PAGE_COUNT are available. + * + * This function can be used to add page numbers to all pages + * after the first one, for example. + * + * @param string $code the script code + * @param string $type the language type for script + */ + public function page_script($code, $type = "text/php") + { + $_t = "script"; + $this->_page_text[] = compact("_t", "code", "type"); + } + + /** + * + */ + public function new_page() + { + // Add objects to the current page + $this->_place_objects(); + + $this->_pdf->suspend_page(""); + $this->_pdf->begin_page_ext($this->_width, $this->_height, ""); + $this->_page_number = ++$this->_page_count; + } + + /** + * Add text to each page after rendering is complete + */ + protected function _add_page_text() + { + if (!count($this->_page_text)) { + return; + } + + $eval = null; + $this->_pdf->suspend_page(""); + + for ($p = 1; $p <= $this->_page_count; $p++) { + $this->_pdf->resume_page("pagenumber=$p"); + + foreach ($this->_page_text as $pt) { + extract($pt); + + switch ($_t) { + case "text": + $text = str_replace(array("{PAGE_NUM}", "{PAGE_COUNT}"), + array($p, $this->_page_count), $text); + $this->text($x, $y, $text, $font, $size, $color, $word_space, $char_space, $angle); + break; + + case "script": + if (!$eval) { + $eval = new PHPEvaluator($this); + } + $eval->evaluate($code, array('PAGE_NUM' => $p, 'PAGE_COUNT' => $this->_page_count)); + break; + } + } + + $this->_pdf->suspend_page(""); + } + + $this->_pdf->resume_page("pagenumber=" . $this->_page_number); + } + + /** + * @param string $filename + * @param null $options + * @throws Exception + */ + public function stream($filename, $options = null) + { + // Add page text + $this->_add_page_text(); + + if (isset($options["compress"]) && $options["compress"] != 1) { + $this->_pdf->set_value("compress", 0); + } else { + $this->_pdf->set_value("compress", 6); + } + + $this->_close(); + + $data = ""; + + if (self::$IN_MEMORY) { + $data = $this->_pdf->get_buffer(); + //$size = strlen($data); + } else { + //$size = filesize($this->_file); + } + + header("Cache-Control: private"); + header("Content-type: application/pdf"); + + $filename = str_replace(array("\n", "'"), "", basename($filename, ".pdf")) . ".pdf"; + $attachment = (isset($options["Attachment"]) && $options["Attachment"]) ? "attachment" : "inline"; + + // detect the character encoding of the incoming file + $encoding = mb_detect_encoding($filename); + $fallbackfilename = mb_convert_encoding($filename, "ISO-8859-1", $encoding); + $encodedfallbackfilename = rawurlencode($fallbackfilename); + $encodedfilename = rawurlencode($filename); + + $contentDisposition = "Content-Disposition: $attachment; filename=\"" . $encodedfallbackfilename . "\""; + if ($encodedfallbackfilename !== $encodedfilename) { + $contentDisposition .= "; filename*=UTF-8''$encodedfilename"; + } + header($contentDisposition); + + //header("Content-length: " . $size); + + if (self::$IN_MEMORY) { + echo $data; + } else { + // Chunked readfile() + $chunk = (1 << 21); // 2 MB + $fh = fopen($this->_file, "rb"); + if (!$fh) { + throw new Exception("Unable to load temporary PDF file: " . $this->_file); + } + + while (!feof($fh)) { + echo fread($fh, $chunk); + } + fclose($fh); + + //debugpng + if ($this->_dompdf->getOptions()->getDebugPng()) print '[pdflib stream unlink ' . $this->_file . ']'; + if (!$this->_dompdf->getOptions()->getDebugKeepTemp()) + + unlink($this->_file); + $this->_file = null; + unset($this->_file); + } + + flush(); + } + + /** + * @param null $options + * @return string + */ + public function output($options = null) + { + // Add page text + $this->_add_page_text(); + + if (isset($options["compress"]) && $options["compress"] != 1) { + $this->_pdf->set_value("compress", 0); + } else { + $this->_pdf->set_value("compress", 6); + } + + $this->_close(); + + if (self::$IN_MEMORY) { + $data = $this->_pdf->get_buffer(); + } else { + $data = file_get_contents($this->_file); + + //debugpng + if ($this->_dompdf->getOptions()->getDebugPng()) { + print '[pdflib output unlink ' . $this->_file . ']'; + } + if (!$this->_dompdf->getOptions()->getDebugKeepTemp()) { + unlink($this->_file); + } + $this->_file = null; + unset($this->_file); + } + + return $data; + } +} + +// Workaround for idiotic limitation on statics... +PDFLib::$PAPER_SIZES = CPDF::$PAPER_SIZES; diff --git a/lib/dompdf/src/Autoloader.php b/lib/dompdf/src/Autoloader.php new file mode 100644 index 0000000..08a3b46 --- /dev/null +++ b/lib/dompdf/src/Autoloader.php @@ -0,0 +1,42 @@ + + * @author Fabien Ménager + * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + */ + +namespace Dompdf; + +/** + * Main rendering interface + * + * Currently {@link Dompdf\Adapter\CPDF}, {@link Dompdf\Adapter\PDFLib}, and {@link Dompdf\Adapter\GD} + * implement this interface. + * + * Implementations should measure x and y increasing to the left and down, + * respectively, with the origin in the top left corner. Implementations + * are free to use a unit other than points for length, but I can't + * guarantee that the results will look any good. + * + * @package dompdf + */ +interface Canvas +{ + function __construct($paper = "letter", $orientation = "portrait", Dompdf $dompdf); + + /** + * @return Dompdf + */ + function get_dompdf(); + + /** + * Returns the current page number + * + * @return int + */ + function get_page_number(); + + /** + * Returns the total number of pages + * + * @return int + */ + function get_page_count(); + + /** + * Sets the total number of pages + * + * @param int $count + */ + function set_page_count($count); + + /** + * Draws a line from x1,y1 to x2,y2 + * + * See {@link Style::munge_color()} for the format of the color array. + * See {@link Cpdf::setLineStyle()} for a description of the format of the + * $style parameter (aka dash). + * + * @param float $x1 + * @param float $y1 + * @param float $x2 + * @param float $y2 + * @param array $color + * @param float $width + * @param array $style + */ + function line($x1, $y1, $x2, $y2, $color, $width, $style = null); + + /** + * Draws a rectangle at x1,y1 with width w and height h + * + * See {@link Style::munge_color()} for the format of the color array. + * See {@link Cpdf::setLineStyle()} for a description of the $style + * parameter (aka dash) + * + * @param float $x1 + * @param float $y1 + * @param float $w + * @param float $h + * @param array $color + * @param float $width + * @param array $style + */ + function rectangle($x1, $y1, $w, $h, $color, $width, $style = null); + + /** + * Draws a filled rectangle at x1,y1 with width w and height h + * + * See {@link Style::munge_color()} for the format of the color array. + * + * @param float $x1 + * @param float $y1 + * @param float $w + * @param float $h + * @param array $color + */ + function filled_rectangle($x1, $y1, $w, $h, $color); + + /** + * Starts a clipping rectangle at x1,y1 with width w and height h + * + * @param float $x1 + * @param float $y1 + * @param float $w + * @param float $h + */ + function clipping_rectangle($x1, $y1, $w, $h); + + /** + * Starts a rounded clipping rectangle at x1,y1 with width w and height h + * + * @param float $x1 + * @param float $y1 + * @param float $w + * @param float $h + * @param float $tl + * @param float $tr + * @param float $br + * @param float $bl + * + * @return + */ + function clipping_roundrectangle($x1, $y1, $w, $h, $tl, $tr, $br, $bl); + + /** + * Ends the last clipping shape + */ + function clipping_end(); + + /** + * Save current state + */ + function save(); + + /** + * Restore last state + */ + function restore(); + + /** + * Rotate + * + * @param float $angle angle in degrees for counter-clockwise rotation + * @param float $x Origin abscissa + * @param float $y Origin ordinate + */ + function rotate($angle, $x, $y); + + /** + * Skew + * + * @param float $angle_x + * @param float $angle_y + * @param float $x Origin abscissa + * @param float $y Origin ordinate + */ + function skew($angle_x, $angle_y, $x, $y); + + /** + * Scale + * + * @param float $s_x scaling factor for width as percent + * @param float $s_y scaling factor for height as percent + * @param float $x Origin abscissa + * @param float $y Origin ordinate + */ + function scale($s_x, $s_y, $x, $y); + + /** + * Translate + * + * @param float $t_x movement to the right + * @param float $t_y movement to the bottom + */ + function translate($t_x, $t_y); + + /** + * Transform + * + * @param $a + * @param $b + * @param $c + * @param $d + * @param $e + * @param $f + * @return + */ + function transform($a, $b, $c, $d, $e, $f); + + /** + * Draws a polygon + * + * The polygon is formed by joining all the points stored in the $points + * array. $points has the following structure: + * + * array(0 => x1, + * 1 => y1, + * 2 => x2, + * 3 => y2, + * ... + * ); + *
+ * + * See {@link Style::munge_color()} for the format of the color array. + * See {@link Cpdf::setLineStyle()} for a description of the $style + * parameter (aka dash) + * + * @param array $points + * @param array $color + * @param float $width + * @param array $style + * @param bool $fill Fills the polygon if true + */ + function polygon($points, $color, $width = null, $style = null, $fill = false); + + /** + * Draws a circle at $x,$y with radius $r + * + * See {@link Style::munge_color()} for the format of the color array. + * See {@link Cpdf::setLineStyle()} for a description of the $style + * parameter (aka dash) + * + * @param float $x + * @param float $y + * @param float $r + * @param array $color + * @param float $width + * @param array $style + * @param bool $fill Fills the circle if true + */ + function circle($x, $y, $r, $color, $width = null, $style = null, $fill = false); + + /** + * Add an image to the pdf. + * + * The image is placed at the specified x and y coordinates with the + * given width and height. + * + * @param string $img_url the path to the image + * @param float $x x position + * @param float $y y position + * @param int $w width (in pixels) + * @param int $h height (in pixels) + * @param string $resolution The resolution of the image + */ + function image($img_url, $x, $y, $w, $h, $resolution = "normal"); + + /** + * Add an arc to the PDF + * See {@link Style::munge_color()} for the format of the color array. + * + * @param float $x X coordinate of the arc + * @param float $y Y coordinate of the arc + * @param float $r1 Radius 1 + * @param float $r2 Radius 2 + * @param float $astart Start angle in degrees + * @param float $aend End angle in degrees + * @param array $color Color + * @param float $width + * @param array $style + */ + function arc($x, $y, $r1, $r2, $astart, $aend, $color, $width, $style = array()); + + /** + * Writes text at the specified x and y coordinates + * See {@link Style::munge_color()} for the format of the color array. + * + * @param float $x + * @param float $y + * @param string $text the text to write + * @param string $font the font file to use + * @param float $size the font size, in points + * @param array $color + * @param float $word_space word spacing adjustment + * @param float $char_space char spacing adjustment + * @param float $angle angle + */ + function text($x, $y, $text, $font, $size, $color = array(0, 0, 0), $word_space = 0.0, $char_space = 0.0, $angle = 0.0); + + /** + * Add a named destination (similar to ... in html) + * + * @param string $anchorname The name of the named destination + */ + function add_named_dest($anchorname); + + /** + * Add a link to the pdf + * + * @param string $url The url to link to + * @param float $x The x position of the link + * @param float $y The y position of the link + * @param float $width The width of the link + * @param float $height The height of the link + */ + function add_link($url, $x, $y, $width, $height); + + /** + * Add meta information to the pdf + * + * @param string $name Label of the value (Creator, Producer, etc.) + * @param string $value The text to set + */ + function add_info($name, $value); + + /** + * Calculates text size, in points + * + * @param string $text the text to be sized + * @param string $font the desired font + * @param float $size the desired font size + * @param float $word_spacing word spacing, if any + * @param float $char_spacing + * + * @return float + */ + function get_text_width($text, $font, $size, $word_spacing = 0.0, $char_spacing = 0.0); + + /** + * Calculates font height, in points + * + * @param string $font + * @param float $size + * + * @return float + */ + function get_font_height($font, $size); + + /** + * Calculates font baseline, in points + * + * @param string $font + * @param float $size + * + * @return float + */ + function get_font_baseline($font, $size); + + /** + * Returns the PDF's width in points + * + * @return float + */ + function get_width(); + + + /** + * Return the image's height in pixels + * + * @return float + */ + function get_height(); + + /** + * Returns the font x-height, in points + * + * @param string $font + * @param float $size + * + * @return float + */ + //function get_font_x_height($font, $size); + + /** + * Sets the opacity + * + * @param float $opacity + * @param string $mode + */ + function set_opacity($opacity, $mode = "Normal"); + + /** + * Sets the default view + * + * @param string $view + * 'XYZ' left, top, zoom + * 'Fit' + * 'FitH' top + * 'FitV' left + * 'FitR' left,bottom,right + * 'FitB' + * 'FitBH' top + * 'FitBV' left + * @param array $options + * + * @return void + */ + function set_default_view($view, $options = array()); + + /** + * @param string $script + * + * @return void + */ + function javascript($script); + + /** + * Starts a new page + * + * Subsequent drawing operations will appear on the new page. + */ + function new_page(); + + /** + * Streams the PDF directly to the browser + * + * @param string $filename the name of the PDF file + * @param array $options associative array, 'Attachment' => 0 or 1, 'compress' => 1 or 0 + */ + function stream($filename, $options = null); + + /** + * Returns the PDF as a string + * + * @param array $options associative array: 'compress' => 1 or 0 + * @return string + */ + function output($options = null); +} diff --git a/lib/dompdf/src/CanvasFactory.php b/lib/dompdf/src/CanvasFactory.php new file mode 100644 index 0000000..d9d22be --- /dev/null +++ b/lib/dompdf/src/CanvasFactory.php @@ -0,0 +1,59 @@ + + * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + */ +namespace Dompdf; + +/** + * Create canvas instances + * + * The canvas factory creates canvas instances based on the + * availability of rendering backends and config options. + * + * @package dompdf + */ +class CanvasFactory +{ + /** + * Constructor is private: this is a static class + */ + private function __construct() + { + } + + /** + * @param Dompdf $dompdf + * @param string|array $paper + * @param string $orientation + * @param string $class + * + * @return Canvas + */ + static function get_instance(Dompdf $dompdf, $paper = null, $orientation = null, $class = null) + { + $backend = strtolower($dompdf->getOptions()->getPdfBackend()); + + if (isset($class) && class_exists($class, false)) { + $class .= "_Adapter"; + } else { + if (($backend === "auto" || $backend === "pdflib") && + class_exists("PDFLib", false) + ) { + $class = "Dompdf\\Adapter\\PDFLib"; + } + + else { + if ($backend === "gd") { + $class = "Dompdf\\Adapter\\GD"; + } else { + $class = "Dompdf\\Adapter\\CPDF"; + } + } + } + + return new $class($paper, $orientation, $dompdf); + } +} diff --git a/lib/dompdf/src/Cellmap.php b/lib/dompdf/src/Cellmap.php new file mode 100644 index 0000000..7412644 --- /dev/null +++ b/lib/dompdf/src/Cellmap.php @@ -0,0 +1,918 @@ + + * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + */ +namespace Dompdf; + +use Dompdf\Exception; +use Dompdf\Frame; +use Dompdf\FrameDecorator\Table as TableFrameDecorator; +use Dompdf\FrameDecorator\TableCell as TableCellFrameDecorator; + +/** + * Maps table cells to the table grid. + * + * This class resolves borders in tables with collapsed borders and helps + * place row & column spanned table cells. + * + * @package dompdf + */ +class Cellmap +{ + /** + * Border style weight lookup for collapsed border resolution. + * + * @var array + */ + protected static $_BORDER_STYLE_SCORE = array( + "inset" => 1, + "groove" => 2, + "outset" => 3, + "ridge" => 4, + "dotted" => 5, + "dashed" => 6, + "solid" => 7, + "double" => 8, + "hidden" => 9, + "none" => 0, + ); + + /** + * The table object this cellmap is attached to. + * + * @var TableFrameDecorator + */ + protected $_table; + + /** + * The total number of rows in the table + * + * @var int + */ + protected $_num_rows; + + /** + * The total number of columns in the table + * + * @var int + */ + protected $_num_cols; + + /** + * 2D array mappingto frames + * + * @var Frame[][] + */ + protected $_cells; + + /** + * 1D array of column dimensions + * + * @var array + */ + protected $_columns; + + /** + * 1D array of row dimensions + * + * @var array + */ + protected $_rows; + + /** + * 2D array of border specs + * + * @var array + */ + protected $_borders; + + /** + * 1D Array mapping frames to (multiple)
pairs, keyed on frame_id. + * + * @var Frame[] + */ + protected $_frames; + + /** + * Current column when adding cells, 0-based + * + * @var int + */ + private $__col; + + /** + * Current row when adding cells, 0-based + * + * @var int + */ + private $__row; + + /** + * Tells wether the columns' width can be modified + * + * @var bool + */ + private $_columns_locked = false; + + /** + * Tells wether the table has table-layout:fixed + * + * @var bool + */ + private $_fixed_layout = false; + + /** + * @param TableFrameDecorator $table + */ + public function __construct(TableFrameDecorator $table) + { + $this->_table = $table; + $this->reset(); + } + + /** + * + */ + public function reset() + { + $this->_num_rows = 0; + $this->_num_cols = 0; + + $this->_cells = array(); + $this->_frames = array(); + + if (!$this->_columns_locked) { + $this->_columns = array(); + } + + $this->_rows = array(); + + $this->_borders = array(); + + $this->__col = $this->__row = 0; + } + + /** + * + */ + public function lock_columns() + { + $this->_columns_locked = true; + } + + /** + * @return bool + */ + public function is_columns_locked() + { + return $this->_columns_locked; + } + + /** + * @param $fixed + */ + public function set_layout_fixed($fixed) + { + $this->_fixed_layout = $fixed; + } + + /** + * @return bool + */ + public function is_layout_fixed() + { + return $this->_fixed_layout; + } + + /** + * @return int + */ + public function get_num_rows() + { + return $this->_num_rows; + } + + /** + * @return int + */ + public function get_num_cols() + { + return $this->_num_cols; + } + + /** + * @return array + */ + public function &get_columns() + { + return $this->_columns; + } + + /** + * @param $columns + */ + public function set_columns($columns) + { + $this->_columns = $columns; + } + + /** + * @param int $i + * + * @return mixed + */ + public function &get_column($i) + { + if (!isset($this->_columns[$i])) { + $this->_columns[$i] = array( + "x" => 0, + "min-width" => 0, + "max-width" => 0, + "used-width" => null, + "absolute" => 0, + "percent" => 0, + "auto" => true, + ); + } + + return $this->_columns[$i]; + } + + /** + * @return array + */ + public function &get_rows() + { + return $this->_rows; + } + + /** + * @param int $j + * + * @return mixed + */ + public function &get_row($j) + { + if (!isset($this->_rows[$j])) { + $this->_rows[$j] = array( + "y" => 0, + "first-column" => 0, + "height" => null, + ); + } + + return $this->_rows[$j]; + } + + /** + * @param int $i + * @param int $j + * @param mixed $h_v + * @param null|mixed $prop + * + * @return mixed + */ + public function get_border($i, $j, $h_v, $prop = null) + { + if (!isset($this->_borders[$i][$j][$h_v])) { + $this->_borders[$i][$j][$h_v] = array( + "width" => 0, + "style" => "solid", + "color" => "black", + ); + } + + if (isset($prop)) { + return $this->_borders[$i][$j][$h_v][$prop]; + } + + return $this->_borders[$i][$j][$h_v]; + } + + /** + * @param int $i + * @param int $j + * + * @return array + */ + public function get_border_properties($i, $j) + { + return array( + "top" => $this->get_border($i, $j, "horizontal"), + "right" => $this->get_border($i, $j + 1, "vertical"), + "bottom" => $this->get_border($i + 1, $j, "horizontal"), + "left" => $this->get_border($i, $j, "vertical"), + ); + } + + /** + * @param Frame $frame + * + * @return null|Frame + */ + public function get_spanned_cells(Frame $frame) + { + $key = $frame->get_id(); + + if (isset($this->_frames[$key])) { + return $this->_frames[$key]; + } + + return null; + } + + /** + * @param Frame $frame + * + * @return bool + */ + public function frame_exists_in_cellmap(Frame $frame) + { + $key = $frame->get_id(); + + return isset($this->_frames[$key]); + } + + /** + * @param Frame $frame + * + * @return array + * @throws Exception + */ + public function get_frame_position(Frame $frame) + { + global $_dompdf_warnings; + + $key = $frame->get_id(); + + if (!isset($this->_frames[$key])) { + throw new Exception("Frame not found in cellmap"); + } + + $col = $this->_frames[$key]["columns"][0]; + $row = $this->_frames[$key]["rows"][0]; + + if (!isset($this->_columns[$col])) { + $_dompdf_warnings[] = "Frame not found in columns array. Check your table layout for missing or extra TDs."; + $x = 0; + } else { + $x = $this->_columns[$col]["x"]; + } + + if (!isset($this->_rows[$row])) { + $_dompdf_warnings[] = "Frame not found in row array. Check your table layout for missing or extra TDs."; + $y = 0; + } else { + $y = $this->_rows[$row]["y"]; + } + + return array($x, $y, "x" => $x, "y" => $y); + } + + /** + * @param Frame $frame + * + * @return int + * @throws Exception + */ + public function get_frame_width(Frame $frame) + { + $key = $frame->get_id(); + + if (!isset($this->_frames[$key])) { + throw new Exception("Frame not found in cellmap"); + } + + $cols = $this->_frames[$key]["columns"]; + $w = 0; + foreach ($cols as $i) { + $w += $this->_columns[$i]["used-width"]; + } + + return $w; + } + + /** + * @param Frame $frame + * + * @return int + * @throws Exception + * @throws Exception + */ + public function get_frame_height(Frame $frame) + { + $key = $frame->get_id(); + + if (!isset($this->_frames[$key])) { + throw new Exception("Frame not found in cellmap"); + } + + $rows = $this->_frames[$key]["rows"]; + $h = 0; + foreach ($rows as $i) { + if (!isset($this->_rows[$i])) { + throw new Exception("The row #$i could not be found, please file an issue in the tracker with the HTML code"); + } + + $h += $this->_rows[$i]["height"]; + } + + return $h; + } + + /** + * @param int $j + * @param mixed $width + */ + public function set_column_width($j, $width) + { + if ($this->_columns_locked) { + return; + } + + $col =& $this->get_column($j); + $col["used-width"] = $width; + $next_col =& $this->get_column($j + 1); + $next_col["x"] = $next_col["x"] + $width; + } + + /** + * @param int $i + * @param mixed $height + */ + public function set_row_height($i, $height) + { + $row =& $this->get_row($i); + + if ($row["height"] !== null && $height <= $row["height"]) { + return; + } + + $row["height"] = $height; + $next_row =& $this->get_row($i + 1); + $next_row["y"] = $row["y"] + $height; + + } + + /** + * @param int $i + * @param int $j + * @param mixed $h_v + * @param mixed $border_spec + * + * @return mixed + */ + protected function _resolve_border($i, $j, $h_v, $border_spec) + { + $n_width = $border_spec["width"]; + $n_style = $border_spec["style"]; + + if (!isset($this->_borders[$i][$j][$h_v])) { + $this->_borders[$i][$j][$h_v] = $border_spec; + + return $this->_borders[$i][$j][$h_v]["width"]; + } + + $border = & $this->_borders[$i][$j][$h_v]; + + $o_width = $border["width"]; + $o_style = $border["style"]; + + if (($n_style === "hidden" || + $n_width > $o_width || + $o_style === "none") + + or + + ($o_width == $n_width && + in_array($n_style, self::$_BORDER_STYLE_SCORE) && + self::$_BORDER_STYLE_SCORE[$n_style] > self::$_BORDER_STYLE_SCORE[$o_style]) + ) { + $border = $border_spec; + } + + return $border["width"]; + } + + /** + * @param Frame $frame + */ + public function add_frame(Frame $frame) + { + $style = $frame->get_style(); + $display = $style->display; + + $collapse = $this->_table->get_style()->border_collapse == "collapse"; + + // Recursively add the frames within tables, table-row-groups and table-rows + if ($display === "table-row" || + $display === "table" || + $display === "inline-table" || + in_array($display, TableFrameDecorator::$ROW_GROUPS) + ) { + + $start_row = $this->__row; + foreach ($frame->get_children() as $child) { + // Ignore all Text frames and :before/:after pseudo-selector elements. + if (!($child instanceof FrameDecorator\Text) && $child->get_node()->nodeName !== 'dompdf_generated') { + $this->add_frame($child); + } + } + + if ($display === "table-row") { + $this->add_row(); + } + + $num_rows = $this->__row - $start_row - 1; + $key = $frame->get_id(); + + // Row groups always span across the entire table + $this->_frames[$key]["columns"] = range(0, max(0, $this->_num_cols - 1)); + $this->_frames[$key]["rows"] = range($start_row, max(0, $this->__row - 1)); + $this->_frames[$key]["frame"] = $frame; + + if ($display !== "table-row" && $collapse) { + + $bp = $style->get_border_properties(); + + // Resolve the borders + for ($i = 0; $i < $num_rows + 1; $i++) { + $this->_resolve_border($start_row + $i, 0, "vertical", $bp["left"]); + $this->_resolve_border($start_row + $i, $this->_num_cols, "vertical", $bp["right"]); + } + + for ($j = 0; $j < $this->_num_cols; $j++) { + $this->_resolve_border($start_row, $j, "horizontal", $bp["top"]); + $this->_resolve_border($this->__row, $j, "horizontal", $bp["bottom"]); + } + } + return; + } + + $node = $frame->get_node(); + + // Determine where this cell is going + $colspan = $node->getAttribute("colspan"); + $rowspan = $node->getAttribute("rowspan"); + + if (!$colspan) { + $colspan = 1; + $node->setAttribute("colspan", 1); + } + + if (!$rowspan) { + $rowspan = 1; + $node->setAttribute("rowspan", 1); + } + $key = $frame->get_id(); + + $bp = $style->get_border_properties(); + + + // Add the frame to the cellmap + $max_left = $max_right = 0; + + // Find the next available column (fix by Ciro Mondueri) + $ac = $this->__col; + while (isset($this->_cells[$this->__row][$ac])) { + $ac++; + } + + $this->__col = $ac; + + // Rows: + for ($i = 0; $i < $rowspan; $i++) { + $row = $this->__row + $i; + + $this->_frames[$key]["rows"][] = $row; + + for ($j = 0; $j < $colspan; $j++) { + $this->_cells[$row][$this->__col + $j] = $frame; + } + + if ($collapse) { + // Resolve vertical borders + $max_left = max($max_left, $this->_resolve_border($row, $this->__col, "vertical", $bp["left"])); + $max_right = max($max_right, $this->_resolve_border($row, $this->__col + $colspan, "vertical", $bp["right"])); + } + } + + $max_top = $max_bottom = 0; + + // Columns: + for ($j = 0; $j < $colspan; $j++) { + $col = $this->__col + $j; + $this->_frames[$key]["columns"][] = $col; + + if ($collapse) { + // Resolve horizontal borders + $max_top = max($max_top, $this->_resolve_border($this->__row, $col, "horizontal", $bp["top"])); + $max_bottom = max($max_bottom, $this->_resolve_border($this->__row + $rowspan, $col, "horizontal", $bp["bottom"])); + } + } + + $this->_frames[$key]["frame"] = $frame; + + // Handle seperated border model + if (!$collapse) { + list($h, $v) = $this->_table->get_style()->border_spacing; + + // Border spacing is effectively a margin between cells + $v = $style->length_in_pt($v); + if (is_numeric($v)) { + $v = $v / 2; + } + $h = $style->length_in_pt($h); + if (is_numeric($h)) { + $h = $h / 2; + } + $style->margin = "$v $h"; + + // The additional 1/2 width gets added to the table proper + } else { + // Drop the frame's actual border + $style->border_left_width = $max_left / 2; + $style->border_right_width = $max_right / 2; + $style->border_top_width = $max_top / 2; + $style->border_bottom_width = $max_bottom / 2; + $style->margin = "none"; + } + + if (!$this->_columns_locked) { + // Resolve the frame's width + if ($this->_fixed_layout) { + list($frame_min, $frame_max) = array(0, 10e-10); + } else { + list($frame_min, $frame_max) = $frame->get_min_max_width(); + } + + $width = $style->width; + + $val = null; + if (Helpers::is_percent($width)) { + $var = "percent"; + $val = (float)rtrim($width, "% ") / $colspan; + } else if ($width !== "auto") { + $var = "absolute"; + $val = $style->length_in_pt($frame_min) / $colspan; + } + + $min = 0; + $max = 0; + for ($cs = 0; $cs < $colspan; $cs++) { + + // Resolve the frame's width(s) with other cells + $col =& $this->get_column($this->__col + $cs); + + // Note: $var is either 'percent' or 'absolute'. We compare the + // requested percentage or absolute values with the existing widths + // and adjust accordingly. + if (isset($var) && $val > $col[$var]) { + $col[$var] = $val; + $col["auto"] = false; + } + + $min += $col["min-width"]; + $max += $col["max-width"]; + } + + if ($frame_min > $min) { + // The frame needs more space. Expand each sub-column + // FIXME try to avoid putting this dummy value when table-layout:fixed + $inc = ($this->is_layout_fixed() ? 10e-10 : ($frame_min - $min) / $colspan); + for ($c = 0; $c < $colspan; $c++) { + $col =& $this->get_column($this->__col + $c); + $col["min-width"] += $inc; + } + } + + if ($frame_max > $max) { + // FIXME try to avoid putting this dummy value when table-layout:fixed + $inc = ($this->is_layout_fixed() ? 10e-10 : ($frame_max - $max) / $colspan); + for ($c = 0; $c < $colspan; $c++) { + $col =& $this->get_column($this->__col + $c); + $col["max-width"] += $inc; + } + } + } + + $this->__col += $colspan; + if ($this->__col > $this->_num_cols) { + $this->_num_cols = $this->__col; + } + } + + /** + * + */ + public function add_row() + { + $this->__row++; + $this->_num_rows++; + + // Find the next available column + $i = 0; + while (isset($this->_cells[$this->__row][$i])) { + $i++; + } + + $this->__col = $i; + } + + /** + * Remove a row from the cellmap. + * + * @param Frame + */ + public function remove_row(Frame $row) + { + $key = $row->get_id(); + if (!isset($this->_frames[$key])) { + return; // Presumably this row has alredy been removed + } + + $this->__row = $this->_num_rows--; + + $rows = $this->_frames[$key]["rows"]; + $columns = $this->_frames[$key]["columns"]; + + // Remove all frames from this row + foreach ($rows as $r) { + foreach ($columns as $c) { + if (isset($this->_cells[$r][$c])) { + $id = $this->_cells[$r][$c]->get_id(); + + $this->_cells[$r][$c] = null; + unset($this->_cells[$r][$c]); + + // has multiple rows? + if (isset($this->_frames[$id]) && count($this->_frames[$id]["rows"]) > 1) { + // remove just the desired row, but leave the frame + if (($row_key = array_search($r, $this->_frames[$id]["rows"])) !== false) { + unset($this->_frames[$id]["rows"][$row_key]); + } + continue; + } + + $this->_frames[$id] = null; + unset($this->_frames[$id]); + } + } + + $this->_rows[$r] = null; + unset($this->_rows[$r]); + } + + $this->_frames[$key] = null; + unset($this->_frames[$key]); + } + + /** + * Remove a row group from the cellmap. + * + * @param Frame $group The group to remove + */ + public function remove_row_group(Frame $group) + { + $key = $group->get_id(); + if (!isset($this->_frames[$key])) { + return; // Presumably this row has alredy been removed + } + + $iter = $group->get_first_child(); + while ($iter) { + $this->remove_row($iter); + $iter = $iter->get_next_sibling(); + } + + $this->_frames[$key] = null; + unset($this->_frames[$key]); + } + + /** + * Update a row group after rows have been removed + * + * @param Frame $group The group to update + * @param Frame $last_row The last row in the row group + */ + public function update_row_group(Frame $group, Frame $last_row) + { + $g_key = $group->get_id(); + $r_key = $last_row->get_id(); + + $r_rows = $this->_frames[$g_key]["rows"]; + $this->_frames[$g_key]["rows"] = range($this->_frames[$g_key]["rows"][0], end($r_rows)); + } + + /** + * + */ + public function assign_x_positions() + { + // Pre-condition: widths must be resolved and assigned to columns and + // column[0]["x"] must be set. + + if ($this->_columns_locked) { + return; + } + + $x = $this->_columns[0]["x"]; + foreach (array_keys($this->_columns) as $j) { + $this->_columns[$j]["x"] = $x; + $x += $this->_columns[$j]["used-width"]; + } + } + + /** + * + */ + public function assign_frame_heights() + { + // Pre-condition: widths and heights of each column & row must be + // calcluated + foreach ($this->_frames as $arr) { + $frame = $arr["frame"]; + + $h = 0; + foreach ($arr["rows"] as $row) { + if (!isset($this->_rows[$row])) { + // The row has been removed because of a page split, so skip it. + continue; + } + + $h += $this->_rows[$row]["height"]; + } + + if ($frame instanceof TableCellFrameDecorator) { + $frame->set_cell_height($h); + } else { + $frame->get_style()->height = $h; + } + } + } + + /** + * Re-adjust frame height if the table height is larger than its content + */ + public function set_frame_heights($table_height, $content_height) + { + // Distribute the increased height proportionally amongst each row + foreach ($this->_frames as $arr) { + $frame = $arr["frame"]; + + $h = 0; + foreach ($arr["rows"] as $row) { + if (!isset($this->_rows[$row])) { + continue; + } + + $h += $this->_rows[$row]["height"]; + } + + if ($content_height > 0) { + $new_height = ($h / $content_height) * $table_height; + } else { + $new_height = 0; + } + + if ($frame instanceof TableCellFrameDecorator) { + $frame->set_cell_height($new_height); + } else { + $frame->get_style()->height = $new_height; + } + } + } + + /** + * Used for debugging: + * + * @return string + */ + public function __toString() + { + $str = ""; + $str .= "Columns:
"; + $str .= Helpers::pre_r($this->_columns, true); + $str .= "Rows:
"; + $str .= Helpers::pre_r($this->_rows, true); + + $str .= "Frames:
"; + $arr = array(); + foreach ($this->_frames as $key => $val) { + $arr[$key] = array("columns" => $val["columns"], "rows" => $val["rows"]); + } + + $str .= Helpers::pre_r($arr, true); + + if (php_sapi_name() == "cli") { + $str = strip_tags(str_replace(array("
", "", ""), + array("\n", chr(27) . "[01;33m", chr(27) . "[0m"), + $str)); + } + + return $str; + } +} \ No newline at end of file diff --git a/lib/dompdf/src/Css/AttributeTranslator.php b/lib/dompdf/src/Css/AttributeTranslator.php new file mode 100644 index 0000000..c45d741 --- /dev/null +++ b/lib/dompdf/src/Css/AttributeTranslator.php @@ -0,0 +1,639 @@ + + * @author Fabien Ménager+ * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + */ +namespace Dompdf\Css; + +use Dompdf\Frame; + +/** + * Translates HTML 4.0 attributes into CSS rules + * + * @package dompdf + */ +class AttributeTranslator +{ + static $_style_attr = "_html_style_attribute"; + + // Munged data originally from + // http://www.w3.org/TR/REC-html40/index/attributes.html + // http://www.cs.tut.fi/~jkorpela/html2css.html + static private $__ATTRIBUTE_LOOKUP = array( + //'caption' => array ( 'align' => '', ), + 'img' => array( + 'align' => array( + 'bottom' => 'vertical-align: baseline;', + 'middle' => 'vertical-align: middle;', + 'top' => 'vertical-align: top;', + 'left' => 'float: left;', + 'right' => 'float: right;' + ), + 'border' => 'border: %0.2Fpx solid;', + 'height' => 'height: %spx;', + 'hspace' => 'padding-left: %1$0.2Fpx; padding-right: %1$0.2Fpx;', + 'vspace' => 'padding-top: %1$0.2Fpx; padding-bottom: %1$0.2Fpx;', + 'width' => 'width: %spx;', + ), + 'table' => array( + 'align' => array( + 'left' => 'margin-left: 0; margin-right: auto;', + 'center' => 'margin-left: auto; margin-right: auto;', + 'right' => 'margin-left: auto; margin-right: 0;' + ), + 'bgcolor' => 'background-color: %s;', + 'border' => '!set_table_border', + 'cellpadding' => '!set_table_cellpadding', //'border-spacing: %0.2F; border-collapse: separate;', + 'cellspacing' => '!set_table_cellspacing', + 'frame' => array( + 'void' => 'border-style: none;', + 'above' => 'border-top-style: solid;', + 'below' => 'border-bottom-style: solid;', + 'hsides' => 'border-left-style: solid; border-right-style: solid;', + 'vsides' => 'border-top-style: solid; border-bottom-style: solid;', + 'lhs' => 'border-left-style: solid;', + 'rhs' => 'border-right-style: solid;', + 'box' => 'border-style: solid;', + 'border' => 'border-style: solid;' + ), + 'rules' => '!set_table_rules', + 'width' => 'width: %s;', + ), + 'hr' => array( + 'align' => '!set_hr_align', // Need to grab width to set 'left' & 'right' correctly + 'noshade' => 'border-style: solid;', + 'size' => '!set_hr_size', //'border-width: %0.2F px;', + 'width' => 'width: %s;', + ), + 'div' => array( + 'align' => 'text-align: %s;', + ), + 'h1' => array( + 'align' => 'text-align: %s;', + ), + 'h2' => array( + 'align' => 'text-align: %s;', + ), + 'h3' => array( + 'align' => 'text-align: %s;', + ), + 'h4' => array( + 'align' => 'text-align: %s;', + ), + 'h5' => array( + 'align' => 'text-align: %s;', + ), + 'h6' => array( + 'align' => 'text-align: %s;', + ), + //TODO: translate more form element attributes + 'input' => array( + 'size' => '!set_input_width' + ), + 'p' => array( + 'align' => 'text-align: %s;', + ), +// 'col' => array( +// 'align' => '', +// 'valign' => '', +// ), +// 'colgroup' => array( +// 'align' => '', +// 'valign' => '', +// ), + 'tbody' => array( + 'align' => '!set_table_row_align', + 'valign' => '!set_table_row_valign', + ), + 'td' => array( + 'align' => 'text-align: %s;', + 'bgcolor' => '!set_background_color', + 'height' => 'height: %s;', + 'nowrap' => 'white-space: nowrap;', + 'valign' => 'vertical-align: %s;', + 'width' => 'width: %s;', + ), + 'tfoot' => array( + 'align' => '!set_table_row_align', + 'valign' => '!set_table_row_valign', + ), + 'th' => array( + 'align' => 'text-align: %s;', + 'bgcolor' => '!set_background_color', + 'height' => 'height: %s;', + 'nowrap' => 'white-space: nowrap;', + 'valign' => 'vertical-align: %s;', + 'width' => 'width: %s;', + ), + 'thead' => array( + 'align' => '!set_table_row_align', + 'valign' => '!set_table_row_valign', + ), + 'tr' => array( + 'align' => '!set_table_row_align', + 'bgcolor' => '!set_table_row_bgcolor', + 'valign' => '!set_table_row_valign', + ), + 'body' => array( + 'background' => 'background-image: url(%s);', + 'bgcolor' => '!set_background_color', + 'link' => '!set_body_link', + 'text' => '!set_color', + ), + 'br' => array( + 'clear' => 'clear: %s;', + ), + 'basefont' => array( + 'color' => '!set_color', + 'face' => 'font-family: %s;', + 'size' => '!set_basefont_size', + ), + 'font' => array( + 'color' => '!set_color', + 'face' => 'font-family: %s;', + 'size' => '!set_font_size', + ), + 'dir' => array( + 'compact' => 'margin: 0.5em 0;', + ), + 'dl' => array( + 'compact' => 'margin: 0.5em 0;', + ), + 'menu' => array( + 'compact' => 'margin: 0.5em 0;', + ), + 'ol' => array( + 'compact' => 'margin: 0.5em 0;', + 'start' => 'counter-reset: -dompdf-default-counter %d;', + 'type' => 'list-style-type: %s;', + ), + 'ul' => array( + 'compact' => 'margin: 0.5em 0;', + 'type' => 'list-style-type: %s;', + ), + 'li' => array( + 'type' => 'list-style-type: %s;', + 'value' => 'counter-reset: -dompdf-default-counter %d;', + ), + 'pre' => array( + 'width' => 'width: %s;', + ), + ); + + static protected $_last_basefont_size = 3; + static protected $_font_size_lookup = array( + // For basefont support + -3 => "4pt", + -2 => "5pt", + -1 => "6pt", + 0 => "7pt", + + 1 => "8pt", + 2 => "10pt", + 3 => "12pt", + 4 => "14pt", + 5 => "18pt", + 6 => "24pt", + 7 => "34pt", + + // For basefont support + 8 => "48pt", + 9 => "44pt", + 10 => "52pt", + 11 => "60pt", + ); + + /** + * @param Frame $frame + */ + static function translate_attributes(Frame $frame) + { + $node = $frame->get_node(); + $tag = $node->nodeName; + + if (!isset(self::$__ATTRIBUTE_LOOKUP[$tag])) { + return; + } + + $valid_attrs = self::$__ATTRIBUTE_LOOKUP[$tag]; + $attrs = $node->attributes; + $style = rtrim($node->getAttribute(self::$_style_attr), "; "); + if ($style != "") { + $style .= ";"; + } + + foreach ($attrs as $attr => $attr_node) { + if (!isset($valid_attrs[$attr])) { + continue; + } + + $value = $attr_node->value; + + $target = $valid_attrs[$attr]; + + // Look up $value in $target, if $target is an array: + if (is_array($target)) { + if (isset($target[$value])) { + $style .= " " . self::_resolve_target($node, $target[$value], $value); + } + } else { + // otherwise use target directly + $style .= " " . self::_resolve_target($node, $target, $value); + } + } + + if (!is_null($style)) { + $style = ltrim($style); + $node->setAttribute(self::$_style_attr, $style); + } + + } + + /** + * @param \DOMNode $node + * @param string $target + * @param string $value + * + * @return string + */ + static protected function _resolve_target(\DOMNode $node, $target, $value) + { + if ($target[0] === "!") { + // Function call + $func = "_" . mb_substr($target, 1); + + return self::$func($node, $value); + } + + return $value ? sprintf($target, $value) : ""; + } + + /** + * @param \DOMElement $node + * @param string $new_style + */ + static function append_style(\DOMElement $node, $new_style) + { + $style = rtrim($node->getAttribute(self::$_style_attr), ";"); + $style .= $new_style; + $style = ltrim($style, ";"); + $node->setAttribute(self::$_style_attr, $style); + } + + /** + * @param \DOMNode $node + * + * @return \DOMNodeList|\DOMElement[] + */ + static protected function get_cell_list(\DOMNode $node) + { + $xpath = new \DOMXpath($node->ownerDocument); + + switch ($node->nodeName) { + default: + case "table": + $query = "tr/td | thead/tr/td | tbody/tr/td | tfoot/tr/td | tr/th | thead/tr/th | tbody/tr/th | tfoot/tr/th"; + break; + + case "tbody": + case "tfoot": + case "thead": + $query = "tr/td | tr/th"; + break; + + case "tr": + $query = "td | th"; + break; + } + + return $xpath->query($query, $node); + } + + /** + * @param string $value + * + * @return string + */ + static protected function _get_valid_color($value) + { + if (preg_match('/^#?([0-9A-F]{6})$/i', $value, $matches)) { + $value = "#$matches[1]"; + } + + return $value; + } + + /** + * @param \DOMElement $node + * @param string $value + * + * @return string + */ + static protected function _set_color(\DOMElement $node, $value) + { + $value = self::_get_valid_color($value); + + return "color: $value;"; + } + + /** + * @param \DOMElement $node + * @param string $value + * + * @return string + */ + static protected function _set_background_color(\DOMElement $node, $value) + { + $value = self::_get_valid_color($value); + + return "background-color: $value;"; + } + + /** + * @param \DOMElement $node + * @param string $value + * + * @return null + */ + static protected function _set_table_cellpadding(\DOMElement $node, $value) + { + $cell_list = self::get_cell_list($node); + + foreach ($cell_list as $cell) { + self::append_style($cell, "; padding: {$value}px;"); + } + + return null; + } + + /** + * @param \DOMElement $node + * @param string $value + * + * @return string + */ + static protected function _set_table_border(\DOMElement $node, $value) + { + $cell_list = self::get_cell_list($node); + + foreach ($cell_list as $cell) { + $style = rtrim($cell->getAttribute(self::$_style_attr)); + $style .= "; border-width: " . ($value > 0 ? 1 : 0) . "pt; border-style: inset;"; + $style = ltrim($style, ";"); + $cell->setAttribute(self::$_style_attr, $style); + } + + $style = rtrim($node->getAttribute(self::$_style_attr), ";"); + $style .= "; border-width: $value" . "px; "; + + return ltrim($style, "; "); + } + + /** + * @param \DOMElement $node + * @param string $value + * + * @return string + */ + static protected function _set_table_cellspacing(\DOMElement $node, $value) + { + $style = rtrim($node->getAttribute(self::$_style_attr), ";"); + + if ($value == 0) { + $style .= "; border-collapse: collapse;"; + } else { + $style .= "; border-spacing: {$value}px; border-collapse: separate;"; + } + + return ltrim($style, ";"); + } + + /** + * @param \DOMElement $node + * @param string $value + * + * @return null|string + */ + static protected function _set_table_rules(\DOMElement $node, $value) + { + $new_style = "; border-collapse: collapse;"; + + switch ($value) { + case "none": + $new_style .= "border-style: none;"; + break; + + case "groups": + // FIXME: unsupported + return null; + + case "rows": + $new_style .= "border-style: solid none solid none; border-width: 1px; "; + break; + + case "cols": + $new_style .= "border-style: none solid none solid; border-width: 1px; "; + break; + + case "all": + $new_style .= "border-style: solid; border-width: 1px; "; + break; + + default: + // Invalid value + return null; + } + + $cell_list = self::get_cell_list($node); + + foreach ($cell_list as $cell) { + $style = $cell->getAttribute(self::$_style_attr); + $style .= $new_style; + $cell->setAttribute(self::$_style_attr, $style); + } + + $style = rtrim($node->getAttribute(self::$_style_attr), ";"); + $style .= "; border-collapse: collapse; "; + + return ltrim($style, "; "); + } + + /** + * @param \DOMElement $node + * @param string $value + * + * @return string + */ + static protected function _set_hr_size(\DOMElement $node, $value) + { + $style = rtrim($node->getAttribute(self::$_style_attr), ";"); + $style .= "; border-width: " . max(0, $value - 2) . "; "; + + return ltrim($style, "; "); + } + + /** + * @param \DOMElement $node + * @param string $value + * + * @return null|string + */ + static protected function _set_hr_align(\DOMElement $node, $value) + { + $style = rtrim($node->getAttribute(self::$_style_attr), ";"); + $width = $node->getAttribute("width"); + + if ($width == "") { + $width = "100%"; + } + + $remainder = 100 - (double)rtrim($width, "% "); + + switch ($value) { + case "left": + $style .= "; margin-right: $remainder %;"; + break; + + case "right": + $style .= "; margin-left: $remainder %;"; + break; + + case "center": + $style .= "; margin-left: auto; margin-right: auto;"; + break; + + default: + return null; + } + + return ltrim($style, "; "); + } + + /** + * @param \DOMElement $node + * @param string $value + * + * @return null|string + */ + static protected function _set_input_width(\DOMElement $node, $value) + { + if (empty($value)) { return null; } + + if ($node->hasAttribute("type") && in_array(strtolower($node->getAttribute("type")), array("text","password"))) { + return sprintf("width: %Fem", (((int)$value * .65)+2)); + } else { + return sprintf("width: %upx;", (int)$value); + } + } + + /** + * @param \DOMElement $node + * @param string $value + * + * @return null + */ + static protected function _set_table_row_align(\DOMElement $node, $value) + { + $cell_list = self::get_cell_list($node); + + foreach ($cell_list as $cell) { + self::append_style($cell, "; text-align: $value;"); + } + + return null; + } + + /** + * @param \DOMElement $node + * @param string $value + * + * @return null + */ + static protected function _set_table_row_valign(\DOMElement $node, $value) + { + $cell_list = self::get_cell_list($node); + + foreach ($cell_list as $cell) { + self::append_style($cell, "; vertical-align: $value;"); + } + + return null; + } + + /** + * @param \DOMElement $node + * @param string $value + * + * @return null + */ + static protected function _set_table_row_bgcolor(\DOMElement $node, $value) + { + $cell_list = self::get_cell_list($node); + $value = self::_get_valid_color($value); + + foreach ($cell_list as $cell) { + self::append_style($cell, "; background-color: $value;"); + } + + return null; + } + + /** + * @param \DOMElement $node + * @param string $value + * + * @return null + */ + static protected function _set_body_link(\DOMElement $node, $value) + { + $a_list = $node->getElementsByTagName("a"); + $value = self::_get_valid_color($value); + + foreach ($a_list as $a) { + self::append_style($a, "; color: $value;"); + } + + return null; + } + + /** + * @param \DOMElement $node + * @param string $value + * + * @return null + */ + static protected function _set_basefont_size(\DOMElement $node, $value) + { + // FIXME: ? we don't actually set the font size of anything here, just + // the base size for later modification by tags. + self::$_last_basefont_size = $value; + + return null; + } + + /** + * @param \DOMElement $node + * @param string $value + * + * @return string + */ + static protected function _set_font_size(\DOMElement $node, $value) + { + $style = $node->getAttribute(self::$_style_attr); + + if ($value[0] === "-" || $value[0] === "+") { + $value = self::$_last_basefont_size + (int)$value; + } + + if (isset(self::$_font_size_lookup[$value])) { + $style .= "; font-size: " . self::$_font_size_lookup[$value] . ";"; + } else { + $style .= "; font-size: $value;"; + } + + return ltrim($style, "; "); + } +} diff --git a/lib/dompdf/src/Css/Color.php b/lib/dompdf/src/Css/Color.php new file mode 100644 index 0000000..5ba6f60 --- /dev/null +++ b/lib/dompdf/src/Css/Color.php @@ -0,0 +1,307 @@ + + * @author Fabien Ménager + * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + */ + +namespace Dompdf\Css; + +use Dompdf\Helpers; + +class Color +{ + static $cssColorNames = array( + "aliceblue" => "F0F8FF", + "antiquewhite" => "FAEBD7", + "aqua" => "00FFFF", + "aquamarine" => "7FFFD4", + "azure" => "F0FFFF", + "beige" => "F5F5DC", + "bisque" => "FFE4C4", + "black" => "000000", + "blanchedalmond" => "FFEBCD", + "blue" => "0000FF", + "blueviolet" => "8A2BE2", + "brown" => "A52A2A", + "burlywood" => "DEB887", + "cadetblue" => "5F9EA0", + "chartreuse" => "7FFF00", + "chocolate" => "D2691E", + "coral" => "FF7F50", + "cornflowerblue" => "6495ED", + "cornsilk" => "FFF8DC", + "crimson" => "DC143C", + "cyan" => "00FFFF", + "darkblue" => "00008B", + "darkcyan" => "008B8B", + "darkgoldenrod" => "B8860B", + "darkgray" => "A9A9A9", + "darkgreen" => "006400", + "darkgrey" => "A9A9A9", + "darkkhaki" => "BDB76B", + "darkmagenta" => "8B008B", + "darkolivegreen" => "556B2F", + "darkorange" => "FF8C00", + "darkorchid" => "9932CC", + "darkred" => "8B0000", + "darksalmon" => "E9967A", + "darkseagreen" => "8FBC8F", + "darkslateblue" => "483D8B", + "darkslategray" => "2F4F4F", + "darkslategrey" => "2F4F4F", + "darkturquoise" => "00CED1", + "darkviolet" => "9400D3", + "deeppink" => "FF1493", + "deepskyblue" => "00BFFF", + "dimgray" => "696969", + "dimgrey" => "696969", + "dodgerblue" => "1E90FF", + "firebrick" => "B22222", + "floralwhite" => "FFFAF0", + "forestgreen" => "228B22", + "fuchsia" => "FF00FF", + "gainsboro" => "DCDCDC", + "ghostwhite" => "F8F8FF", + "gold" => "FFD700", + "goldenrod" => "DAA520", + "gray" => "808080", + "green" => "008000", + "greenyellow" => "ADFF2F", + "grey" => "808080", + "honeydew" => "F0FFF0", + "hotpink" => "FF69B4", + "indianred" => "CD5C5C", + "indigo" => "4B0082", + "ivory" => "FFFFF0", + "khaki" => "F0E68C", + "lavender" => "E6E6FA", + "lavenderblush" => "FFF0F5", + "lawngreen" => "7CFC00", + "lemonchiffon" => "FFFACD", + "lightblue" => "ADD8E6", + "lightcoral" => "F08080", + "lightcyan" => "E0FFFF", + "lightgoldenrodyellow" => "FAFAD2", + "lightgray" => "D3D3D3", + "lightgreen" => "90EE90", + "lightgrey" => "D3D3D3", + "lightpink" => "FFB6C1", + "lightsalmon" => "FFA07A", + "lightseagreen" => "20B2AA", + "lightskyblue" => "87CEFA", + "lightslategray" => "778899", + "lightslategrey" => "778899", + "lightsteelblue" => "B0C4DE", + "lightyellow" => "FFFFE0", + "lime" => "00FF00", + "limegreen" => "32CD32", + "linen" => "FAF0E6", + "magenta" => "FF00FF", + "maroon" => "800000", + "mediumaquamarine" => "66CDAA", + "mediumblue" => "0000CD", + "mediumorchid" => "BA55D3", + "mediumpurple" => "9370DB", + "mediumseagreen" => "3CB371", + "mediumslateblue" => "7B68EE", + "mediumspringgreen" => "00FA9A", + "mediumturquoise" => "48D1CC", + "mediumvioletred" => "C71585", + "midnightblue" => "191970", + "mintcream" => "F5FFFA", + "mistyrose" => "FFE4E1", + "moccasin" => "FFE4B5", + "navajowhite" => "FFDEAD", + "navy" => "000080", + "oldlace" => "FDF5E6", + "olive" => "808000", + "olivedrab" => "6B8E23", + "orange" => "FFA500", + "orangered" => "FF4500", + "orchid" => "DA70D6", + "palegoldenrod" => "EEE8AA", + "palegreen" => "98FB98", + "paleturquoise" => "AFEEEE", + "palevioletred" => "DB7093", + "papayawhip" => "FFEFD5", + "peachpuff" => "FFDAB9", + "peru" => "CD853F", + "pink" => "FFC0CB", + "plum" => "DDA0DD", + "powderblue" => "B0E0E6", + "purple" => "800080", + "red" => "FF0000", + "rosybrown" => "BC8F8F", + "royalblue" => "4169E1", + "saddlebrown" => "8B4513", + "salmon" => "FA8072", + "sandybrown" => "F4A460", + "seagreen" => "2E8B57", + "seashell" => "FFF5EE", + "sienna" => "A0522D", + "silver" => "C0C0C0", + "skyblue" => "87CEEB", + "slateblue" => "6A5ACD", + "slategray" => "708090", + "slategrey" => "708090", + "snow" => "FFFAFA", + "springgreen" => "00FF7F", + "steelblue" => "4682B4", + "tan" => "D2B48C", + "teal" => "008080", + "thistle" => "D8BFD8", + "tomato" => "FF6347", + "turquoise" => "40E0D0", + "violet" => "EE82EE", + "wheat" => "F5DEB3", + "white" => "FFFFFF", + "whitesmoke" => "F5F5F5", + "yellow" => "FFFF00", + "yellowgreen" => "9ACD32", + ); + + /** + * @param $color + * @return array|mixed|null|string + */ + static function parse($color) + { + if (is_array($color)) { + // Assume the array has the right format... + // FIXME: should/could verify this. + return $color; + } + + static $cache = array(); + + $color = strtolower($color); + + if (isset($cache[$color])) { + return $cache[$color]; + } + + if (in_array($color, array("transparent", "inherit"))) { + return $cache[$color] = $color; + } + + if (isset(self::$cssColorNames[$color])) { + return $cache[$color] = self::getArray(self::$cssColorNames[$color]); + } + + $length = mb_strlen($color); + + // #rgb format + if ($length == 4 && $color[0] === "#") { + return $cache[$color] = self::getArray($color[1] . $color[1] . $color[2] . $color[2] . $color[3] . $color[3]); + } // #rgba format + else if ($length == 5 && $color[0] === "#") { + $alpha = round(hexdec($color[4] . $color[4])/255, 2); + return $cache[$color] = self::getArray($color[1] . $color[1] . $color[2] . $color[2] . $color[3] . $color[3], $alpha); + } // #rrggbb format + else if ($length == 7 && $color[0] === "#") { + return $cache[$color] = self::getArray(mb_substr($color, 1, 6)); + } // #rrggbbaa format + else if ($length == 9 && $color[0] === "#") { + $alpha = round(hexdec(mb_substr($color, 7, 2))/255, 2); + return $cache[$color] = self::getArray(mb_substr($color, 1, 8), $alpha); + } // rgb( r,g,b ) / rgbaa( r,g,b,α ) format + else if (mb_strpos($color, "rgb") !== false) { + $i = mb_strpos($color, "("); + $j = mb_strpos($color, ")"); + + // Bad color value + if ($i === false || $j === false) { + return null; + } + + $triplet = explode(",", mb_substr($color, $i + 1, $j - $i - 1)); + + // alpha transparency + // FIXME: not currently using transparency + $alpha = 1.0; + if (count($triplet) == 4) { + $alpha = (float)(trim(array_pop($triplet))); + // bad value, set to fully opaque + if ($alpha > 1.0 || $alpha < 0.0) { + $alpha = 1.0; + } + } + + if (count($triplet) != 3) { + return null; + } + + foreach (array_keys($triplet) as $c) { + $triplet[$c] = trim($triplet[$c]); + + if (Helpers::is_percent($triplet[$c])) { + $triplet[$c] = round((float)$triplet[$c] * 2.55); + } + } + + return $cache[$color] = self::getArray(vsprintf("%02X%02X%02X", $triplet), $alpha); + + } + + // cmyk( c,m,y,k ) format + // http://www.w3.org/TR/css3-gcpm/#cmyk-colors + else if (mb_strpos($color, "cmyk") !== false) { + $i = mb_strpos($color, "("); + $j = mb_strpos($color, ")"); + + // Bad color value + if ($i === false || $j === false) { + return null; + } + + $values = explode(",", mb_substr($color, $i + 1, $j - $i - 1)); + + if (count($values) != 4) { + return null; + } + + $values = array_map(function($c) { + return min(1.0, max(0.0, floatval(trim($c)))); + }, $values); + + return $cache[$color] = self::getArray($values); + } + + return null; + } + + /** + * @param $color + * @param float $alpha + * @return array + */ + static function getArray($color, $alpha = 1.0) + { + $c = array(null, null, null, null, "alpha" => $alpha, "hex" => null); + + if (is_array($color)) { + $c = $color; + $c["c"] = $c[0]; + $c["m"] = $c[1]; + $c["y"] = $c[2]; + $c["k"] = $c[3]; + $c["alpha"] = $alpha; + $c["hex"] = "cmyk($c[0],$c[1],$c[2],$c[3])"; + } else { + $c[0] = hexdec(mb_substr($color, 0, 2)) / 0xff; + $c[1] = hexdec(mb_substr($color, 2, 2)) / 0xff; + $c[2] = hexdec(mb_substr($color, 4, 2)) / 0xff; + $c["r"] = $c[0]; + $c["g"] = $c[1]; + $c["b"] = $c[2]; + $c["alpha"] = $alpha; + $c["hex"] = sprintf("#%s%02X", mb_substr($color, 0, 6), round($alpha * 255)); + } + + return $c; + } +} diff --git a/lib/dompdf/src/Css/Style.php b/lib/dompdf/src/Css/Style.php new file mode 100644 index 0000000..8498a08 --- /dev/null +++ b/lib/dompdf/src/Css/Style.php @@ -0,0 +1,2937 @@ + + * @author Helmut Tischer + * @author Fabien Ménager + * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + */ +namespace Dompdf\Css; + +use Dompdf\Adapter\CPDF; +use Dompdf\Exception; +use Dompdf\Helpers; +use Dompdf\FontMetrics; +use Dompdf\Frame; + +/** + * Represents CSS properties. + * + * The Style class is responsible for handling and storing CSS properties. + * It includes methods to resolve colors and lengths, as well as getters & + * setters for many CSS properites. + * + * Actual CSS parsing is performed in the {@link Stylesheet} class. + * + * @package dompdf + */ +class Style +{ + + const CSS_IDENTIFIER = "-?[_a-zA-Z]+[_a-zA-Z0-9-]*"; + const CSS_INTEGER = "-?\d+"; + + /** + * Default font size, in points. + * + * @var float + */ + static $default_font_size = 12; + + /** + * Default line height, as a fraction of the font size. + * + * @var float + */ + static $default_line_height = 1.2; + + /** + * Default "absolute" font sizes relative to the default font-size + * http://www.w3.org/TR/css3-fonts/#font-size-the-font-size-property + * @var array + */ + static $font_size_keywords = array( + "xx-small" => 0.6, // 3/5 + "x-small" => 0.75, // 3/4 + "small" => 0.889, // 8/9 + "medium" => 1, // 1 + "large" => 1.2, // 6/5 + "x-large" => 1.5, // 3/2 + "xx-large" => 2.0, // 2/1 + ); + + /** + * List of valid vertical-align keywords. Should also really be a constant. + * + * @var array + */ + static $vertical_align_keywords = array("baseline", "bottom", "middle", "sub", + "super", "text-bottom", "text-top", "top"); + + /** + * List of all inline types. Should really be a constant. + * + * @var array + */ + static $INLINE_TYPES = array("inline"); + + /** + * List of all block types. Should really be a constant. + * + * @var array + */ + static $BLOCK_TYPES = array("block", "inline-block", "table-cell", "list-item"); + + /** + * List of all positionned types. Should really be a constant. + * + * @var array + */ + static $POSITIONNED_TYPES = array("relative", "absolute", "fixed"); + + /** + * List of all table types. Should really be a constant. + * + * @var array; + */ + static $TABLE_TYPES = array("table", "inline-table"); + + /** + * List of valid border styles. Should also really be a constant. + * + * @var array + */ + static $BORDER_STYLES = array("none", "hidden", "dotted", "dashed", "solid", + "double", "groove", "ridge", "inset", "outset"); + + /** + * Default style values. + * + * @link http://www.w3.org/TR/CSS21/propidx.html + * + * @var array + */ + static protected $_defaults = null; + + /** + * List of inherited properties + * + * @link http://www.w3.org/TR/CSS21/propidx.html + * + * @var array + */ + static protected $_inherited = null; + + /** + * Caches method_exists result + * + * @var array + */ + static protected $_methods_cache = array(); + + /** + * The stylesheet this style belongs to + * + * @see Stylesheet + * @var Stylesheet + */ + protected $_stylesheet; // stylesheet this style is attached to + + /** + * Media queries attached to the style + * + * @var int + */ + protected $_media_queries; + + /** + * Main array of all CSS properties & values + * + * @var array + */ + protected $_props; + + /* var instead of protected would allow access outside of class */ + protected $_important_props; + + /** + * Cached property values + * + * @var array + */ + protected $_prop_cache; + + /** + * Font size of parent element in document tree. Used for relative font + * size resolution. + * + * @var float + */ + protected $_parent_font_size; // Font size of parent element + + protected $_font_family; + + /** + * @var Frame + */ + protected $_frame; + + /** + * The origin of the style + * + * @var int + */ + protected $_origin = Stylesheet::ORIG_AUTHOR; + + // private members + /** + * True once the font size is resolved absolutely + * + * @var bool + */ + private $__font_size_calculated; // Cache flag + + /** + * The computed bottom spacing + */ + private $_computed_bottom_spacing = null; + + /** + * The computed border radius + */ + private $_computed_border_radius = null; + + /** + * @var bool + */ + public $_has_border_radius = false; + + /** + * @var FontMetrics + */ + private $fontMetrics; + + /** + * Class constructor + * + * @param Stylesheet $stylesheet the stylesheet this Style is associated with. + * @param int $origin + */ + public function __construct(Stylesheet $stylesheet, $origin = Stylesheet::ORIG_AUTHOR) + { + $this->setFontMetrics($stylesheet->getFontMetrics()); + + $this->_props = array(); + $this->_important_props = array(); + $this->_stylesheet = $stylesheet; + $this->_media_queries = array(); + $this->_origin = $origin; + $this->_parent_font_size = null; + $this->__font_size_calculated = false; + + if (!isset(self::$_defaults)) { + + // Shorthand + $d =& self::$_defaults; + + // All CSS 2.1 properties, and their default values + $d["azimuth"] = "center"; + $d["background_attachment"] = "scroll"; + $d["background_color"] = "transparent"; + $d["background_image"] = "none"; + $d["background_image_resolution"] = "normal"; + $d["_dompdf_background_image_resolution"] = $d["background_image_resolution"]; + $d["background_position"] = "0% 0%"; + $d["background_repeat"] = "repeat"; + $d["background"] = ""; + $d["border_collapse"] = "separate"; + $d["border_color"] = ""; + $d["border_spacing"] = "0"; + $d["border_style"] = ""; + $d["border_top"] = ""; + $d["border_right"] = ""; + $d["border_bottom"] = ""; + $d["border_left"] = ""; + $d["border_top_color"] = ""; + $d["border_right_color"] = ""; + $d["border_bottom_color"] = ""; + $d["border_left_color"] = ""; + $d["border_top_style"] = "none"; + $d["border_right_style"] = "none"; + $d["border_bottom_style"] = "none"; + $d["border_left_style"] = "none"; + $d["border_top_width"] = "medium"; + $d["border_right_width"] = "medium"; + $d["border_bottom_width"] = "medium"; + $d["border_left_width"] = "medium"; + $d["border_width"] = "medium"; + $d["border_bottom_left_radius"] = ""; + $d["border_bottom_right_radius"] = ""; + $d["border_top_left_radius"] = ""; + $d["border_top_right_radius"] = ""; + $d["border_radius"] = ""; + $d["border"] = ""; + $d["bottom"] = "auto"; + $d["caption_side"] = "top"; + $d["clear"] = "none"; + $d["clip"] = "auto"; + $d["color"] = "#000000"; + $d["content"] = "normal"; + $d["counter_increment"] = "none"; + $d["counter_reset"] = "none"; + $d["cue_after"] = "none"; + $d["cue_before"] = "none"; + $d["cue"] = ""; + $d["cursor"] = "auto"; + $d["direction"] = "ltr"; + $d["display"] = "inline"; + $d["elevation"] = "level"; + $d["empty_cells"] = "show"; + $d["float"] = "none"; + $d["font_family"] = $stylesheet->get_dompdf()->getOptions()->getDefaultFont(); + $d["font_size"] = "medium"; + $d["font_style"] = "normal"; + $d["font_variant"] = "normal"; + $d["font_weight"] = "normal"; + $d["font"] = ""; + $d["height"] = "auto"; + $d["image_resolution"] = "normal"; + $d["_dompdf_image_resolution"] = $d["image_resolution"]; + $d["_dompdf_keep"] = ""; + $d["left"] = "auto"; + $d["letter_spacing"] = "normal"; + $d["line_height"] = "normal"; + $d["list_style_image"] = "none"; + $d["list_style_position"] = "outside"; + $d["list_style_type"] = "disc"; + $d["list_style"] = ""; + $d["margin_right"] = "0"; + $d["margin_left"] = "0"; + $d["margin_top"] = "0"; + $d["margin_bottom"] = "0"; + $d["margin"] = ""; + $d["max_height"] = "none"; + $d["max_width"] = "none"; + $d["min_height"] = "0"; + $d["min_width"] = "0"; + $d["opacity"] = "1.0"; // CSS3 + $d["orphans"] = "2"; + $d["outline_color"] = ""; // "invert" special color is not supported + $d["outline_style"] = "none"; + $d["outline_width"] = "medium"; + $d["outline"] = ""; + $d["overflow"] = "visible"; + $d["padding_top"] = "0"; + $d["padding_right"] = "0"; + $d["padding_bottom"] = "0"; + $d["padding_left"] = "0"; + $d["padding"] = ""; + $d["page_break_after"] = "auto"; + $d["page_break_before"] = "auto"; + $d["page_break_inside"] = "auto"; + $d["pause_after"] = "0"; + $d["pause_before"] = "0"; + $d["pause"] = ""; + $d["pitch_range"] = "50"; + $d["pitch"] = "medium"; + $d["play_during"] = "auto"; + $d["position"] = "static"; + $d["quotes"] = ""; + $d["richness"] = "50"; + $d["right"] = "auto"; + $d["size"] = "auto"; // @page + $d["speak_header"] = "once"; + $d["speak_numeral"] = "continuous"; + $d["speak_punctuation"] = "none"; + $d["speak"] = "normal"; + $d["speech_rate"] = "medium"; + $d["stress"] = "50"; + $d["table_layout"] = "auto"; + $d["text_align"] = "left"; + $d["text_decoration"] = "none"; + $d["text_indent"] = "0"; + $d["text_transform"] = "none"; + $d["top"] = "auto"; + $d["transform"] = "none"; // CSS3 + $d["transform_origin"] = "50% 50%"; // CSS3 + $d["_webkit_transform"] = $d["transform"]; // CSS3 + $d["_webkit_transform_origin"] = $d["transform_origin"]; // CSS3 + $d["unicode_bidi"] = "normal"; + $d["vertical_align"] = "baseline"; + $d["visibility"] = "visible"; + $d["voice_family"] = ""; + $d["volume"] = "medium"; + $d["white_space"] = "normal"; + $d["word_wrap"] = "normal"; + $d["widows"] = "2"; + $d["width"] = "auto"; + $d["word_spacing"] = "normal"; + $d["z_index"] = "auto"; + + // for @font-face + $d["src"] = ""; + $d["unicode_range"] = ""; + + // Properties that inherit by default + self::$_inherited = array( + "azimuth", + "background_image_resolution", + "border_collapse", + "border_spacing", + "caption_side", + "color", + "cursor", + "direction", + "elevation", + "empty_cells", + "font_family", + "font_size", + "font_style", + "font_variant", + "font_weight", + "font", + "image_resolution", + "letter_spacing", + "line_height", + "list_style_image", + "list_style_position", + "list_style_type", + "list_style", + "orphans", + "page_break_inside", + "pitch_range", + "pitch", + "quotes", + "richness", + "speak_header", + "speak_numeral", + "speak_punctuation", + "speak", + "speech_rate", + "stress", + "text_align", + "text_indent", + "text_transform", + "visibility", + "voice_family", + "volume", + "white_space", + "word_wrap", + "widows", + "word_spacing", + ); + } + } + + /** + * "Destructor": forcibly free all references held by this object + */ + function dispose() + { + } + + /** + * @param $media_queries + */ + function set_media_queries($media_queries) + { + $this->_media_queries = $media_queries; + } + + /** + * @return array|int + */ + function get_media_queries() + { + return $this->_media_queries; + } + + /** + * @param Frame $frame + */ + function set_frame(Frame $frame) + { + $this->_frame = $frame; + } + + /** + * @return Frame + */ + function get_frame() + { + return $this->_frame; + } + + /** + * @param $origin + */ + function set_origin($origin) + { + $this->_origin = $origin; + } + + /** + * @return int + */ + function get_origin() + { + return $this->_origin; + } + + /** + * returns the {@link Stylesheet} this Style is associated with. + * + * @return Stylesheet + */ + function get_stylesheet() + { + return $this->_stylesheet; + } + + /** + * Converts any CSS length value into an absolute length in points. + * + * length_in_pt() takes a single length (e.g. '1em') or an array of + * lengths and returns an absolute length. If an array is passed, then + * the return value is the sum of all elements. If any of the lengths + * provided are "auto" or "none" then that value is returned. + * + * If a reference size is not provided, the default font size is used + * ({@link Style::$default_font_size}). + * + * @param float|string|array $length the numeric length (or string measurement) or array of lengths to resolve + * @param float $ref_size an absolute reference size to resolve percentage lengths + * @return float|string + */ + function length_in_pt($length, $ref_size = null) + { + static $cache = array(); + + if (!isset($ref_size)) { + $ref_size = self::$default_font_size; + } + + if (!is_array($length)) { + $key = $length . "/$ref_size"; + //Early check on cache, before converting $length to array + if (isset($cache[$key])) { + return $cache[$key]; + } + $length = array($length); + } else { + $key = implode("@", $length) . "/$ref_size"; + if (isset($cache[$key])) { + return $cache[$key]; + } + } + + $ret = 0; + foreach ($length as $l) { + + if ($l === "auto") { + return "auto"; + } + + if ($l === "none") { + return "none"; + } + + // Assume numeric values are already in points + if (is_numeric($l)) { + $ret += $l; + continue; + } + + if ($l === "normal") { + $ret += $ref_size; + continue; + } + + // Border lengths + if ($l === "thin") { + $ret += 0.5; + continue; + } + + if ($l === "medium") { + $ret += 1.5; + continue; + } + + if ($l === "thick") { + $ret += 2.5; + continue; + } + + if (($i = mb_strpos($l, "px")) !== false) { + $dpi = $this->_stylesheet->get_dompdf()->getOptions()->getDpi(); + $ret += ((float)mb_substr($l, 0, $i) * 72) / $dpi; + continue; + } + + if (($i = mb_strpos($l, "pt")) !== false) { + $ret += (float)mb_substr($l, 0, $i); + continue; + } + + if (($i = mb_strpos($l, "%")) !== false) { + $ret += (float)mb_substr($l, 0, $i) / 100 * $ref_size; + continue; + } + + if (($i = mb_strpos($l, "rem")) !== false) { + if ($this->_stylesheet->get_dompdf()->getTree()->get_root()->get_style() === null) { + // Interpreting it as "em", see https://github.com/dompdf/dompdf/issues/1406 + $ret += (float)mb_substr($l, 0, $i) * $this->__get("font_size"); + } else { + $ret += (float)mb_substr($l, 0, $i) * $this->_stylesheet->get_dompdf()->getTree()->get_root()->get_style()->font_size; + } + continue; + } + + if (($i = mb_strpos($l, "em")) !== false) { + $ret += (float)mb_substr($l, 0, $i) * $this->__get("font_size"); + continue; + } + + if (($i = mb_strpos($l, "cm")) !== false) { + $ret += (float)mb_substr($l, 0, $i) * 72 / 2.54; + continue; + } + + if (($i = mb_strpos($l, "mm")) !== false) { + $ret += (float)mb_substr($l, 0, $i) * 72 / 25.4; + continue; + } + + // FIXME: em:ex ratio? + if (($i = mb_strpos($l, "ex")) !== false) { + $ret += (float)mb_substr($l, 0, $i) * $this->__get("font_size") / 2; + continue; + } + + if (($i = mb_strpos($l, "in")) !== false) { + $ret += (float)mb_substr($l, 0, $i) * 72; + continue; + } + + if (($i = mb_strpos($l, "pc")) !== false) { + $ret += (float)mb_substr($l, 0, $i) * 12; + continue; + } + + // Bogus value + $ret += (float)$ref_size; + } + + return $cache[$key] = $ret; + } + + + /** + * Set inherited properties in this style using values in $parent + * + * @param Style $parent + * + * @return Style + */ + function inherit(Style $parent) + { + + // Set parent font size + $this->_parent_font_size = $parent->get_font_size(); + + foreach (self::$_inherited as $prop) { + //inherit the !important property also. + //if local property is also !important, don't inherit. + if (isset($parent->_props[$prop]) && + (!isset($this->_props[$prop]) || + (isset($parent->_important_props[$prop]) && !isset($this->_important_props[$prop])) + ) + ) { + if (isset($parent->_important_props[$prop])) { + $this->_important_props[$prop] = true; + } + //see __set and __get, on all assignments clear cache! + $this->_prop_cache[$prop] = null; + $this->_props[$prop] = $parent->_props[$prop]; + } + } + + foreach ($this->_props as $prop => $value) { + if ($value === "inherit") { + if (isset($parent->_important_props[$prop])) { + $this->_important_props[$prop] = true; + } + //do not assign direct, but + //implicite assignment through __set, redirect to specialized, get value with __get + //This is for computing defaults if the parent setting is also missing. + //Therefore do not directly assign the value without __set + //set _important_props before that to be able to propagate. + //see __set and __get, on all assignments clear cache! + //$this->_prop_cache[$prop] = null; + //$this->_props[$prop] = $parent->_props[$prop]; + //props_set for more obvious explicite assignment not implemented, because + //too many implicite uses. + // $this->props_set($prop, $parent->$prop); + $this->__set($prop, $parent->__get($prop)); + } + } + + return $this; + } + + /** + * Override properties in this style with those in $style + * + * @param Style $style + */ + function merge(Style $style) + { + //treat the !important attribute + //if old rule has !important attribute, override with new rule only if + //the new rule is also !important + foreach ($style->_props as $prop => $val) { + if (isset($style->_important_props[$prop])) { + $this->_important_props[$prop] = true; + //see __set and __get, on all assignments clear cache! + $this->_prop_cache[$prop] = null; + $this->_props[$prop] = $val; + } else if (!isset($this->_important_props[$prop])) { + //see __set and __get, on all assignments clear cache! + $this->_prop_cache[$prop] = null; + $this->_props[$prop] = $val; + } + } + + if (isset($style->_props["font_size"])) { + $this->__font_size_calculated = false; + } + } + + /** + * Returns an array(r, g, b, "r"=> r, "g"=>g, "b"=>b, "hex"=>"#rrggbb") + * based on the provided CSS color value. + * + * @param string $color + * @return array + */ + function munge_color($color) + { + return Color::parse($color); + } + + /* direct access to _important_props array from outside would work only when declared as + * 'var $_important_props;' instead of 'protected $_important_props;' + * Don't call _set/__get on missing attribute. Therefore need a special access. + * Assume that __set will be also called when this is called, so do not check validity again. + * Only created, if !important exists -> always set true. + */ + function important_set($prop) + { + $prop = str_replace("-", "_", $prop); + $this->_important_props[$prop] = true; + } + + /** + * @param $prop + * @return bool + */ + function important_get($prop) + { + return isset($this->_important_props[$prop]); + } + + /** + * PHP5 overloaded setter + * + * This function along with {@link Style::__get()} permit a user of the + * Style class to access any (CSS) property using the following syntax: + * + * Style->margin_top = "1em"; + * echo (Style->margin_top); + *
+ * + * __set() automatically calls the provided set function, if one exists, + * otherwise it sets the property directly. Typically, __set() is not + * called directly from outside of this class. + * + * On each modification clear cache to return accurate setting. + * Also affects direct settings not using __set + * For easier finding all assignments, attempted to allowing only explicite assignment: + * Very many uses, e.g. AbstractFrameReflower.php -> for now leave as it is + * function __set($prop, $val) { + * throw new Exception("Implicite replacement of assignment by __set. Not good."); + * } + * function props_set($prop, $val) { ... } + * + * @param string $prop the property to set + * @param mixed $val the value of the property + * + */ + function __set($prop, $val) + { + $prop = str_replace("-", "_", $prop); + $this->_prop_cache[$prop] = null; + + if (!isset(self::$_defaults[$prop])) { + global $_dompdf_warnings; + $_dompdf_warnings[] = "'$prop' is not a valid CSS2 property."; + return; + } + + if ($prop !== "content" && is_string($val) && strlen($val) > 5 && mb_strpos($val, "url") === false) { + $val = mb_strtolower(trim(str_replace(array("\n", "\t"), array(" "), $val))); + $val = preg_replace("/([0-9]+) (pt|px|pc|em|ex|in|cm|mm|%)/S", "\\1\\2", $val); + } + + $method = "set_$prop"; + + if (!isset(self::$_methods_cache[$method])) { + self::$_methods_cache[$method] = method_exists($this, $method); + } + + if (self::$_methods_cache[$method]) { + $this->$method($val); + } else { + $this->_props[$prop] = $val; + } + } + + /** + * PHP5 overloaded getter + * Along with {@link Style::__set()} __get() provides access to all CSS + * properties directly. Typically __get() is not called directly outside + * of this class. + * On each modification clear cache to return accurate setting. + * Also affects direct settings not using __set + * + * @param string $prop + * + * @throws Exception + * @return mixed + */ + function __get($prop) + { + if (!isset(self::$_defaults[$prop])) { + throw new Exception("'$prop' is not a valid CSS2 property."); + } + + if (isset($this->_prop_cache[$prop]) && $this->_prop_cache[$prop] != null) { + return $this->_prop_cache[$prop]; + } + + $method = "get_$prop"; + + // Fall back on defaults if property is not set + if (!isset($this->_props[$prop])) { + $this->_props[$prop] = self::$_defaults[$prop]; + } + + if (!isset(self::$_methods_cache[$method])) { + self::$_methods_cache[$method] = method_exists($this, $method); + } + + if (self::$_methods_cache[$method]) { + return $this->_prop_cache[$prop] = $this->$method(); + } + + return $this->_prop_cache[$prop] = $this->_props[$prop]; + } + + /** + * Similar to __get() without storing the result. Useful for accessing + * properties while loading stylesheets. + * + * @param $prop + * @return string + * @throws Exception + */ + function get_prop($prop) + { + if (!isset(self::$_defaults[$prop])) { + throw new Exception("'$prop' is not a valid CSS2 property."); + } + + $method = "get_$prop"; + + // Fall back on defaults if property is not set + if (!isset($this->_props[$prop])) { + return self::$_defaults[$prop]; + } + + if (method_exists($this, $method)) { + return $this->$method(); + } + + return $this->_props[$prop]; + } + + /** + * @return float|null|string + */ + function computed_bottom_spacing() { + if ($this->_computed_bottom_spacing !== null) { + return $this->_computed_bottom_spacing; + } + return $this->_computed_bottom_spacing = $this->length_in_pt( + array( + $this->margin_bottom, + $this->padding_bottom, + $this->border_bottom_width + ) + ); + } + + /** + * @return string + */ + function get_font_family_raw() + { + return trim($this->_props["font_family"], " \t\n\r\x0B\"'"); + } + + /** + * Getter for the 'font-family' CSS property. + * Uses the {@link FontMetrics} class to resolve the font family into an + * actual font file. + * + * @link http://www.w3.org/TR/CSS21/fonts.html#propdef-font-family + * @throws Exception + * + * @return string + */ + function get_font_family() + { + if (isset($this->_font_family)) { + return $this->_font_family; + } + + $DEBUGCSS = $this->_stylesheet->get_dompdf()->getOptions()->getDebugCss(); + + // Select the appropriate font. First determine the subtype, then check + // the specified font-families for a candidate. + + // Resolve font-weight + $weight = $this->__get("font_weight"); + + if (is_numeric($weight)) { + if ($weight < 600) { + $weight = "normal"; + } else { + $weight = "bold"; + } + } else if ($weight === "bold" || $weight === "bolder") { + $weight = "bold"; + } else { + $weight = "normal"; + } + + // Resolve font-style + $font_style = $this->__get("font_style"); + + if ($weight === "bold" && ($font_style === "italic" || $font_style === "oblique")) { + $subtype = "bold_italic"; + } else if ($weight === "bold" && $font_style !== "italic" && $font_style !== "oblique") { + $subtype = "bold"; + } else if ($weight !== "bold" && ($font_style === "italic" || $font_style === "oblique")) { + $subtype = "italic"; + } else { + $subtype = "normal"; + } + + // Resolve the font family + if ($DEBUGCSS) { + print "[get_font_family:"; + print '(' . $this->_props["font_family"] . '.' . $font_style . '.' . $this->__get("font_weight") . '.' . $weight . '.' . $subtype . ')'; + } + + $families = preg_split("/\s*,\s*/", $this->_props["font_family"]); + + $font = null; + foreach ($families as $family) { + //remove leading and trailing string delimiters, e.g. on font names with spaces; + //remove leading and trailing whitespace + $family = trim($family, " \t\n\r\x0B\"'"); + if ($DEBUGCSS) { + print '(' . $family . ')'; + } + $font = $this->getFontMetrics()->getFont($family, $subtype); + + if ($font) { + if ($DEBUGCSS) print '(' . $font . ")get_font_family]\n"; + return $this->_font_family = $font; + } + } + + $family = null; + if ($DEBUGCSS) { + print '(default)'; + } + $font = $this->getFontMetrics()->getFont($family, $subtype); + + if ($font) { + if ($DEBUGCSS) print '(' . $font . ")get_font_family]\n
array(r,g,b, "r" => r, "g" => g, "b" => b, "hex" => "#rrggbb")
+ *
+ * @link http://www.w3.org/TR/CSS21/colors.html#propdef-color
+ * @return array
+ */
+ function get_color()
+ {
+ return $this->munge_color($this->_props["color"]);
+ }
+
+ /**
+ * Returns the background color as an array
+ *
+ * The returned array has the same format as {@link Style::get_color()}
+ *
+ * @link http://www.w3.org/TR/CSS21/colors.html#propdef-background-color
+ * @return array
+ */
+ function get_background_color()
+ {
+ return $this->munge_color($this->_props["background_color"]);
+ }
+
+ /**
+ * Returns the background position as an array
+ *
+ * The returned array has the following format:
+ * array(x,y, "x" => x, "y" => y)
+ *
+ * @link http://www.w3.org/TR/CSS21/colors.html#propdef-background-position
+ * @return array
+ */
+ function get_background_position()
+ {
+ $tmp = explode(" ", $this->_props["background_position"]);
+
+ switch ($tmp[0]) {
+ case "left":
+ $x = "0%";
+ break;
+
+ case "right":
+ $x = "100%";
+ break;
+
+ case "top":
+ $y = "0%";
+ break;
+
+ case "bottom":
+ $y = "100%";
+ break;
+
+ case "center":
+ $x = "50%";
+ $y = "50%";
+ break;
+
+ default:
+ $x = $tmp[0];
+ break;
+ }
+
+ if (isset($tmp[1])) {
+
+ switch ($tmp[1]) {
+ case "left":
+ $x = "0%";
+ break;
+
+ case "right":
+ $x = "100%";
+ break;
+
+ case "top":
+ $y = "0%";
+ break;
+
+ case "bottom":
+ $y = "100%";
+ break;
+
+ case "center":
+ if ($tmp[0] === "left" || $tmp[0] === "right" || $tmp[0] === "center") {
+ $y = "50%";
+ } else {
+ $x = "50%";
+ }
+ break;
+
+ default:
+ $y = $tmp[1];
+ break;
+ }
+
+ } else {
+ $y = "50%";
+ }
+
+ if (!isset($x)) {
+ $x = "0%";
+ }
+
+ if (!isset($y)) {
+ $y = "0%";
+ }
+
+ return array(
+ 0 => $x, "x" => $x,
+ 1 => $y, "y" => $y,
+ );
+ }
+
+
+ /**
+ * Returns the background as it is currently stored
+ *
+ * (currently anyway only for completeness.
+ * not used for further processing)
+ *
+ * @link http://www.w3.org/TR/CSS21/colors.html#propdef-background-attachment
+ * @return string
+ */
+ function get_background_attachment()
+ {
+ return $this->_props["background_attachment"];
+ }
+
+
+ /**
+ * Returns the background_repeat as it is currently stored
+ *
+ * (currently anyway only for completeness.
+ * not used for further processing)
+ *
+ * @link http://www.w3.org/TR/CSS21/colors.html#propdef-background-repeat
+ * @return string
+ */
+ function get_background_repeat()
+ {
+ return $this->_props["background_repeat"];
+ }
+
+
+ /**
+ * Returns the background as it is currently stored
+ *
+ * (currently anyway only for completeness.
+ * not used for further processing, but the individual get_background_xxx)
+ *
+ * @link http://www.w3.org/TR/CSS21/colors.html#propdef-background
+ * @return string
+ */
+ function get_background()
+ {
+ return $this->_props["background"];
+ }
+
+
+ /**#@+
+ * Returns the border color as an array
+ *
+ * See {@link Style::get_color()}
+ *
+ * @link http://www.w3.org/TR/CSS21/box.html#border-color-properties
+ * @return array
+ */
+ function get_border_top_color()
+ {
+ if ($this->_props["border_top_color"] === "") {
+ //see __set and __get, on all assignments clear cache!
+ $this->_prop_cache["border_top_color"] = null;
+ $this->_props["border_top_color"] = $this->__get("color");
+ }
+
+ return $this->munge_color($this->_props["border_top_color"]);
+ }
+
+ /**
+ * @return array
+ */
+ function get_border_right_color()
+ {
+ if ($this->_props["border_right_color"] === "") {
+ //see __set and __get, on all assignments clear cache!
+ $this->_prop_cache["border_right_color"] = null;
+ $this->_props["border_right_color"] = $this->__get("color");
+ }
+
+ return $this->munge_color($this->_props["border_right_color"]);
+ }
+
+ /**
+ * @return array
+ */
+ function get_border_bottom_color()
+ {
+ if ($this->_props["border_bottom_color"] === "") {
+ //see __set and __get, on all assignments clear cache!
+ $this->_prop_cache["border_bottom_color"] = null;
+ $this->_props["border_bottom_color"] = $this->__get("color");
+ }
+
+ return $this->munge_color($this->_props["border_bottom_color"]);
+ }
+
+ /**
+ * @return array
+ */
+ function get_border_left_color()
+ {
+ if ($this->_props["border_left_color"] === "") {
+ //see __set and __get, on all assignments clear cache!
+ $this->_prop_cache["border_left_color"] = null;
+ $this->_props["border_left_color"] = $this->__get("color");
+ }
+
+ return $this->munge_color($this->_props["border_left_color"]);
+ }
+
+ /**#@-*/
+
+ /**#@+
+ * Returns the border width, as it is currently stored
+ *
+ * @link http://www.w3.org/TR/CSS21/box.html#border-width-properties
+ * @return float|string
+ */
+ function get_border_top_width()
+ {
+ $style = $this->__get("border_top_style");
+ return $style !== "none" && $style !== "hidden" ? $this->length_in_pt($this->_props["border_top_width"]) : 0;
+ }
+
+ /**
+ * @return float|int|string
+ */
+ function get_border_right_width()
+ {
+ $style = $this->__get("border_right_style");
+ return $style !== "none" && $style !== "hidden" ? $this->length_in_pt($this->_props["border_right_width"]) : 0;
+ }
+
+ /**
+ * @return float|int|string
+ */
+ function get_border_bottom_width()
+ {
+ $style = $this->__get("border_bottom_style");
+ return $style !== "none" && $style !== "hidden" ? $this->length_in_pt($this->_props["border_bottom_width"]) : 0;
+ }
+
+ /**
+ * @return float|int|string
+ */
+ function get_border_left_width()
+ {
+ $style = $this->__get("border_left_style");
+ return $style !== "none" && $style !== "hidden" ? $this->length_in_pt($this->_props["border_left_width"]) : 0;
+ }
+ /**#@-*/
+
+ /**
+ * Return an array of all border properties.
+ *
+ * The returned array has the following structure:
+ *
+ * array("top" => array("width" => [border-width],
+ * "style" => [border-style],
+ * "color" => [border-color (array)]),
+ * "bottom" ... )
+ *
+ *
+ * @return array
+ */
+ function get_border_properties()
+ {
+ return array(
+ "top" => array(
+ "width" => $this->__get("border_top_width"),
+ "style" => $this->__get("border_top_style"),
+ "color" => $this->__get("border_top_color"),
+ ),
+ "bottom" => array(
+ "width" => $this->__get("border_bottom_width"),
+ "style" => $this->__get("border_bottom_style"),
+ "color" => $this->__get("border_bottom_color"),
+ ),
+ "right" => array(
+ "width" => $this->__get("border_right_width"),
+ "style" => $this->__get("border_right_style"),
+ "color" => $this->__get("border_right_color"),
+ ),
+ "left" => array(
+ "width" => $this->__get("border_left_width"),
+ "style" => $this->__get("border_left_style"),
+ "color" => $this->__get("border_left_color"),
+ ),
+ );
+ }
+
+ /**
+ * Return a single border property
+ *
+ * @param string $side
+ *
+ * @return mixed
+ */
+ protected function _get_border($side)
+ {
+ $color = $this->__get("border_" . $side . "_color");
+
+ return $this->__get("border_" . $side . "_width") . " " .
+ $this->__get("border_" . $side . "_style") . " " . $color["hex"];
+ }
+
+ /**#@+
+ * Return full border properties as a string
+ *
+ * Border properties are returned just as specified in CSS:
+ * [width] [style] [color]+ * e.g. "1px solid blue" + * + * @link http://www.w3.org/TR/CSS21/box.html#border-shorthand-properties + * @return string + */ + function get_border_top() + { + return $this->_get_border("top"); + } + + /** + * @return mixed + */ + function get_border_right() + { + return $this->_get_border("right"); + } + + /** + * @return mixed + */ + function get_border_bottom() + { + return $this->_get_border("bottom"); + } + + /** + * @return mixed + */ + function get_border_left() + { + return $this->_get_border("left"); + } + + /** + * @param $w + * @param $h + * @return array|null + */ + function get_computed_border_radius($w, $h) + { + if (!empty($this->_computed_border_radius)) { + return $this->_computed_border_radius; + } + + $w = (float)$w; + $h = (float)$h; + $rTL = (float)$this->__get("border_top_left_radius"); + $rTR = (float)$this->__get("border_top_right_radius"); + $rBL = (float)$this->__get("border_bottom_left_radius"); + $rBR = (float)$this->__get("border_bottom_right_radius"); + + if ($rTL + $rTR + $rBL + $rBR == 0) { + return $this->_computed_border_radius = array( + 0, 0, 0, 0, + "top-left" => 0, + "top-right" => 0, + "bottom-right" => 0, + "bottom-left" => 0, + ); + } + + $t = (float)$this->__get("border_top_width"); + $r = (float)$this->__get("border_right_width"); + $b = (float)$this->__get("border_bottom_width"); + $l = (float)$this->__get("border_left_width"); + + $rTL = min($rTL, $h - $rBL - $t / 2 - $b / 2, $w - $rTR - $l / 2 - $r / 2); + $rTR = min($rTR, $h - $rBR - $t / 2 - $b / 2, $w - $rTL - $l / 2 - $r / 2); + $rBL = min($rBL, $h - $rTL - $t / 2 - $b / 2, $w - $rBR - $l / 2 - $r / 2); + $rBR = min($rBR, $h - $rTR - $t / 2 - $b / 2, $w - $rBL - $l / 2 - $r / 2); + + return $this->_computed_border_radius = array( + $rTL, $rTR, $rBR, $rBL, + "top-left" => $rTL, + "top-right" => $rTR, + "bottom-right" => $rBR, + "bottom-left" => $rBL, + ); + } + + /** + * Returns the outline color as an array + * + * See {@link Style::get_color()} + * + * @link http://www.w3.org/TR/CSS21/box.html#border-color-properties + * @return array + */ + function get_outline_color() + { + if ($this->_props["outline_color"] === "") { + //see __set and __get, on all assignments clear cache! + $this->_prop_cache["outline_color"] = null; + $this->_props["outline_color"] = $this->__get("color"); + } + + return $this->munge_color($this->_props["outline_color"]); + } + + /**#@+ + * Returns the outline width, as it is currently stored + * @return float|string + */ + function get_outline_width() + { + $style = $this->__get("outline_style"); + return $style !== "none" && $style !== "hidden" ? $this->length_in_pt($this->_props["outline_width"]) : 0; + } + + /**#@+ + * Return full outline properties as a string + * + * Outline properties are returned just as specified in CSS: + *
[width] [style] [color]+ * e.g. "1px solid blue" + * + * @link http://www.w3.org/TR/CSS21/box.html#border-shorthand-properties + * @return string + */ + function get_outline() + { + $color = $this->__get("outline_color"); + return + $this->__get("outline_width") . " " . + $this->__get("outline_style") . " " . + $color["hex"]; + } + /**#@-*/ + + /** + * Returns border spacing as an array + * + * The array has the format (h_space,v_space) + * + * @link http://www.w3.org/TR/CSS21/tables.html#propdef-border-spacing + * @return array + */ + function get_border_spacing() + { + $arr = explode(" ", $this->_props["border_spacing"]); + if (count($arr) == 1) { + $arr[1] = $arr[0]; + } + return $arr; + } + + /*==============================*/ + + /* + !important attribute + For basic functionality of the !important attribute with overloading + of several styles of an element, changes in inherit(), merge() and _parse_properties() + are sufficient [helpers var $_important_props, __construct(), important_set(), important_get()] + + Only for combined attributes extra treatment needed. See below. + + div { border: 1px red; } + div { border: solid; } // Not combined! Only one occurence of same style per context + // + div { border: 1px red; } + div a { border: solid; } // Adding to border style ok by inheritance + // + div { border-style: solid; } // Adding to border style ok because of different styles + div { border: 1px red; } + // + div { border-style: solid; !important} // border: overrides, even though not !important + div { border: 1px dashed red; } + // + div { border: 1px red; !important } + div a { border-style: solid; } // Need to override because not set + + Special treatment: + At individual property like border-top-width need to check whether overriding value is also !important. + Also store the !important condition for later overrides. + Since not known who is initiating the override, need to get passed !important as parameter. + !important Paramter taken as in the original style in the css file. + When property border !important given, do not mark subsets like border_style as important. Only + individual properties. + + Note: + Setting individual property directly from css with e.g. set_border_top_style() is not needed, because + missing set funcions handled by a generic handler __set(), including the !important. + Setting individual property of as sub-property is handled below. + + Implementation see at _set_style_side_type() + Callers _set_style_sides_type(), _set_style_type, _set_style_type_important() + + Related functionality for background, padding, margin, font, list_style + */ + + /** + * Generalized set function for individual attribute of combined style. + * With check for !important + * Applicable for background, border, padding, margin, font, list_style + * + * Note: $type has a leading underscore (or is empty), the others not. + * + * @param $style + * @param $side + * @param $type + * @param $val + * @param $important + */ + protected function _set_style_side_type($style, $side, $type, $val, $important) + { + $prop = $style . '_' . $side . $type; + + if (!isset($this->_important_props[$prop]) || $important) { + if ($side === "bottom") { + $this->_computed_bottom_spacing = null; //reset computed cache, border style can disable/enable border calculations + } + //see __set and __get, on all assignments clear cache! + $this->_prop_cache[$prop] = null; + if ($important) { + $this->_important_props[$prop] = true; + } + $this->_props[$prop] = $val; + } + } + + /** + * @param $style + * @param $top + * @param $right + * @param $bottom + * @param $left + * @param $type + * @param $important + */ + protected function _set_style_sides_type($style, $top, $right, $bottom, $left, $type, $important) + { + $this->_set_style_side_type($style, 'top', $type, $top, $important); + $this->_set_style_side_type($style, 'right', $type, $right, $important); + $this->_set_style_side_type($style, 'bottom', $type, $bottom, $important); + $this->_set_style_side_type($style, 'left', $type, $left, $important); + } + + /** + * @param $style + * @param $type + * @param $val + * @param $important + */ + protected function _set_style_type($style, $type, $val, $important) + { + $val = preg_replace("/\s*\,\s*/", ",", $val); // when rgb() has spaces + $arr = explode(" ", $val); + + switch (count($arr)) { + case 1: + $this->_set_style_sides_type($style, $arr[0], $arr[0], $arr[0], $arr[0], $type, $important); + break; + case 2: + $this->_set_style_sides_type($style, $arr[0], $arr[1], $arr[0], $arr[1], $type, $important); + break; + case 3: + $this->_set_style_sides_type($style, $arr[0], $arr[1], $arr[2], $arr[1], $type, $important); + break; + case 4: + $this->_set_style_sides_type($style, $arr[0], $arr[1], $arr[2], $arr[3], $type, $important); + break; + } + + //see __set and __get, on all assignments clear cache! + $this->_prop_cache[$style . $type] = null; + $this->_props[$style . $type] = $val; + } + + /** + * @param $style + * @param $type + * @param $val + */ + protected function _set_style_type_important($style, $type, $val) + { + $this->_set_style_type($style, $type, $val, isset($this->_important_props[$style . $type])); + } + + /** + * Anyway only called if _important matches and is assigned + * E.g. _set_style_side_type($style,$side,'',str_replace("none", "0px", $val),isset($this->_important_props[$style.'_'.$side])); + * + * @param $style + * @param $side + * @param $val + */ + protected function _set_style_side_width_important($style, $side, $val) + { + if ($side === "bottom") { + $this->_computed_bottom_spacing = null; //reset cache for any bottom width changes + } + //see __set and __get, on all assignments clear cache! + $this->_prop_cache[$style . '_' . $side] = null; + $this->_props[$style . '_' . $side] = str_replace("none", "0px", $val); + } + + /** + * @param $style + * @param $val + * @param $important + */ + protected function _set_style($style, $val, $important) + { + if (!isset($this->_important_props[$style]) || $important) { + if ($important) { + $this->_important_props[$style] = true; + } + //see __set and __get, on all assignments clear cache! + $this->_prop_cache[$style] = null; + $this->_props[$style] = $val; + } + } + + /** + * @param $val + * @return string + */ + protected function _image($val) + { + $DEBUGCSS = $this->_stylesheet->get_dompdf()->getOptions()->getDebugCss(); + $parsed_url = "none"; + + if (mb_strpos($val, "url") === false) { + $path = "none"; //Don't resolve no image -> otherwise would prefix path and no longer recognize as none + } else { + $val = preg_replace("/url\(\s*['\"]?([^'\")]+)['\"]?\s*\)/", "\\1", trim($val)); + + // Resolve the url now in the context of the current stylesheet + $parsed_url = Helpers::explode_url($val); + if ($parsed_url["protocol"] == "" && $this->_stylesheet->get_protocol() == "") { + if ($parsed_url["path"][0] === '/' || $parsed_url["path"][0] === '\\') { + $path = $_SERVER["DOCUMENT_ROOT"] . '/'; + } else { + $path = $this->_stylesheet->get_base_path(); + } + + $path .= $parsed_url["path"] . $parsed_url["file"]; + $path = realpath($path); + // If realpath returns FALSE then specifically state that there is no background image + if (!$path) { + $path = 'none'; + } + } else { + $path = Helpers::build_url($this->_stylesheet->get_protocol(), + $this->_stylesheet->get_host(), + $this->_stylesheet->get_base_path(), + $val); + } + } + if ($DEBUGCSS) { + print "
[_image\n"; + print_r($parsed_url); + print $this->_stylesheet->get_protocol() . "\n" . $this->_stylesheet->get_base_path() . "\n" . $path . "\n"; + print "_image]";; + } + return $path; + } + + /*======================*/ + + /** + * Sets color + * + * The color parameter can be any valid CSS color value + * + * @link http://www.w3.org/TR/CSS21/colors.html#propdef-color + * @param string $color + */ + function set_color($color) + { + $col = $this->munge_color($color); + + if (is_null($col) || !isset($col["hex"])) { + $color = "inherit"; + } else { + $color = $col["hex"]; + } + + //see __set and __get, on all assignments clear cache, not needed on direct set through __set + $this->_prop_cache["color"] = null; + $this->_props["color"] = $color; + } + + /** + * Sets the background color + * + * @link http://www.w3.org/TR/CSS21/colors.html#propdef-background-color + * @param string $color + */ + function set_background_color($color) + { + $col = $this->munge_color($color); + + if (is_null($col)) { + return; + //$col = self::$_defaults["background_color"]; + } + + //see __set and __get, on all assignments clear cache, not needed on direct set through __set + $this->_prop_cache["background_color"] = null; + $this->_props["background_color"] = is_array($col) ? $col["hex"] : $col; + } + + /** + * Set the background image url + * @link http://www.w3.org/TR/CSS21/colors.html#background-properties + * + * @param string $val + */ + function set_background_image($val) + { + //see __set and __get, on all assignments clear cache, not needed on direct set through __set + $this->_prop_cache["background_image"] = null; + $this->_props["background_image"] = $this->_image($val); + } + + /** + * Sets the background repeat + * + * @link http://www.w3.org/TR/CSS21/colors.html#propdef-background-repeat + * @param string $val + */ + function set_background_repeat($val) + { + if (is_null($val)) { + $val = self::$_defaults["background_repeat"]; + } + + //see __set and __get, on all assignments clear cache, not needed on direct set through __set + $this->_prop_cache["background_repeat"] = null; + $this->_props["background_repeat"] = $val; + } + + /** + * Sets the background attachment + * + * @link http://www.w3.org/TR/CSS21/colors.html#propdef-background-attachment + * @param string $val + */ + function set_background_attachment($val) + { + if (is_null($val)) { + $val = self::$_defaults["background_attachment"]; + } + + //see __set and __get, on all assignments clear cache, not needed on direct set through __set + $this->_prop_cache["background_attachment"] = null; + $this->_props["background_attachment"] = $val; + } + + /** + * Sets the background position + * + * @link http://www.w3.org/TR/CSS21/colors.html#propdef-background-position + * @param string $val + */ + function set_background_position($val) + { + if (is_null($val)) { + $val = self::$_defaults["background_position"]; + } + + //see __set and __get, on all assignments clear cache, not needed on direct set through __set + $this->_prop_cache["background_position"] = null; + $this->_props["background_position"] = $val; + } + + /** + * Sets the background - combined options + * + * @link http://www.w3.org/TR/CSS21/colors.html#propdef-background + * @param string $val + */ + function set_background($val) + { + $val = trim($val); + $important = isset($this->_important_props["background"]); + + if ($val === "none") { + $this->_set_style("background_image", "none", $important); + $this->_set_style("background_color", "transparent", $important); + } else { + $pos = array(); + $tmp = preg_replace("/\s*\,\s*/", ",", $val); // when rgb() has spaces + $tmp = preg_split("/\s+/", $tmp); + + foreach ($tmp as $attr) { + if (mb_substr($attr, 0, 3) === "url" || $attr === "none") { + $this->_set_style("background_image", $this->_image($attr), $important); + } elseif ($attr === "fixed" || $attr === "scroll") { + $this->_set_style("background_attachment", $attr, $important); + } elseif ($attr === "repeat" || $attr === "repeat-x" || $attr === "repeat-y" || $attr === "no-repeat") { + $this->_set_style("background_repeat", $attr, $important); + } elseif (($col = $this->munge_color($attr)) != null) { + $this->_set_style("background_color", is_array($col) ? $col["hex"] : $col, $important); + } else { + $pos[] = $attr; + } + } + + if (count($pos)) { + $this->_set_style("background_position", implode(" ", $pos), $important); + } + } + + //see __set and __get, on all assignments clear cache, not needed on direct set through __set + $this->_prop_cache["background"] = null; + $this->_props["background"] = $val; + } + + /** + * Sets the font size + * + * $size can be any acceptable CSS size + * + * @link http://www.w3.org/TR/CSS21/fonts.html#propdef-font-size + * @param string|float $size + */ + function set_font_size($size) + { + $this->__font_size_calculated = false; + //see __set and __get, on all assignments clear cache, not needed on direct set through __set + $this->_prop_cache["font_size"] = null; + $this->_props["font_size"] = $size; + } + + /** + * Sets the font style + * + * combined attributes + * set individual attributes also, respecting !important mark + * exactly this order, separate by space. Multiple fonts separated by comma: + * font-style, font-variant, font-weight, font-size, line-height, font-family + * + * Other than with border and list, existing partial attributes should + * reset when starting here, even when not mentioned. + * If individual attribute is !important and explicite or implicite replacement is not, + * keep individual attribute + * + * require whitespace as delimiters for single value attributes + * On delimiter "/" treat first as font height, second as line height + * treat all remaining at the end of line as font + * font-style, font-variant, font-weight, font-size, line-height, font-family + * + * missing font-size and font-family might be not allowed, but accept it here and + * use default (medium size, enpty font name) + * + * @link http://www.w3.org/TR/CSS21/generate.html#propdef-list-style + * @param $val + */ + function set_font($val) + { + $this->__font_size_calculated = false; + //see __set and __get, on all assignments clear cache, not needed on direct set through __set + $this->_prop_cache["font"] = null; + $this->_props["font"] = $val; + + $important = isset($this->_important_props["font"]); + + if (preg_match("/^(italic|oblique|normal)\s*(.*)$/i", $val, $match)) { + $this->_set_style("font_style", $match[1], $important); + $val = $match[2]; + } else { + $this->_set_style("font_style", self::$_defaults["font_style"], $important); + } + + if (preg_match("/^(small-caps|normal)\s*(.*)$/i", $val, $match)) { + $this->_set_style("font_variant", $match[1], $important); + $val = $match[2]; + } else { + $this->_set_style("font_variant", self::$_defaults["font_variant"], $important); + } + + //matching numeric value followed by unit -> this is indeed a subsequent font size. Skip! + if (preg_match("/^(bold|bolder|lighter|100|200|300|400|500|600|700|800|900|normal)\s*(.*)$/i", $val, $match) && + !preg_match("/^(?:pt|px|pc|em|ex|in|cm|mm|%)/", $match[2]) + ) { + $this->_set_style("font_weight", $match[1], $important); + $val = $match[2]; + } else { + $this->_set_style("font_weight", self::$_defaults["font_weight"], $important); + } + + if (preg_match("/^(xx-small|x-small|small|medium|large|x-large|xx-large|smaller|larger|\d+\s*(?:pt|px|pc|em|ex|in|cm|mm|%))(?:\/|\s*)(.*)$/i", $val, $match)) { + $this->_set_style("font_size", $match[1], $important); + $val = $match[2]; + if (preg_match("/^(?:\/|\s*)(\d+\s*(?:pt|px|pc|em|ex|in|cm|mm|%)?)\s*(.*)$/i", $val, $match)) { + $this->_set_style("line_height", $match[1], $important); + $val = $match[2]; + } else { + $this->_set_style("line_height", self::$_defaults["line_height"], $important); + } + } else { + $this->_set_style("font_size", self::$_defaults["font_size"], $important); + $this->_set_style("line_height", self::$_defaults["line_height"], $important); + } + + if (strlen($val) != 0) { + $this->_set_style("font_family", $val, $important); + } else { + $this->_set_style("font_family", self::$_defaults["font_family"], $important); + } + } + + /** + * Sets page break properties + * + * @link http://www.w3.org/TR/CSS21/page.html#page-breaks + * @param string $break + */ + function set_page_break_before($break) + { + if ($break === "left" || $break === "right") { + $break = "always"; + } + + //see __set and __get, on all assignments clear cache, not needed on direct set through __set + $this->_prop_cache["page_break_before"] = null; + $this->_props["page_break_before"] = $break; + } + + /** + * @param $break + */ + function set_page_break_after($break) + { + if ($break === "left" || $break === "right") { + $break = "always"; + } + + //see __set and __get, on all assignments clear cache, not needed on direct set through __set + $this->_prop_cache["page_break_after"] = null; + $this->_props["page_break_after"] = $break; + } + + /** + * Sets the margin size + * + * @link http://www.w3.org/TR/CSS21/box.html#margin-properties + * @param $val + */ + function set_margin_top($val) + { + $this->_set_style_side_width_important('margin', 'top', $val); + } + + /** + * @param $val + */ + function set_margin_right($val) + { + $this->_set_style_side_width_important('margin', 'right', $val); + } + + /** + * @param $val + */ + function set_margin_bottom($val) + { + $this->_set_style_side_width_important('margin', 'bottom', $val); + } + + /** + * @param $val + */ + function set_margin_left($val) + { + $this->_set_style_side_width_important('margin', 'left', $val); + } + + /** + * @param $val + */ + function set_margin($val) + { + $val = str_replace("none", "0px", $val); + $this->_set_style_type_important('margin', '', $val); + } + + /** + * Sets the padding size + * + * @link http://www.w3.org/TR/CSS21/box.html#padding-properties + * @param $val + */ + function set_padding_top($val) + { + $this->_set_style_side_width_important('padding', 'top', $val); + } + + /** + * @param $val + */ + function set_padding_right($val) + { + $this->_set_style_side_width_important('padding', 'right', $val); + } + + /** + * @param $val + */ + function set_padding_bottom($val) + { + $this->_set_style_side_width_important('padding', 'bottom', $val); + } + + /** + * @param $val + */ + function set_padding_left($val) + { + $this->_set_style_side_width_important('padding', 'left', $val); + } + + /** + * @param $val + */ + function set_padding($val) + { + $val = str_replace("none", "0px", $val); + $this->_set_style_type_important('padding', '', $val); + } + /**#@-*/ + + /** + * Sets a single border + * + * @param string $side + * @param string $border_spec ([width] [style] [color]) + * @param boolean $important + */ + protected function _set_border($side, $border_spec, $important) + { + $border_spec = preg_replace("/\s*\,\s*/", ",", $border_spec); + //$border_spec = str_replace(",", " ", $border_spec); // Why did we have this ?? rbg(10, 102, 10) > rgb(10 102 10) + $arr = explode(" ", $border_spec); + + // FIXME: handle partial values + + //For consistency of individal and combined properties, and with ie8 and firefox3 + //reset all attributes, even if only partially given + $this->_set_style_side_type('border', $side, '_style', self::$_defaults['border_' . $side . '_style'], $important); + $this->_set_style_side_type('border', $side, '_width', self::$_defaults['border_' . $side . '_width'], $important); + $this->_set_style_side_type('border', $side, '_color', self::$_defaults['border_' . $side . '_color'], $important); + + foreach ($arr as $value) { + $value = trim($value); + if (in_array($value, self::$BORDER_STYLES)) { + $this->_set_style_side_type('border', $side, '_style', $value, $important); + } else if (preg_match("/[.0-9]+(?:px|pt|pc|em|ex|%|in|mm|cm)|(?:thin|medium|thick)/", $value)) { + $this->_set_style_side_type('border', $side, '_width', $value, $important); + } else { + // must be color + $this->_set_style_side_type('border', $side, '_color', $value, $important); + } + } + + //see __set and __get, on all assignments clear cache! + $this->_prop_cache['border_' . $side] = null; + $this->_props['border_' . $side] = $border_spec; + } + + /** + * Sets the border styles + * + * @link http://www.w3.org/TR/CSS21/box.html#border-properties + * @param string $val + */ + function set_border_top($val) + { + $this->_set_border("top", $val, isset($this->_important_props['border_top'])); + } + + /** + * @param $val + */ + function set_border_right($val) + { + $this->_set_border("right", $val, isset($this->_important_props['border_right'])); + } + + /** + * @param $val + */ + function set_border_bottom($val) + { + $this->_set_border("bottom", $val, isset($this->_important_props['border_bottom'])); + } + + /** + * @param $val + */ + function set_border_left($val) + { + $this->_set_border("left", $val, isset($this->_important_props['border_left'])); + } + + /** + * @param $val + */ + function set_border($val) + { + $important = isset($this->_important_props["border"]); + $this->_set_border("top", $val, $important); + $this->_set_border("right", $val, $important); + $this->_set_border("bottom", $val, $important); + $this->_set_border("left", $val, $important); + //see __set and __get, on all assignments clear cache, not needed on direct set through __set + $this->_prop_cache["border"] = null; + $this->_props["border"] = $val; + } + + /** + * @param $val + */ + function set_border_width($val) + { + $this->_set_style_type_important('border', '_width', $val); + } + + /** + * @param $val + */ + function set_border_color($val) + { + $this->_set_style_type_important('border', '_color', $val); + } + + /** + * @param $val + */ + function set_border_style($val) + { + $this->_set_style_type_important('border', '_style', $val); + } + + /** + * Sets the border radius size + * + * http://www.w3.org/TR/css3-background/#corners + * + * @param $val + */ + function set_border_top_left_radius($val) + { + $this->_set_border_radius_corner($val, "top_left"); + } + + /** + * @param $val + */ + function set_border_top_right_radius($val) + { + $this->_set_border_radius_corner($val, "top_right"); + } + + /** + * @param $val + */ + function set_border_bottom_left_radius($val) + { + $this->_set_border_radius_corner($val, "bottom_left"); + } + + /** + * @param $val + */ + function set_border_bottom_right_radius($val) + { + $this->_set_border_radius_corner($val, "bottom_right"); + } + + /** + * @param $val + */ + function set_border_radius($val) + { + $val = preg_replace("/\s*\,\s*/", ",", $val); // when border-radius has spaces + $arr = explode(" ", $val); + + switch (count($arr)) { + case 1: + $this->_set_border_radii($arr[0], $arr[0], $arr[0], $arr[0]); + break; + case 2: + $this->_set_border_radii($arr[0], $arr[1], $arr[0], $arr[1]); + break; + case 3: + $this->_set_border_radii($arr[0], $arr[1], $arr[2], $arr[1]); + break; + case 4: + $this->_set_border_radii($arr[0], $arr[1], $arr[2], $arr[3]); + break; + } + } + + /** + * @param $val1 + * @param $val2 + * @param $val3 + * @param $val4 + */ + protected function _set_border_radii($val1, $val2, $val3, $val4) + { + $this->_set_border_radius_corner($val1, "top_left"); + $this->_set_border_radius_corner($val2, "top_right"); + $this->_set_border_radius_corner($val3, "bottom_right"); + $this->_set_border_radius_corner($val4, "bottom_left"); + } + + /** + * @param $val + * @param $corner + */ + protected function _set_border_radius_corner($val, $corner) + { + $this->_has_border_radius = true; + + //see __set and __get, on all assignments clear cache! + $this->_prop_cache["border_" . $corner . "_radius"] = null; + + $this->_props["border_" . $corner . "_radius"] = $val; + } + + /** + * @return float|int|string + */ + function get_border_top_left_radius() + { + return $this->_get_border_radius_corner("top_left"); + } + + /** + * @return float|int|string + */ + function get_border_top_right_radius() + { + return $this->_get_border_radius_corner("top_right"); + } + + /** + * @return float|int|string + */ + function get_border_bottom_left_radius() + { + return $this->_get_border_radius_corner("bottom_left"); + } + + /** + * @return float|int|string + */ + function get_border_bottom_right_radius() + { + return $this->_get_border_radius_corner("bottom_right"); + } + + /** + * @param $corner + * @return float|int|string + */ + protected function _get_border_radius_corner($corner) + { + if (!isset($this->_props["border_" . $corner . "_radius"]) || empty($this->_props["border_" . $corner . "_radius"])) { + return 0; + } + + return $this->length_in_pt($this->_props["border_" . $corner . "_radius"]); + } + + /** + * Sets the outline styles + * + * @link http://www.w3.org/TR/CSS21/ui.html#dynamic-outlines + * @param string $val + */ + function set_outline($val) + { + $important = isset($this->_important_props["outline"]); + + $props = array( + "outline_style", + "outline_width", + "outline_color", + ); + + foreach ($props as $prop) { + $_val = self::$_defaults[$prop]; + + if (!isset($this->_important_props[$prop]) || $important) { + //see __set and __get, on all assignments clear cache! + $this->_prop_cache[$prop] = null; + if ($important) { + $this->_important_props[$prop] = true; + } + $this->_props[$prop] = $_val; + } + } + + $val = preg_replace("/\s*\,\s*/", ",", $val); // when rgb() has spaces + $arr = explode(" ", $val); + foreach ($arr as $value) { + $value = trim($value); + + if (in_array($value, self::$BORDER_STYLES)) { + $this->set_outline_style($value); + } else if (preg_match("/[.0-9]+(?:px|pt|pc|em|ex|%|in|mm|cm)|(?:thin|medium|thick)/", $value)) { + $this->set_outline_width($value); + } else { + // must be color + $this->set_outline_color($value); + } + } + + //see __set and __get, on all assignments clear cache, not needed on direct set through __set + $this->_prop_cache["outline"] = null; + $this->_props["outline"] = $val; + } + + /** + * @param $val + */ + function set_outline_width($val) + { + $this->_set_style_type_important('outline', '_width', $val); + } + + /** + * @param $val + */ + function set_outline_color($val) + { + $this->_set_style_type_important('outline', '_color', $val); + } + + /** + * @param $val + */ + function set_outline_style($val) + { + $this->_set_style_type_important('outline', '_style', $val); + } + + /** + * Sets the border spacing + * + * @link http://www.w3.org/TR/CSS21/box.html#border-properties + * @param float $val + */ + function set_border_spacing($val) + { + $arr = explode(" ", $val); + + if (count($arr) == 1) { + $arr[1] = $arr[0]; + } + + //see __set and __get, on all assignments clear cache, not needed on direct set through __set + $this->_prop_cache["border_spacing"] = null; + $this->_props["border_spacing"] = "$arr[0] $arr[1]"; + } + + /** + * Sets the list style image + * + * @link http://www.w3.org/TR/CSS21/generate.html#propdef-list-style-image + * @param $val + */ + function set_list_style_image($val) + { + //see __set and __get, on all assignments clear cache, not needed on direct set through __set + $this->_prop_cache["list_style_image"] = null; + $this->_props["list_style_image"] = $this->_image($val); + } + + /** + * Sets the list style + * + * @link http://www.w3.org/TR/CSS21/generate.html#propdef-list-style + * @param $val + */ + function set_list_style($val) + { + $important = isset($this->_important_props["list_style"]); + $arr = explode(" ", str_replace(",", " ", $val)); + + static $types = array( + "disc", "circle", "square", + "decimal-leading-zero", "decimal", "1", + "lower-roman", "upper-roman", "a", "A", + "lower-greek", + "lower-latin", "upper-latin", + "lower-alpha", "upper-alpha", + "armenian", "georgian", "hebrew", + "cjk-ideographic", "hiragana", "katakana", + "hiragana-iroha", "katakana-iroha", "none" + ); + + static $positions = array("inside", "outside"); + + foreach ($arr as $value) { + /* http://www.w3.org/TR/CSS21/generate.html#list-style + * A value of 'none' for the 'list-style' property sets both 'list-style-type' and 'list-style-image' to 'none' + */ + if ($value === "none") { + $this->_set_style("list_style_type", $value, $important); + $this->_set_style("list_style_image", $value, $important); + continue; + } + + //On setting or merging or inheriting list_style_image as well as list_style_type, + //and url exists, then url has precedence, otherwise fall back to list_style_type + //Firefox is wrong here (list_style_image gets overwritten on explicite list_style_type) + //Internet Explorer 7/8 and dompdf is right. + + if (mb_substr($value, 0, 3) === "url") { + $this->_set_style("list_style_image", $this->_image($value), $important); + continue; + } + + if (in_array($value, $types)) { + $this->_set_style("list_style_type", $value, $important); + } else if (in_array($value, $positions)) { + $this->_set_style("list_style_position", $value, $important); + } + } + + //see __set and __get, on all assignments clear cache, not needed on direct set through __set + $this->_prop_cache["list_style"] = null; + $this->_props["list_style"] = $val; + } + + /** + * @param $val + */ + function set_size($val) + { + $length_re = "/(\d+\s*(?:pt|px|pc|em|ex|in|cm|mm|%))/"; + + $val = mb_strtolower($val); + + if ($val === "auto") { + return; + } + + $parts = preg_split("/\s+/", $val); + + $computed = array(); + if (preg_match($length_re, $parts[0])) { + $computed[] = $this->length_in_pt($parts[0]); + + if (isset($parts[1]) && preg_match($length_re, $parts[1])) { + $computed[] = $this->length_in_pt($parts[1]); + } else { + $computed[] = $computed[0]; + } + + if (isset($parts[2]) && $parts[2] === "landscape") { + $computed = array_reverse($computed); + } + } elseif (isset(CPDF::$PAPER_SIZES[$parts[0]])) { + $computed = array_slice(CPDF::$PAPER_SIZES[$parts[0]], 2, 2); + + if (isset($parts[1]) && $parts[1] === "landscape") { + $computed = array_reverse($computed); + } + } else { + return; + } + + $this->_props["size"] = $computed; + } + + /** + * Gets the CSS3 transform property + * + * @link http://www.w3.org/TR/css3-2d-transforms/#transform-property + * @return array|null + */ + function get_transform() + { + $number = "\s*([^,\s]+)\s*"; + $tr_value = "\s*([^,\s]+)\s*"; + $angle = "\s*([^,\s]+(?:deg|rad)?)\s*"; + + if (!preg_match_all("/[a-z]+\([^\)]+\)/i", $this->_props["transform"], $parts, PREG_SET_ORDER)) { + return null; + } + + $functions = array( + //"matrix" => "\($number,$number,$number,$number,$number,$number\)", + + "translate" => "\($tr_value(?:,$tr_value)?\)", + "translateX" => "\($tr_value\)", + "translateY" => "\($tr_value\)", + + "scale" => "\($number(?:,$number)?\)", + "scaleX" => "\($number\)", + "scaleY" => "\($number\)", + + "rotate" => "\($angle\)", + + "skew" => "\($angle(?:,$angle)?\)", + "skewX" => "\($angle\)", + "skewY" => "\($angle\)", + ); + + $transforms = array(); + + foreach ($parts as $part) { + $t = $part[0]; + + foreach ($functions as $name => $pattern) { + if (preg_match("/$name\s*$pattern/i", $t, $matches)) { + $values = array_slice($matches, 1); + + switch ($name) { + //
'; + foreach ($_dompdf_warnings as $msg) { + echo $msg . "\n"; + } + + if ($canvas instanceof CPDF) { + echo $canvas->get_cpdf()->messages; + } + echo ''; + flush(); + } + + if ($logOutputFile && is_writable($logOutputFile)) { + $this->write_log(); + ob_end_clean(); + } + + $this->restoreLocale(); + } + + /** + * Add meta information to the PDF after rendering + */ + public function add_info($label, $value) + { + $canvas = $this->getCanvas(); + if (!is_null($canvas)) { + $canvas->add_info($label, $value); + } + } + + /** + * Writes the output buffer in the log file + * + * @return void + */ + private function write_log() + { + $log_output_file = $this->getOptions()->getLogOutputFile(); + if (!$log_output_file || !is_writable($log_output_file)) { + return; + } + + $frames = Frame::$ID_COUNTER; + $memory = memory_get_peak_usage(true) / 1024; + $time = (microtime(true) - $this->startTime) * 1000; + + $out = sprintf( + "%6d" . + "%10.2f KB" . + "%10.2f ms" . + " " . + ($this->quirksmode ? " ON" : "OFF") . + "
'" . mb_substr($tmp, 0, 70) . + (mb_strlen($tmp) > 70 ? "..." : "") . "'"; + } elseif ($css_class = $this->_node->getAttribute("class")) { + $str .= "CSS class: '$css_class'
" . $this->_style->__toString() . ""; + + if ($this->_decorator instanceof FrameDecorator\Block) { + $str .= "Lines:
"; + foreach ($this->_decorator->get_line_boxes() as $line) { + foreach ($line->get_frames() as $frame) { + if ($frame instanceof FrameDecorator\Text) { + $str .= "\ntext: "; + $str .= "'" . htmlspecialchars($frame->get_text()) . "'"; + } else { + $str .= "\nBlock: " . $frame->get_node()->nodeName . " (" . spl_object_hash($frame->get_node()) . ")"; + } + } + + $str .= + "\ny => " . $line->y . "\n" . + "w => " . $line->w . "\n" . + "h => " . $line->h . "\n" . + "left => " . $line->left . "\n" . + "right => " . $line->right . "\n"; + } + $str .= ""; + } + + $str .= "\n"; + if (php_sapi_name() === "cli") { + $str = strip_tags(str_replace(array("
" . print_r($mixed, true) . ""; + } + + if (php_sapi_name() !== "cli") { + echo "
"; + } + + print_r($mixed); + + if (php_sapi_name() !== "cli") { + echo ""; + } else { + echo "\n"; + } + + flush(); + + return null; + } + + /** + * builds a full url given a protocol, hostname, base path and url + * + * @param string $protocol + * @param string $host + * @param string $base_path + * @param string $url + * @return string + * + * Initially the trailing slash of $base_path was optional, and conditionally appended. + * However on dynamically created sites, where the page is given as url parameter, + * the base path might not end with an url. + * Therefore do not append a slash, and **require** the $base_url to ending in a slash + * when needed. + * Vice versa, on using the local file system path of a file, make sure that the slash + * is appended (o.k. also for Windows) + */ + public static function build_url($protocol, $host, $base_path, $url) + { + $protocol = mb_strtolower($protocol); + if (strlen($url) == 0) { + //return $protocol . $host . rtrim($base_path, "/\\") . "/"; + return $protocol . $host . $base_path; + } + + // Is the url already fully qualified, a Data URI, or a reference to a named anchor? + if (mb_strpos($url, "://") !== false || mb_substr($url, 0, 1) === "#" || mb_strpos($url, "data:") === 0 || mb_strpos($url, "mailto:") === 0) { + return $url; + } + + $ret = $protocol; + + if (!in_array(mb_strtolower($protocol), array("http://", "https://", "ftp://", "ftps://"))) { + //On Windows local file, an abs path can begin also with a '\' or a drive letter and colon + //drive: followed by a relative path would be a drive specific default folder. + //not known in php app code, treat as abs path + //($url[1] !== ':' || ($url[2]!=='\\' && $url[2]!=='/')) + if ($url[0] !== '/' && (strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN' || (mb_strlen($url) > 1 && $url[0] !== '\\' && $url[1] !== ':'))) { + // For rel path and local acess we ignore the host, and run the path through realpath() + $ret .= realpath($base_path) . '/'; + } + $ret .= $url; + $ret = preg_replace('/\?(.*)$/', "", $ret); + return $ret; + } + + // Protocol relative urls (e.g. "//example.org/style.css") + if (strpos($url, '//') === 0) { + $ret .= substr($url, 2); + //remote urls with backslash in html/css are not really correct, but lets be genereous + } elseif ($url[0] === '/' || $url[0] === '\\') { + // Absolute path + $ret .= $host . $url; + } else { + // Relative path + //$base_path = $base_path !== "" ? rtrim($base_path, "/\\") . "/" : ""; + $ret .= $host . $base_path . $url; + } + + return $ret; + } + + /** + * Converts decimal numbers to roman numerals + * + * @param int $num + * + * @throws Exception + * @return string + */ + public static function dec2roman($num) + { + + static $ones = array("", "i", "ii", "iii", "iv", "v", "vi", "vii", "viii", "ix"); + static $tens = array("", "x", "xx", "xxx", "xl", "l", "lx", "lxx", "lxxx", "xc"); + static $hund = array("", "c", "cc", "ccc", "cd", "d", "dc", "dcc", "dccc", "cm"); + static $thou = array("", "m", "mm", "mmm"); + + if (!is_numeric($num)) { + throw new Exception("dec2roman() requires a numeric argument."); + } + + if ($num > 4000 || $num < 0) { + return "(out of range)"; + } + + $num = strrev((string)$num); + + $ret = ""; + switch (mb_strlen($num)) { + /** @noinspection PhpMissingBreakStatementInspection */ + case 4: + $ret .= $thou[$num[3]]; + /** @noinspection PhpMissingBreakStatementInspection */ + case 3: + $ret .= $hund[$num[2]]; + /** @noinspection PhpMissingBreakStatementInspection */ + case 2: + $ret .= $tens[$num[1]]; + /** @noinspection PhpMissingBreakStatementInspection */ + case 1: + $ret .= $ones[$num[0]]; + default: + break; + } + + return $ret; + } + + /** + * Determines whether $value is a percentage or not + * + * @param float $value + * + * @return bool + */ + public static function is_percent($value) + { + return false !== mb_strpos($value, "%"); + } + + /** + * Parses a data URI scheme + * http://en.wikipedia.org/wiki/Data_URI_scheme + * + * @param string $data_uri The data URI to parse + * + * @return array|bool The result with charset, mime type and decoded data + */ + public static function parse_data_uri($data_uri) + { + if (!preg_match('/^data:(?P