����JFIF��H�H����Exif��MM�*���� ��3����V�����3������3�(��������������������3�����
Server IP : 74.208.127.88 / Your IP : 18.116.60.124 Web Server : Apache/2.4.41 (Ubuntu) System : Linux ubuntu 5.4.0-163-generic #180-Ubuntu SMP Tue Sep 5 13:21:23 UTC 2023 x86_64 User : www-data ( 33) PHP Version : 7.4.3-4ubuntu2.29 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /var/www/html/muebles/pos11/core/controller/PhpWord/ |
Upload File : |
<?php /** * This file is part of PHPWord - A pure PHP library for reading and writing * word processing documents. * * PHPWord is free software distributed under the terms of the GNU Lesser * General Public License version 3 as published by the Free Software Foundation. * * For the full copyright and license information, please read the LICENSE * file that was distributed with this source code. For the full list of * contributors, visit https://github.com/PHPOffice/PHPWord/contributors. * * @link https://github.com/PHPOffice/PHPWord * @copyright 2010-2014 PHPWord contributors * @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3 */ namespace PhpOffice\PhpWord; use PhpOffice\PhpWord\Style\AbstractStyle; use PhpOffice\PhpWord\Style\Font; use PhpOffice\PhpWord\Style\Numbering; use PhpOffice\PhpWord\Style\Paragraph; use PhpOffice\PhpWord\Style\Table; /** * Style collection */ class Style { /** * Style register * * @var array */ private static $styles = array(); /** * Add paragraph style * * @param string $styleName * @param array $styles * @return \PhpOffice\PhpWord\Style\Paragraph */ public static function addParagraphStyle($styleName, $styles) { return self::setStyleValues($styleName, new Paragraph(), $styles); } /** * Add font style * * @param string $styleName * @param array $fontStyle * @param array $paragraphStyle * @return \PhpOffice\PhpWord\Style\Font */ public static function addFontStyle($styleName, $fontStyle, $paragraphStyle = null) { return self::setStyleValues($styleName, new Font('text', $paragraphStyle), $fontStyle); } /** * Add link style * * @param string $styleName * @param array $styles * @return \PhpOffice\PhpWord\Style\Font */ public static function addLinkStyle($styleName, $styles) { return self::setStyleValues($styleName, new Font('link'), $styles); } /** * Add numbering style * * @param string $styleName * @param array $styleValues * @return \PhpOffice\PhpWord\Style\Numbering * @since 0.10.0 */ public static function addNumberingStyle($styleName, $styleValues) { return self::setStyleValues($styleName, new Numbering(), $styleValues); } /** * Add title style * * @param int $depth * @param array $fontStyle * @param array $paragraphStyle * @return \PhpOffice\PhpWord\Style\Font */ public static function addTitleStyle($depth, $fontStyle, $paragraphStyle = null) { return self::setStyleValues("Heading_{$depth}", new Font('title', $paragraphStyle), $fontStyle); } /** * Add table style * * @param string $styleName * @param array $styleTable * @param array|null $styleFirstRow * @return \PhpOffice\PhpWord\Style\Table */ public static function addTableStyle($styleName, $styleTable, $styleFirstRow = null) { return self::setStyleValues($styleName, new Table($styleTable, $styleFirstRow), null); } /** * Count styles * * @return int * @since 0.10.0 */ public static function countStyles() { return count(self::$styles); } /** * Reset styles. * * @since 0.10.0 * * @return void */ public static function resetStyles() { self::$styles = array(); } /** * Set default paragraph style * * @param array $styles Paragraph style definition * @return \PhpOffice\PhpWord\Style\Paragraph */ public static function setDefaultParagraphStyle($styles) { return self::addParagraphStyle('Normal', $styles); } /** * Get all styles * * @return \PhpOffice\PhpWord\Style\AbstractStyle[] */ public static function getStyles() { return self::$styles; } /** * Get style by name * * @param string $styleName * @return \PhpOffice\PhpWord\Style\AbstractStyle Paragraph|Font|Table|Numbering */ public static function getStyle($styleName) { if (isset(self::$styles[$styleName])) { return self::$styles[$styleName]; } else { return null; } } /** * Set style values and put it to static style collection * * The $styleValues could be an array or object * * @param string $name * @param \PhpOffice\PhpWord\Style\AbstractStyle $style * @param array|\PhpOffice\PhpWord\Style\AbstractStyle $value * @return \PhpOffice\PhpWord\Style\AbstractStyle */ private static function setStyleValues($name, $style, $value = null) { if (!isset(self::$styles[$name])) { if ($value !== null) { if (is_array($value)) { $style->setStyleByArray($value); } elseif ($value instanceof AbstractStyle) { if (get_class($style) == get_class($value)) { $style = $value; } } } $style->setStyleName($name); $style->setIndex(self::countStyles() + 1); // One based index self::$styles[$name] = $style; } return self::getStyle($name); } }