$value) { if (substr($key, 0, 1) != '_') { $key = '_' . $key; } self::$TOCStyle->setStyleValue($key, $value); } } if (!is_null($styleFont)) { if (is_array($styleFont)) { self::$fontStyle = new Font(); foreach ($styleFont as $key => $value) { if (substr($key, 0, 1) != '_') { $key = '_' . $key; } self::$fontStyle->setStyleValue($key, $value); } } else { self::$fontStyle = $styleFont; } } } /** * Add a Title * * @param string $text * @param int $depth * @return array */ public static function addTitle($text, $depth = 0) { $anchor = '_Toc' . ++self::$anchor; $bookmarkId = self::$bookmarkId++; $title = array(); $title['text'] = $text; $title['depth'] = $depth; $title['anchor'] = $anchor; $title['bookmarkId'] = $bookmarkId; self::$titles[] = $title; return array($anchor, $bookmarkId); } /** * Get all titles * * @return array */ public static function getTitles() { return self::$titles; } /** * Reset footnotes */ public static function reset() { self::$titles = array(); } /** * Get TOC Style * * @return TOCStyle */ public static function getStyleTOC() { return self::$TOCStyle; } /** * Get Font Style * * @return Font */ public static function getStyleFont() { return self::$fontStyle; } }