Plugin Directory

Changeset 3024399


Ignore:
Timestamp:
01/20/2024 08:47:22 AM (2 years ago)
Author:
wpwing
Message:

Re-update version 1.4.1

Location:
wpwing-pdf-invoice-packing-slip-for-woocommerce
Files:
108 edited
1 copied

Legend:

Unmodified
Added
Removed
  • wpwing-pdf-invoice-packing-slip-for-woocommerce/tags/1.4.1/readme.txt

    r2927383 r3024399  
    55Tags:               PDF, Invoice, Packing Slip, Packing List, Proforma Invoice, Delivery Notes, Shipping Labels, WooCommerce, WPWing
    66Requires at least:  4.8
    7 Tested up to:       6.2
     7Tested up to:       6.4
    88Requires PHP:       7.1
    9 Stable tag:         1.4.0
     9Stable tag:         1.4.1
    1010License:            GPL-3.0-or-later
    1111License URI:        https://www.gnu.org/licenses/gpl-3.0.html
    1212
    13 Want to print your WooCommerce order invoice or packing slip? Or download them in PDF format? You are in the right place! With WooCommerce you will feel the lacking of print invoices or packing lists, which we are happy to fulfill. **WPWing PDF Invoice and Packing Slip for WooCommerce** can download your WooCommerce order invoice and packing slip in PDF format for print or email.
     13Want to print your WooCommerce order invoice or packing slip? Or download them in PDF format? You are in the right place! With WooCommerce you will feel the lack of print invoices or packing lists, which we are happy to fulfill. **WPWing PDF Invoice and Packing Slip for WooCommerce** can download your WooCommerce order invoice and packing slip in PDF format for print or email.
    1414
    1515
     
    1818= Must have plugin for WooCommerce with tremendous support =
    1919
    20 Want to print your WooCommerce order invoice or packing slip? Or download them in PDF format? You are in the right place! With WooCommerce you will feel the lacking of print invoices or packing lists, which we are happy to fulfill. **WPWing PDF Invoice and Packing Slip for WooCommerce** can download your WooCommerce order invoice and packing slip in PDF format for print or email.
     20Want to print your WooCommerce order invoice or packing slip? Or download them in PDF format? You are in the right place! With WooCommerce you will feel the lack of print invoices or packing lists, which we are happy to fulfill. **WPWing PDF Invoice and Packing Slip for WooCommerce** can download your WooCommerce order invoice and packing slip in PDF format for print or email.
    2121
    22 ✅ Tested OK with WooCommerce 6.5
     22✅ Tested OK with WooCommerce 8.5
    2323
    2424### 🔥 FEATURES: ###
     
    7373== Changelog ==
    7474
     75= 1.4.1 - 20/01/2024
     76
     77* Update: DOM PDF version 2.0.4
     78* Compatibility check with WP's latest version.
     79* Compatibility check with WC's latest version.
     80* Few minor improvements.
     81
    7582= 1.4.0 - 17/06/2023
    7683
    77 * Update: Remove WPWing prefix from plugin name
     84* Update: Remove WPWing prefix from the plugin name
    7885* Update: Invoice and Packing slip open in new tab
    7986* Few minor improvements.
  • wpwing-pdf-invoice-packing-slip-for-woocommerce/tags/1.4.1/vendor/autoload.php

    r2900363 r3024399  
    55require_once __DIR__ . '/composer/autoload_real.php';
    66
    7 return ComposerAutoloaderInit02775e21763226d85a226d55c9acfc98::getLoader();
     7return ComposerAutoloaderInitbf78a1f8678d210391362580614bce81::getLoader();
  • wpwing-pdf-invoice-packing-slip-for-woocommerce/tags/1.4.1/vendor/composer/autoload_real.php

    r2900363 r3024399  
    33// autoload_real.php @generated by Composer
    44
    5 class ComposerAutoloaderInit02775e21763226d85a226d55c9acfc98
     5class ComposerAutoloaderInitbf78a1f8678d210391362580614bce81
    66{
    77    private static $loader;
     
    2525        require __DIR__ . '/platform_check.php';
    2626
    27         spl_autoload_register(array('ComposerAutoloaderInit02775e21763226d85a226d55c9acfc98', 'loadClassLoader'), true, true);
     27        spl_autoload_register(array('ComposerAutoloaderInitbf78a1f8678d210391362580614bce81', 'loadClassLoader'), true, true);
    2828        self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
    29         spl_autoload_unregister(array('ComposerAutoloaderInit02775e21763226d85a226d55c9acfc98', 'loadClassLoader'));
     29        spl_autoload_unregister(array('ComposerAutoloaderInitbf78a1f8678d210391362580614bce81', 'loadClassLoader'));
    3030
    3131        $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
     
    3333            require __DIR__ . '/autoload_static.php';
    3434
    35             call_user_func(\Composer\Autoload\ComposerStaticInit02775e21763226d85a226d55c9acfc98::getInitializer($loader));
     35            call_user_func(\Composer\Autoload\ComposerStaticInitbf78a1f8678d210391362580614bce81::getInitializer($loader));
    3636        } else {
    3737            $map = require __DIR__ . '/autoload_namespaces.php';
  • wpwing-pdf-invoice-packing-slip-for-woocommerce/tags/1.4.1/vendor/composer/autoload_static.php

    r2900363 r3024399  
    55namespace Composer\Autoload;
    66
    7 class ComposerStaticInit02775e21763226d85a226d55c9acfc98
     7class ComposerStaticInitbf78a1f8678d210391362580614bce81
    88{
    99    public static $prefixLengthsPsr4 = array (
     
    5858    {
    5959        return \Closure::bind(function () use ($loader) {
    60             $loader->prefixLengthsPsr4 = ComposerStaticInit02775e21763226d85a226d55c9acfc98::$prefixLengthsPsr4;
    61             $loader->prefixDirsPsr4 = ComposerStaticInit02775e21763226d85a226d55c9acfc98::$prefixDirsPsr4;
    62             $loader->classMap = ComposerStaticInit02775e21763226d85a226d55c9acfc98::$classMap;
     60            $loader->prefixLengthsPsr4 = ComposerStaticInitbf78a1f8678d210391362580614bce81::$prefixLengthsPsr4;
     61            $loader->prefixDirsPsr4 = ComposerStaticInitbf78a1f8678d210391362580614bce81::$prefixDirsPsr4;
     62            $loader->classMap = ComposerStaticInitbf78a1f8678d210391362580614bce81::$classMap;
    6363
    6464        }, null, ClassLoader::class);
  • wpwing-pdf-invoice-packing-slip-for-woocommerce/tags/1.4.1/vendor/composer/installed.json

    r2900363 r3024399  
    33        {
    44            "name": "dompdf/dompdf",
    5             "version": "v2.0.3",
    6             "version_normalized": "2.0.3.0",
     5            "version": "v2.0.4",
     6            "version_normalized": "2.0.4.0",
    77            "source": {
    88                "type": "git",
    99                "url": "https://github.com/dompdf/dompdf.git",
    10                 "reference": "e8d2d5e37e8b0b30f0732a011295ab80680d7e85"
    11             },
    12             "dist": {
    13                 "type": "zip",
    14                 "url": "https://api.github.com/repos/dompdf/dompdf/zipball/e8d2d5e37e8b0b30f0732a011295ab80680d7e85",
    15                 "reference": "e8d2d5e37e8b0b30f0732a011295ab80680d7e85",
     10                "reference": "093f2d9739cec57428e39ddadedfd4f3ae862c0f"
     11            },
     12            "dist": {
     13                "type": "zip",
     14                "url": "https://api.github.com/repos/dompdf/dompdf/zipball/093f2d9739cec57428e39ddadedfd4f3ae862c0f",
     15                "reference": "093f2d9739cec57428e39ddadedfd4f3ae862c0f",
    1616                "shasum": ""
    1717            },
     
    3737                "ext-zlib": "Needed for pdf stream compression"
    3838            },
    39             "time": "2023-02-07T12:51:48+00:00",
     39            "time": "2023-12-12T20:19:39+00:00",
    4040            "type": "library",
    4141            "installation-source": "dist",
     
    6262            "support": {
    6363                "issues": "https://github.com/dompdf/dompdf/issues",
    64                 "source": "https://github.com/dompdf/dompdf/tree/v2.0.3"
     64                "source": "https://github.com/dompdf/dompdf/tree/v2.0.4"
    6565            },
    6666            "install-path": "../dompdf/dompdf"
     
    6868        {
    6969            "name": "masterminds/html5",
    70             "version": "2.7.6",
    71             "version_normalized": "2.7.6.0",
     70            "version": "2.8.1",
     71            "version_normalized": "2.8.1.0",
    7272            "source": {
    7373                "type": "git",
    7474                "url": "https://github.com/Masterminds/html5-php.git",
    75                 "reference": "897eb517a343a2281f11bc5556d6548db7d93947"
    76             },
    77             "dist": {
    78                 "type": "zip",
    79                 "url": "https://api.github.com/repos/Masterminds/html5-php/zipball/897eb517a343a2281f11bc5556d6548db7d93947",
    80                 "reference": "897eb517a343a2281f11bc5556d6548db7d93947",
    81                 "shasum": ""
    82             },
    83             "require": {
    84                 "ext-ctype": "*",
     75                "reference": "f47dcf3c70c584de14f21143c55d9939631bc6cf"
     76            },
     77            "dist": {
     78                "type": "zip",
     79                "url": "https://api.github.com/repos/Masterminds/html5-php/zipball/f47dcf3c70c584de14f21143c55d9939631bc6cf",
     80                "reference": "f47dcf3c70c584de14f21143c55d9939631bc6cf",
     81                "shasum": ""
     82            },
     83            "require": {
    8584                "ext-dom": "*",
    86                 "ext-libxml": "*",
    8785                "php": ">=5.3.0"
    8886            },
    8987            "require-dev": {
    90                 "phpunit/phpunit": "^4.8.35 || ^5.7.21 || ^6 || ^7"
    91             },
    92             "time": "2022-08-18T16:18:26+00:00",
     88                "phpunit/phpunit": "^4.8.35 || ^5.7.21 || ^6 || ^7 || ^8"
     89            },
     90            "time": "2023-05-10T11:58:31+00:00",
    9391            "type": "library",
    9492            "extra": {
     
    134132            "support": {
    135133                "issues": "https://github.com/Masterminds/html5-php/issues",
    136                 "source": "https://github.com/Masterminds/html5-php/tree/2.7.6"
     134                "source": "https://github.com/Masterminds/html5-php/tree/2.8.1"
    137135            },
    138136            "install-path": "../masterminds/html5"
     
    140138        {
    141139            "name": "phenx/php-font-lib",
    142             "version": "0.5.4",
    143             "version_normalized": "0.5.4.0",
     140            "version": "0.5.5",
     141            "version_normalized": "0.5.5.0",
    144142            "source": {
    145143                "type": "git",
    146144                "url": "https://github.com/dompdf/php-font-lib.git",
    147                 "reference": "dd448ad1ce34c63d09baccd05415e361300c35b4"
    148             },
    149             "dist": {
    150                 "type": "zip",
    151                 "url": "https://api.github.com/repos/dompdf/php-font-lib/zipball/dd448ad1ce34c63d09baccd05415e361300c35b4",
    152                 "reference": "dd448ad1ce34c63d09baccd05415e361300c35b4",
     145                "reference": "671df0f3516252011aa94f9e8e3b3b66199339f8"
     146            },
     147            "dist": {
     148                "type": "zip",
     149                "url": "https://api.github.com/repos/dompdf/php-font-lib/zipball/671df0f3516252011aa94f9e8e3b3b66199339f8",
     150                "reference": "671df0f3516252011aa94f9e8e3b3b66199339f8",
    153151                "shasum": ""
    154152            },
     
    157155            },
    158156            "require-dev": {
    159                 "symfony/phpunit-bridge": "^3 || ^4 || ^5"
    160             },
    161             "time": "2021-12-17T19:44:54+00:00",
     157                "symfony/phpunit-bridge": "^3 || ^4 || ^5 || ^6"
     158            },
     159            "time": "2024-01-07T18:13:29+00:00",
    162160            "type": "library",
    163161            "installation-source": "dist",
     
    169167            "notification-url": "https://packagist.org/downloads/",
    170168            "license": [
    171                 "LGPL-3.0"
     169                "LGPL-2.1-or-later"
    172170            ],
    173171            "authors": [
     
    181179            "support": {
    182180                "issues": "https://github.com/dompdf/php-font-lib/issues",
    183                 "source": "https://github.com/dompdf/php-font-lib/tree/0.5.4"
     181                "source": "https://github.com/dompdf/php-font-lib/tree/0.5.5"
    184182            },
    185183            "install-path": "../phenx/php-font-lib"
     
    187185        {
    188186            "name": "phenx/php-svg-lib",
    189             "version": "0.5.0",
    190             "version_normalized": "0.5.0.0",
     187            "version": "0.5.1",
     188            "version_normalized": "0.5.1.0",
    191189            "source": {
    192190                "type": "git",
    193191                "url": "https://github.com/dompdf/php-svg-lib.git",
    194                 "reference": "76876c6cf3080bcb6f249d7d59705108166a6685"
    195             },
    196             "dist": {
    197                 "type": "zip",
    198                 "url": "https://api.github.com/repos/dompdf/php-svg-lib/zipball/76876c6cf3080bcb6f249d7d59705108166a6685",
    199                 "reference": "76876c6cf3080bcb6f249d7d59705108166a6685",
     192                "reference": "8a8a1ebcf6aea861ef30197999f096f7bd4b4456"
     193            },
     194            "dist": {
     195                "type": "zip",
     196                "url": "https://api.github.com/repos/dompdf/php-svg-lib/zipball/8a8a1ebcf6aea861ef30197999f096f7bd4b4456",
     197                "reference": "8a8a1ebcf6aea861ef30197999f096f7bd4b4456",
    200198                "shasum": ""
    201199            },
     
    208206                "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5"
    209207            },
    210             "time": "2022-09-06T12:16:56+00:00",
     208            "time": "2023-12-11T20:56:08+00:00",
    211209            "type": "library",
    212210            "installation-source": "dist",
     
    230228            "support": {
    231229                "issues": "https://github.com/dompdf/php-svg-lib/issues",
    232                 "source": "https://github.com/dompdf/php-svg-lib/tree/0.5.0"
     230                "source": "https://github.com/dompdf/php-svg-lib/tree/0.5.1"
    233231            },
    234232            "install-path": "../phenx/php-svg-lib"
  • wpwing-pdf-invoice-packing-slip-for-woocommerce/tags/1.4.1/vendor/composer/installed.php

    r2927383 r3024399  
    66        'install_path' => __DIR__ . '/../../',
    77        'aliases' => array(),
    8         'reference' => '73e7da86a1b51ee4c3594d66d3281f361cd3753d',
     8        'reference' => 'feb79eda7375cc2bdf54e38dc5c640dd62a0b663',
    99        'name' => '__root__',
    1010        'dev' => true,
     
    1717            'install_path' => __DIR__ . '/../../',
    1818            'aliases' => array(),
    19             'reference' => '73e7da86a1b51ee4c3594d66d3281f361cd3753d',
     19            'reference' => 'feb79eda7375cc2bdf54e38dc5c640dd62a0b663',
    2020            'dev_requirement' => false,
    2121        ),
    2222        'dompdf/dompdf' => array(
    23             'pretty_version' => 'v2.0.3',
    24             'version' => '2.0.3.0',
     23            'pretty_version' => 'v2.0.4',
     24            'version' => '2.0.4.0',
    2525            'type' => 'library',
    2626            'install_path' => __DIR__ . '/../dompdf/dompdf',
    2727            'aliases' => array(),
    28             'reference' => 'e8d2d5e37e8b0b30f0732a011295ab80680d7e85',
     28            'reference' => '093f2d9739cec57428e39ddadedfd4f3ae862c0f',
    2929            'dev_requirement' => false,
    3030        ),
    3131        'masterminds/html5' => array(
    32             'pretty_version' => '2.7.6',
    33             'version' => '2.7.6.0',
     32            'pretty_version' => '2.8.1',
     33            'version' => '2.8.1.0',
    3434            'type' => 'library',
    3535            'install_path' => __DIR__ . '/../masterminds/html5',
    3636            'aliases' => array(),
    37             'reference' => '897eb517a343a2281f11bc5556d6548db7d93947',
     37            'reference' => 'f47dcf3c70c584de14f21143c55d9939631bc6cf',
    3838            'dev_requirement' => false,
    3939        ),
    4040        'phenx/php-font-lib' => array(
    41             'pretty_version' => '0.5.4',
    42             'version' => '0.5.4.0',
     41            'pretty_version' => '0.5.5',
     42            'version' => '0.5.5.0',
    4343            'type' => 'library',
    4444            'install_path' => __DIR__ . '/../phenx/php-font-lib',
    4545            'aliases' => array(),
    46             'reference' => 'dd448ad1ce34c63d09baccd05415e361300c35b4',
     46            'reference' => '671df0f3516252011aa94f9e8e3b3b66199339f8',
    4747            'dev_requirement' => false,
    4848        ),
    4949        'phenx/php-svg-lib' => array(
    50             'pretty_version' => '0.5.0',
    51             'version' => '0.5.0.0',
     50            'pretty_version' => '0.5.1',
     51            'version' => '0.5.1.0',
    5252            'type' => 'library',
    5353            'install_path' => __DIR__ . '/../phenx/php-svg-lib',
    5454            'aliases' => array(),
    55             'reference' => '76876c6cf3080bcb6f249d7d59705108166a6685',
     55            'reference' => '8a8a1ebcf6aea861ef30197999f096f7bd4b4456',
    5656            'dev_requirement' => false,
    5757        ),
  • wpwing-pdf-invoice-packing-slip-for-woocommerce/tags/1.4.1/vendor/dompdf/dompdf/VERSION

    r2900363 r3024399  
    1 2.0.3
     12.0.4
  • wpwing-pdf-invoice-packing-slip-for-woocommerce/tags/1.4.1/vendor/dompdf/dompdf/src/Image/Cache.php

    r2900363 r3024399  
    3333
    3434    /**
     35     * Array of image references from an SVG document.
     36     * Used to detect circular references across SVG documents.
     37     *
     38     * @var array
     39     */
     40    protected static $svgRefs = [];
     41
     42    /**
    3543     * The url to the "broken image" used when images can't be loaded
    3644     *
     
    135143                    function ($parser, $name, $attributes) use ($options, $parsed_url, $full_url) {
    136144                        if (strtolower($name) === "image") {
     145                            if (!\array_key_exists($full_url, self::$svgRefs)) {
     146                                self::$svgRefs[$full_url] = [];
     147                            }
    137148                            $attributes = array_change_key_case($attributes, CASE_LOWER);
    138149                            $urls = [];
     
    140151                            $urls[] = $attributes["href"] ?? "";
    141152                            foreach ($urls as $url) {
    142                                 if (!empty($url)) {
    143                                     $inner_full_url = Helpers::build_url($parsed_url["protocol"], $parsed_url["host"], $parsed_url["path"], $url);
    144                                     if ($inner_full_url === $full_url) {
    145                                         throw new ImageException("SVG self-reference is not allowed", E_WARNING);
    146                                     }
    147                                     [$resolved_url, $type, $message] = self::resolve_url($url, $parsed_url["protocol"], $parsed_url["host"], $parsed_url["path"], $options);
    148                                     if (!empty($message)) {
    149                                         throw new ImageException("This SVG document references a restricted resource. $message", E_WARNING);
    150                                     }
     153                                if (empty($url)) {
     154                                    continue;
     155                                }
     156
     157                                $inner_full_url = Helpers::build_url($parsed_url["protocol"], $parsed_url["host"], $parsed_url["path"], $url);
     158                                if (empty($inner_full_url)) {
     159                                    continue;
     160                                }
     161                               
     162                                self::detectCircularRef($full_url, $inner_full_url);
     163                                self::$svgRefs[$full_url][] = $inner_full_url;
     164                                [$resolved_url, $type, $message] = self::resolve_url($url, $parsed_url["protocol"], $parsed_url["host"], $parsed_url["path"], $options);
     165                                if (!empty($message)) {
     166                                    throw new ImageException("This SVG document references a restricted resource. $message", E_WARNING);
    151167                                }
    152168                            }
     
    179195    }
    180196
     197    static function detectCircularRef(string $src, string $target)
     198    {
     199        if (!\array_key_exists($target, self::$svgRefs)) {
     200            return;
     201        }
     202        foreach (self::$svgRefs[$target] as $ref) {
     203            if ($ref === $src) {
     204                throw new ImageException("Circular external SVG image reference detected.", E_WARNING);
     205            }
     206            self::detectCircularRef($src, $ref);
     207        }
     208    }
     209
    181210    /**
    182211     * Register a temp file for the given original image file.
     
    240269        self::$_cache = [];
    241270        self::$tempImages = [];
     271        self::$svgRefs = [];
    242272    }
    243273
  • wpwing-pdf-invoice-packing-slip-for-woocommerce/tags/1.4.1/vendor/masterminds/html5/README.md

    r2900365 r3024399  
    190190  interpreter. While one may be supplied, not all features will be
    191191  supported.
    192 - Rentrance: The current parser is not re-entrant. (Thus you can't pause
     192- Reentrance: The current parser is not re-entrant. (Thus you can't pause
    193193  the parser to modify the HTML string mid-parse.)
    194194- Validation: The current tree builder is **not** a validating parser.
  • wpwing-pdf-invoice-packing-slip-for-woocommerce/tags/1.4.1/vendor/masterminds/html5/composer.json

    r2900365 r3024399  
    2121    ],
    2222    "require" : {
    23         "ext-ctype": "*",
    2423        "ext-dom": "*",
    25         "ext-libxml" : "*",
    2624        "php" : ">=5.3.0"
    2725    },
    2826    "require-dev": {
    29         "phpunit/phpunit" : "^4.8.35 || ^5.7.21 || ^6 || ^7"
     27        "phpunit/phpunit" : "^4.8.35 || ^5.7.21 || ^6 || ^7 || ^8"
    3028    },
    3129    "autoload": {
  • wpwing-pdf-invoice-packing-slip-for-woocommerce/tags/1.4.1/vendor/masterminds/html5/src/HTML5/Elements.php

    r2900365 r3024399  
    186186        'ul' => 81, // NORMAL | AUTOCLOSE_P | BLOCK_TAG
    187187        'var' => 1,
    188         'video' => 65, // NORMAL | BLOCK_TAG
     188        'video' => 1,
    189189        'wbr' => 9, // NORMAL | VOID_TAG
    190190
  • wpwing-pdf-invoice-packing-slip-for-woocommerce/tags/1.4.1/vendor/masterminds/html5/src/HTML5/Parser/Tokenizer.php

    r2900365 r3024399  
    132132            $tok = $this->scanner->next();
    133133
    134             if ('!' === $tok) {
     134            if (false === $tok) {
     135                // end of string
     136                $this->parseError('Illegal tag opening');
     137            } elseif ('!' === $tok) {
    135138                $this->markupDeclaration();
    136139            } elseif ('/' === $tok) {
     
    138141            } elseif ('?' === $tok) {
    139142                $this->processingInstruction();
    140             } elseif (ctype_alpha($tok)) {
     143            } elseif ($this->is_alpha($tok)) {
    141144                $this->tagName();
    142145            } else {
     
    348351        // EOF -> parse error
    349352        // -> parse error
    350         if (!ctype_alpha($tok)) {
     353        if (!$this->is_alpha($tok)) {
    351354            $this->parseError("Expected tag name, got '%s'", $tok);
    352355            if ("\0" == $tok || false === $tok) {
     
    11951198        return '&';
    11961199    }
     1200
     1201    /**
     1202     * Checks whether a (single-byte) character is an ASCII letter or not.
     1203     *
     1204     * @param string $input A single-byte string
     1205     *
     1206     * @return bool True if it is a letter, False otherwise
     1207     */
     1208    protected function is_alpha($input)
     1209    {
     1210        $code = ord($input);
     1211
     1212        return ($code >= 97 && $code <= 122) || ($code >= 65 && $code <= 90);
     1213    }
    11971214}
  • wpwing-pdf-invoice-packing-slip-for-woocommerce/tags/1.4.1/vendor/masterminds/html5/src/HTML5/Parser/UTF8Utils.php

    r2900365 r3024399  
    3939    /**
    4040     * Count the number of characters in a string.
    41      * UTF-8 aware. This will try (in order) iconv, MB, libxml, and finally a custom counter.
     41     * UTF-8 aware. This will try (in order) iconv, MB, and finally a custom counter.
    4242     *
    4343     * @param string $string
     
    5454        if (function_exists('iconv_strlen')) {
    5555            return iconv_strlen($string, 'utf-8');
    56         }
    57 
    58         if (function_exists('utf8_decode')) {
    59             // MPB: Will this work? Won't certain decodes lead to two chars
    60             // extrapolated out of 2-byte chars?
    61             return strlen(utf8_decode($string));
    6256        }
    6357
  • wpwing-pdf-invoice-packing-slip-for-woocommerce/tags/1.4.1/vendor/phenx/php-font-lib/README.md

    r2672742 r3024399  
    99 * Make an Adobe Font Metrics (AFM) file from a font
    1010
    11 You can find a demo GUI [here](http://pxd.me/php-font-lib/www/font_explorer.html).
    12 
    1311This project was initiated by the need to read font files in the [DOMPDF project](https://github.com/dompdf/dompdf).
    1412
     
    1614-------------
    1715
    18 ```
    19 $font = \FontLib\Font::load('../../fontfile.ttf');
     16### Base font information
     17
     18```php
     19$font = \FontLib\Font::load('fontfile.ttf');
    2020$font->parse();  // for getFontWeight() to work this call must be done first!
    2121echo $font->getFontName() .'<br>';
     
    2626echo $font->getFontWeight() .'<br>';
    2727echo $font->getFontPostscriptName() .'<br>';
     28$font->close();
    2829```
     30
     31### Font Metrics Generation
     32
     33```php
     34$font = FontLib\Font::load('fontfile.ttf');
     35$font->parse();
     36$font->saveAdobeFontMetrics('fontfile.ufm');
     37```
     38
     39### Create a font subset
     40
     41```php
     42$font = FontLib\Font::load('fontfile.ttf');
     43$font->parse();
     44$font->setSubset("abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ.:,;' (!?)+-*/== 1234567890"); // characters to include
     45$font->reduce();
     46touch('fontfile.subset.ttf');
     47$font->open('fontfile.subset.ttf', FontLib\BinaryStream::modeReadWrite);
     48$font->encode(array("OS/2"));
     49$font->close();
     50```
  • wpwing-pdf-invoice-packing-slip-for-woocommerce/tags/1.4.1/vendor/phenx/php-font-lib/composer.json

    r2672742 r3024399  
    44    "description": "A library to read, parse, export and make subsets of different types of font files.",
    55    "homepage": "https://github.com/PhenX/php-font-lib",
    6     "license": "LGPL-3.0",
     6    "license": "LGPL-2.1-or-later",
    77    "authors": [
    88        {
     
    2828    },
    2929    "require-dev": {
    30         "symfony/phpunit-bridge" : "^3 || ^4 || ^5"
     30        "symfony/phpunit-bridge" : "^3 || ^4 || ^5 || ^6"
    3131    }
    3232}
  • wpwing-pdf-invoice-packing-slip-for-woocommerce/tags/1.4.1/vendor/phenx/php-font-lib/src/FontLib/AdobeFontMetrics.php

    r2672742 r3024399  
    22/**
    33 * @package php-font-lib
    4  * @link    https://github.com/PhenX/php-font-lib
     4 * @link    https://github.com/dompdf/php-font-lib
    55 * @author  Fabien Ménager <fabien.menager@gmail.com>
    66 * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
     
    4949    $this->startSection("FontMetrics", 4.1);
    5050    $this->addPair("Notice", "Converted by PHP-font-lib");
    51     $this->addPair("Comment", "https://github.com/PhenX/php-font-lib");
     51    $this->addPair("Comment", "https://github.com/dompdf/php-font-lib");
    5252
    5353    $encoding_scheme = ($encoding ? $encoding : "FontSpecific");
     
    7676    if (isset($hhea["ascent"])) {
    7777      $this->addPair("FontHeightOffset", $font->normalizeFUnit($hhea["lineGap"]));
    78       $this->addPair("Ascender", $font->normalizeFUnit($hhea["ascent"]));
    79       $this->addPair("Descender", $font->normalizeFUnit($hhea["descent"]));
    8078    }
    8179    else {
    8280      $this->addPair("FontHeightOffset", $font->normalizeFUnit($os2["typoLineGap"]));
     81    }
     82
     83    $glyf = $font->getData("glyf");
     84    $glyphIndexArray = $font->getUnicodeCharMap();
     85
     86    // capHeight is based on capital H
     87    if (\array_key_exists(72, $glyphIndexArray)) {
     88      $upperH = $glyf[$glyphIndexArray[72]];
     89      $upperH->parseData();
     90      $this->addPair("CapHeight", $font->normalizeFUnit($upperH->yMax));
     91    }
     92
     93    // xHeight is based on lowercase x
     94    if (\array_key_exists(120, $glyphIndexArray)) {
     95      $lowerX = $glyf[$glyphIndexArray[120]];
     96      $lowerX->parseData();
     97      $this->addPair("XHeight", $font->normalizeFUnit($lowerX->yMax));
     98    }
     99
     100    // ascender is based on lowercase d
     101    if (\array_key_exists(100, $glyphIndexArray)) {
     102      $lowerD = $glyf[$glyphIndexArray[100]];
     103      $lowerD->parseData();
     104      $this->addPair("Ascender", $font->normalizeFUnit($lowerD->yMax));
     105    } elseif (isset($hhea["ascent"])) {
     106      $this->addPair("Ascender", $font->normalizeFUnit($hhea["ascent"]));
     107    }
     108    else {
    83109      $this->addPair("Ascender", $font->normalizeFUnit($os2["typoAscender"]));
     110    }
     111
     112    // descender is based on lowercase p
     113    if (\array_key_exists(112, $glyphIndexArray)) {
     114      $lowerP = $glyf[$glyphIndexArray[112]];
     115      $lowerP->parseData();
     116      $this->addPair("Descender", $font->normalizeFUnit($lowerP->yMin));
     117    } elseif (isset($hhea["ascent"])) {
     118      $this->addPair("Descender", $font->normalizeFUnit($hhea["descent"]));
     119    }
     120    else {
    84121      $this->addPair("Descender", -abs($font->normalizeFUnit($os2["typoDescender"])));
    85122    }
     
    93130    ));
    94131
    95     $glyphIndexArray = $font->getUnicodeCharMap();
    96 
    97132    if ($glyphIndexArray) {
    98133      $hmtx  = $font->getData("hmtx");
  • wpwing-pdf-invoice-packing-slip-for-woocommerce/tags/1.4.1/vendor/phenx/php-font-lib/src/FontLib/BinaryStream.php

    r2672742 r3024399  
    22/**
    33 * @package php-font-lib
    4  * @link    https://github.com/PhenX/php-font-lib
     4 * @link    https://github.com/dompdf/php-font-lib
    55 * @author  Fabien Ménager <fabien.menager@gmail.com>
    66 * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
  • wpwing-pdf-invoice-packing-slip-for-woocommerce/tags/1.4.1/vendor/phenx/php-font-lib/src/FontLib/EOT/File.php

    r2672742 r3024399  
    22/**
    33 * @package php-font-lib
    4  * @link    https://github.com/PhenX/php-font-lib
     4 * @link    https://github.com/dompdf/php-font-lib
    55 * @author  Fabien Ménager <fabien.menager@gmail.com>
    66 * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
  • wpwing-pdf-invoice-packing-slip-for-woocommerce/tags/1.4.1/vendor/phenx/php-font-lib/src/FontLib/EOT/Header.php

    r2614294 r3024399  
    22/**
    33 * @package php-font-lib
    4  * @link    https://github.com/PhenX/php-font-lib
     4 * @link    https://github.com/dompdf/php-font-lib
    55 * @author  Fabien Ménager <fabien.menager@gmail.com>
    66 * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
  • wpwing-pdf-invoice-packing-slip-for-woocommerce/tags/1.4.1/vendor/phenx/php-font-lib/src/FontLib/EncodingMap.php

    r2614294 r3024399  
    22/**
    33 * @package php-font-lib
    4  * @link    https://github.com/PhenX/php-font-lib
     4 * @link    https://github.com/dompdf/php-font-lib
    55 * @author  Fabien Ménager <fabien.menager@gmail.com>
    66 * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
  • wpwing-pdf-invoice-packing-slip-for-woocommerce/tags/1.4.1/vendor/phenx/php-font-lib/src/FontLib/Font.php

    r2672742 r3024399  
    22/**
    33 * @package php-font-lib
    4  * @link    https://github.com/PhenX/php-font-lib
     4 * @link    https://github.com/dompdf/php-font-lib
    55 * @author  Fabien Ménager <fabien.menager@gmail.com>
    66 * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
  • wpwing-pdf-invoice-packing-slip-for-woocommerce/tags/1.4.1/vendor/phenx/php-font-lib/src/FontLib/Glyph/Outline.php

    r2672742 r3024399  
    22/**
    33 * @package php-font-lib
    4  * @link    https://github.com/PhenX/php-font-lib
     4 * @link    https://github.com/dompdf/php-font-lib
    55 * @author  Fabien Ménager <fabien.menager@gmail.com>
    66 * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
     
    4949    $font->seek($offset);
    5050
    51     if ($font->readInt16() > -1) {
     51    if ($size === 0 || $font->readInt16() > -1) {
    5252      /** @var OutlineSimple $glyph */
    5353      $glyph = new OutlineSimple($table, $offset, $size);
  • wpwing-pdf-invoice-packing-slip-for-woocommerce/tags/1.4.1/vendor/phenx/php-font-lib/src/FontLib/Glyph/OutlineComponent.php

    r2614294 r3024399  
    22/**
    33 * @package php-font-lib
    4  * @link    https://github.com/PhenX/php-font-lib
     4 * @link    https://github.com/dompdf/php-font-lib
    55 * @author  Fabien Ménager <fabien.menager@gmail.com>
    66 * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
  • wpwing-pdf-invoice-packing-slip-for-woocommerce/tags/1.4.1/vendor/phenx/php-font-lib/src/FontLib/Glyph/OutlineComposite.php

    r2614294 r3024399  
    22/**
    33 * @package php-font-lib
    4  * @link    https://github.com/PhenX/php-font-lib
     4 * @link    https://github.com/dompdf/php-font-lib
    55 * @author  Fabien Ménager <fabien.menager@gmail.com>
    66 * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
     
    130130      $this->components[] = $component;
    131131    } while ($flags & self::MORE_COMPONENTS);
     132    if ($flags & self::WE_HAVE_INSTRUCTIONS) {
     133      $numInstr = $font->readUInt16();
     134      $instr = $font->read($numInstr);
     135      $this->components[count($this->components) - 1]->instructions = pack('n', $numInstr) . $instr;
     136    }
    132137  }
    133138
     
    172177      if ($_i < count($this->components) - 1) {
    173178        $flags |= self::MORE_COMPONENTS;
     179      } elseif($_component->instructions !== null) {
     180        $flags |= self::WE_HAVE_INSTRUCTIONS;
    174181      }
    175182
     
    215222    }
    216223
     224    if($_component->instructions !== null) {
     225      $size += $font->write($_component->instructions, strlen($_component->instructions));
     226    }
     227
    217228    return $size;
    218229  }
  • wpwing-pdf-invoice-packing-slip-for-woocommerce/tags/1.4.1/vendor/phenx/php-font-lib/src/FontLib/Glyph/OutlineSimple.php

    r2672742 r3024399  
    22/**
    33 * @package php-font-lib
    4  * @link    https://github.com/PhenX/php-font-lib
     4 * @link    https://github.com/dompdf/php-font-lib
    55 * @author  Fabien Ménager <fabien.menager@gmail.com>
    66 * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
  • wpwing-pdf-invoice-packing-slip-for-woocommerce/tags/1.4.1/vendor/phenx/php-font-lib/src/FontLib/Header.php

    r2614294 r3024399  
    22/**
    33 * @package php-font-lib
    4  * @link    https://github.com/PhenX/php-font-lib
     4 * @link    https://github.com/dompdf/php-font-lib
    55 * @author  Fabien Ménager <fabien.menager@gmail.com>
    66 * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
  • wpwing-pdf-invoice-packing-slip-for-woocommerce/tags/1.4.1/vendor/phenx/php-font-lib/src/FontLib/OpenType/File.php

    r2614294 r3024399  
    22/**
    33 * @package php-font-lib
    4  * @link    https://github.com/PhenX/php-font-lib
     4 * @link    https://github.com/dompdf/php-font-lib
    55 * @author  Fabien Ménager <fabien.menager@gmail.com>
    66 * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
  • wpwing-pdf-invoice-packing-slip-for-woocommerce/tags/1.4.1/vendor/phenx/php-font-lib/src/FontLib/OpenType/TableDirectoryEntry.php

    r2614294 r3024399  
    22/**
    33 * @package php-font-lib
    4  * @link    https://github.com/PhenX/php-font-lib
     4 * @link    https://github.com/dompdf/php-font-lib
    55 * @author  Fabien Ménager <fabien.menager@gmail.com>
    66 * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
  • wpwing-pdf-invoice-packing-slip-for-woocommerce/tags/1.4.1/vendor/phenx/php-font-lib/src/FontLib/Table/DirectoryEntry.php

    r2672742 r3024399  
    22/**
    33 * @package php-font-lib
    4  * @link    https://github.com/PhenX/php-font-lib
     4 * @link    https://github.com/dompdf/php-font-lib
    55 * @author  Fabien Ménager <fabien.menager@gmail.com>
    66 * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
     
    5050    }
    5151
    52     $len = mb_strlen($data, '8bit');
    53 
    54     $hi = 0x0000;
    55     $lo = 0x0000;
    56 
    57     for ($i = 0; $i < $len; $i += 4) {
    58       $hi += (ord($data[$i]) << 8) + ord($data[$i + 1]);
    59       $lo += (ord($data[$i + 2]) << 8) + ord($data[$i + 3]);
    60       $hi += $lo >> 16;
    61       $lo = $lo & 0xFFFF;
    62       $hi = $hi & 0xFFFF;
    63     }
    64 
    65     return ($hi << 8) + $lo;
     52    $table = unpack("N*", $data);
     53    return array_sum($table);
    6654  }
    6755
     
    9482    $table_length = $data->encode();
    9583
     84    $font->seek($table_offset + $table_length);
     85    $pad = 0;
     86    $mod = $table_length % 4;
     87    if ($mod != 0) {
     88      $pad = 4 - $mod;
     89      $font->write(str_pad("", $pad, "\0"), $pad);
     90    }
     91
    9692    $font->seek($table_offset);
    9793    $table_data = $font->read($table_length);
     
    106102    Font::d("Bytes written = $table_length");
    107103
    108     $font->seek($table_offset + $table_length);
     104    $font->seek($table_offset + $table_length + $pad);
    109105  }
    110106
  • wpwing-pdf-invoice-packing-slip-for-woocommerce/tags/1.4.1/vendor/phenx/php-font-lib/src/FontLib/Table/Table.php

    r2614294 r3024399  
    22/**
    33 * @package php-font-lib
    4  * @link    https://github.com/PhenX/php-font-lib
     4 * @link    https://github.com/dompdf/php-font-lib
    55 * @author  Fabien Ménager <fabien.menager@gmail.com>
    66 * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
  • wpwing-pdf-invoice-packing-slip-for-woocommerce/tags/1.4.1/vendor/phenx/php-font-lib/src/FontLib/Table/Type/cmap.php

    r2614294 r3024399  
    22/**
    33 * @package php-font-lib
    4  * @link    https://github.com/PhenX/php-font-lib
     4 * @link    https://github.com/dompdf/php-font-lib
    55 * @author  Fabien Ménager <fabien.menager@gmail.com>
    66 * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
     
    2727  );
    2828
     29  private static $subtable_v2_format = array(
     30    "length"        => self::uint16,
     31    "language"      => self::uint16
     32  );
     33
     34  private static $subtable_v2_format_subheader = array(
     35    "firstCode"     => self::uint16,
     36    "entryCount"    => self::uint16,
     37    "idDelta"       => self::int16,
     38    "idRangeOffset" => self::uint16
     39  );
     40
    2941  private static $subtable_v4_format = array(
    3042    "length"        => self::uint16,
     
    3951    "length"        => self::uint32,
    4052    "language"      => self::uint32,
    41     "ngroups"    => self::uint32
     53    "ngroups"       => self::uint32
    4254  );
    4355
     
    6173      $subtable["format"] = $font->readUInt16();
    6274
    63       // @todo Only CMAP version 4 and 12
    64       if (($subtable["format"] != 4) && ($subtable["format"] != 12)) {
    65         unset($data["subtables"][$i]);
    66         $data["numberSubtables"]--;
    67         continue;
    68       }
    69 
    70       if ($subtable["format"] == 12) {
    71 
    72         $font->readUInt16();
    73 
    74         $subtable += $font->unpack(self::$subtable_v12_format);
    75 
    76         $glyphIndexArray = array();
    77         $endCodes = array();
    78         $startCodes = array();
    79 
    80         for ($p = 0; $p < $subtable['ngroups']; $p++) {
    81 
    82           $startCode = $startCodes[] = $font->readUInt32();
    83           $endCode = $endCodes[] = $font->readUInt32();
    84           $startGlyphCode = $font->readUInt32();
    85 
    86           for ($c = $startCode; $c <= $endCode; $c++) {
    87             $glyphIndexArray[$c] = $startGlyphCode;
    88             $startGlyphCode++;
     75      switch ($subtable["format"]) {
     76        case 0:
     77        case 6:
     78        case 8:
     79        case 10:
     80        case 13:
     81        case 14:
     82          unset($data["subtables"][$i]);
     83          $data["numberSubtables"]--;
     84          continue 2;
     85
     86        case 2:
     87          $subtable += $font->unpack(self::$subtable_v2_format);
     88
     89          $subHeaderKeys = array_map(function($val) { return $val / 8; }, $font->readUInt16Many(256));
     90          $subHeaders = array();
     91
     92          $glyphIdArray = array();
     93          $maxSubHeaderIndex = max($subHeaderKeys);
     94          for ($i = 0; $i <= $maxSubHeaderIndex; $i++) {
     95            $subHeader = $font->unpack(self::$subtable_v2_format_subheader);
     96            $offset = $font->pos();
     97            $subHeader["glyphIdArrayOffset"] = $offset + $subHeader["idRangeOffset"] - 2;
     98            $subHeaders[$i] = $subHeader;
     99
     100            if (!\array_key_exists($subHeader["glyphIdArrayOffset"], $glyphIdArray) || count($glyphIdArray[$subHeader["glyphIdArrayOffset"]]) < $subHeader["entryCount"]) {
     101              $font->seek($subHeader["glyphIdArrayOffset"]);
     102              $glyphIdArray[$subHeader["glyphIdArrayOffset"]] = $font->readUInt16Many($subHeader["entryCount"]);
     103              $font->seek($offset);
     104            }
    89105          }
    90         }
    91 
    92         $subtable += array(
    93           "startCode" => $startCodes,
    94           "endCode" => $endCodes,
    95           "glyphIndexArray" => $glyphIndexArray,
    96         );
    97 
    98       }
    99       else if ($subtable["format"] == 4) {
    100 
    101         $subtable += $font->unpack(self::$subtable_v4_format);
    102 
    103         $segCount             = $subtable["segCountX2"] / 2;
    104         $subtable["segCount"] = $segCount;
    105 
    106         $endCode = $font->readUInt16Many($segCount);
    107 
    108         $font->readUInt16(); // reservedPad
    109 
    110         $startCode = $font->readUInt16Many($segCount);
    111         $idDelta   = $font->readInt16Many($segCount);
    112 
    113         $ro_start      = $font->pos();
    114         $idRangeOffset = $font->readUInt16Many($segCount);
    115 
    116         $glyphIndexArray = array();
    117         for ($i = 0; $i < $segCount; $i++) {
    118           $c1 = $startCode[$i];
    119           $c2 = $endCode[$i];
    120           $d  = $idDelta[$i];
    121           $ro = $idRangeOffset[$i];
    122 
    123           if ($ro > 0) {
    124             $font->seek($subtable["offset"] + 2 * $i + $ro);
     106
     107          $glyphIndexArray = array();
     108          foreach ($subHeaderKeys as $highByte => $subHeaderKey) {
     109            $subHeader = $subHeaders[$subHeaderKey];
     110            if ($subHeaderKey === 0) {
     111              $c = $highByte;
     112              if ($c < $subHeader["firstCode"] || $c >= ($subHeader["firstCode"] + $subHeader["entryCount"])) {
     113                $glyphIndexArray[$c] = 0;
     114                continue;
     115              }
     116              $c = $highByte;
     117              $index = $c - $subHeader["firstCode"];
     118              $glyphId = $glyphIdArray[$subHeader["glyphIdArrayOffset"]][$index];
     119              if ($glyphId === 0) {
     120                $glyphIndexArray[$c] = 0;
     121              } else {
     122                $glyphIndexArray[$c] = ($glyphId + $subHeader["idDelta"]) & 0xFFFF;
     123              }
     124            } else {
     125              for ($index = 0; $index < $subHeader["entryCount"]; $index++) {
     126                $c = null;
     127                $lowByte = $subHeader["firstCode"] + $index;
     128                $c = (($highByte & 0xFF) << 8) | ($lowByte & 0xFF);
     129                $glyphId = $glyphIdArray[$subHeader["glyphIdArrayOffset"]][$index];
     130                if ($glyphId === 0) {
     131                  $glyphIndexArray[$c] = 0;
     132                } else {
     133                  $glyphIndexArray[$c] = ($glyphId + $subHeader["idDelta"]) & 0xFFFF;
     134                }
     135              }
     136            }
    125137          }
    126138
    127           for ($c = $c1; $c <= $c2; $c++) {
    128             if ($ro == 0) {
    129               $gid = ($c + $d) & 0xFFFF;
    130             }
    131             else {
    132               $offset = ($c - $c1) * 2 + $ro;
    133               $offset = $ro_start + 2 * $i + $offset;
    134 
    135               $font->seek($offset);
    136               $gid = $font->readUInt16();
    137 
    138               if ($gid != 0) {
    139                 $gid = ($gid + $d) & 0xFFFF;
    140               }
    141             }
    142 
    143             if ($gid > 0) {
    144               $glyphIndexArray[$c] = $gid;
     139          $subtable += array(
     140            "subHeaderKeys" => $subHeaderKeys,
     141            "subHeaders" => $subHeaders,
     142            "glyphIdArray" => $glyphIdArray,
     143            "glyphIndexArray" => $glyphIndexArray
     144          );
     145
     146          break;
     147
     148        case 4:
     149          $subtable += $font->unpack(self::$subtable_v4_format);
     150
     151          $segCount             = $subtable["segCountX2"] / 2;
     152          $subtable["segCount"] = $segCount;
     153 
     154          $endCode = $font->readUInt16Many($segCount);
     155 
     156          $font->readUInt16(); // reservedPad
     157 
     158          $startCode = $font->readUInt16Many($segCount);
     159          $idDelta   = $font->readInt16Many($segCount);
     160 
     161          $ro_start      = $font->pos();
     162          $idRangeOffset = $font->readUInt16Many($segCount);
     163 
     164          $glyphIndexArray = array();
     165          for ($i = 0; $i < $segCount; $i++) {
     166            $c1 = $startCode[$i];
     167            $c2 = $endCode[$i];
     168            $d  = $idDelta[$i];
     169            $ro = $idRangeOffset[$i];
     170 
     171            if ($ro > 0) {
     172              $font->seek($subtable["offset"] + 2 * $i + $ro);
     173            }
     174 
     175            for ($c = $c1; $c <= $c2; $c++) {
     176              if ($c === 0xFFFF) {
     177                continue;
     178              }
     179 
     180              if ($ro == 0) {
     181                $gid = ($c + $d) & 0xFFFF;
     182              }
     183              else {
     184                $offset = ($c - $c1) * 2 + $ro;
     185                $offset = $ro_start + 2 * $i + $offset;
     186 
     187                $gid = 0;
     188                if ($font->seek($offset) === true) {
     189                  $gid = $font->readUInt16();
     190                }
     191 
     192                if ($gid != 0) {
     193                  $gid = ($gid + $d) & 0xFFFF;
     194                }
     195              }
     196 
     197              if ($gid >= 0) {
     198                $glyphIndexArray[$c] = $gid;
     199              }
    145200            }
    146201          }
    147         }
    148 
    149         $subtable += array(
    150           "endCode"         => $endCode,
    151           "startCode"       => $startCode,
    152           "idDelta"         => $idDelta,
    153           "idRangeOffset"   => $idRangeOffset,
    154           "glyphIndexArray" => $glyphIndexArray,
    155         );
     202 
     203          $subtable += array(
     204            "endCode"         => $endCode,
     205            "startCode"       => $startCode,
     206            "idDelta"         => $idDelta,
     207            "idRangeOffset"   => $idRangeOffset,
     208            "glyphIndexArray" => $glyphIndexArray
     209          );
     210          break;
     211
     212        case 12:
     213          $font->readUInt16();
     214
     215          $subtable += $font->unpack(self::$subtable_v12_format);
     216
     217          $glyphIndexArray = array();
     218          $endCodes = array();
     219          $startCodes = array();
     220
     221          for ($p = 0; $p < $subtable['ngroups']; $p++) {
     222
     223            $startCode = $startCodes[] = $font->readUInt32();
     224            $endCode = $endCodes[] = $font->readUInt32();
     225            $startGlyphCode = $font->readUInt32();
     226
     227            for ($c = $startCode; $c <= $endCode; $c++) {
     228              $glyphIndexArray[$c] = $startGlyphCode;
     229              $startGlyphCode++;
     230            }
     231          }
     232
     233          $subtable += array(
     234            "startCode" => $startCodes,
     235            "endCode" => $endCodes,
     236            "glyphIndexArray" => $glyphIndexArray,
     237          );
     238          break;
    156239      }
    157240    }
     
    197280    }
    198281
    199     $segments[][] = array(0xFFFF, 0xFFFF);
     282    $segments[][] = array(0xFFFF, null);
    200283
    201284    $startCode = array();
     
    283366      $subtable["length"] = $length - $length_before;
    284367      $font->seek($before_subheader);
    285       $length += $font->pack(self::$subtable_v4_format, $subtable);
     368      $font->pack(self::$subtable_v4_format, $subtable);
    286369
    287370      $font->seek($after_subtable);
  • wpwing-pdf-invoice-packing-slip-for-woocommerce/tags/1.4.1/vendor/phenx/php-font-lib/src/FontLib/Table/Type/glyf.php

    r2614294 r3024399  
    22/**
    33 * @package php-font-lib
    4  * @link    https://github.com/PhenX/php-font-lib
     4 * @link    https://github.com/dompdf/php-font-lib
    55 * @author  Fabien Ménager <fabien.menager@gmail.com>
    66 * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
     
    4949  }
    5050
    51   public function toHTML() {
     51  public function toHTML($n = 500) {
    5252    $max  = 160;
    5353    $font = $this->getFont();
     
    7474      $height = round($height / $ratio);
    7575    }
    76 
    77     $n = 500;
    7876
    7977    $s = "<h3>" . "Only the first $n simple glyphs are shown (" . count($this->data) . " total)
     
    112110      $char = $char ? "&#{$glyphIndexArray[$g]};" : "";
    113111
     112      if ($char === "" && empty($shape["SVGContours"])) {
     113        $n++;
     114        continue;
     115      }
     116
    114117      $s .= "<div class='glyph-view $type' id='glyph-$g'>
    115118              <span class='glyph-id'>$g</span>
     
    144147    foreach ($subset as $gid) {
    145148      $loca[] = $length;
    146       $length += $data[$gid]->encode();
     149
     150      $bytes = $data[$gid]->encode();
     151
     152      $pad = 0;
     153      $mod = $bytes % 4;
     154      if ($mod != 0) {
     155        $pad = 4 - $mod;
     156        $font->write(str_pad("", $pad, "\0"), $pad);
     157      }
     158      $length += $bytes + $pad;
    147159    }
    148160
  • wpwing-pdf-invoice-packing-slip-for-woocommerce/tags/1.4.1/vendor/phenx/php-font-lib/src/FontLib/Table/Type/head.php

    r2614294 r3024399  
    22/**
    33 * @package php-font-lib
    4  * @link    https://github.com/PhenX/php-font-lib
     4 * @link    https://github.com/dompdf/php-font-lib
    55 * @author  Fabien Ménager <fabien.menager@gmail.com>
    66 * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
     
    4444    }
    4545  }
     46
     47  function _encode() {
     48    $this->data["checkSumAdjustment"] = 0;
     49    return parent::_encode();
     50  }
    4651}
  • wpwing-pdf-invoice-packing-slip-for-woocommerce/tags/1.4.1/vendor/phenx/php-font-lib/src/FontLib/Table/Type/hhea.php

    r2614294 r3024399  
    22/**
    33 * @package php-font-lib
    4  * @link    https://github.com/PhenX/php-font-lib
     4 * @link    https://github.com/dompdf/php-font-lib
    55 * @author  Fabien Ménager <fabien.menager@gmail.com>
    66 * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
  • wpwing-pdf-invoice-packing-slip-for-woocommerce/tags/1.4.1/vendor/phenx/php-font-lib/src/FontLib/Table/Type/hmtx.php

    r2614294 r3024399  
    22/**
    33 * @package php-font-lib
    4  * @link    https://github.com/PhenX/php-font-lib
     4 * @link    https://github.com/dompdf/php-font-lib
    55 * @author  Fabien Ménager <fabien.menager@gmail.com>
    66 * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
     
    3636
    3737    if ($numOfLongHorMetrics < $numGlyphs) {
    38       $lastWidth = end($data);
    39       $data      = array_pad($data, $numGlyphs, $lastWidth);
     38      $lastWidth = end($data)[0];
     39      $numLeft   = $numGlyphs - $numOfLongHorMetrics;
     40      $metrics   = $font->readUInt16Many($numLeft);
     41      for($i = 0; $i < $numLeft; $i++) {
     42        $gid             = $numOfLongHorMetrics + $i;
     43        $leftSideBearing = isset($metrics[$i]) ? $metrics[$i] : 0;
     44        $data[$gid]      = array($lastWidth, $leftSideBearing);
     45      }
    4046    }
    4147
  • wpwing-pdf-invoice-packing-slip-for-woocommerce/tags/1.4.1/vendor/phenx/php-font-lib/src/FontLib/Table/Type/kern.php

    r2614294 r3024399  
    22/**
    33 * @package php-font-lib
    4  * @link    https://github.com/PhenX/php-font-lib
     4 * @link    https://github.com/dompdf/php-font-lib
    55 * @author  Fabien Ménager <fabien.menager@gmail.com>
    66 * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
  • wpwing-pdf-invoice-packing-slip-for-woocommerce/tags/1.4.1/vendor/phenx/php-font-lib/src/FontLib/Table/Type/loca.php

    r2614294 r3024399  
    22/**
    33 * @package php-font-lib
    4  * @link    https://github.com/PhenX/php-font-lib
     4 * @link    https://github.com/dompdf/php-font-lib
    55 * @author  Fabien Ménager <fabien.menager@gmail.com>
    66 * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
  • wpwing-pdf-invoice-packing-slip-for-woocommerce/tags/1.4.1/vendor/phenx/php-font-lib/src/FontLib/Table/Type/maxp.php

    r2614294 r3024399  
    22/**
    33 * @package php-font-lib
    4  * @link    https://github.com/PhenX/php-font-lib
     4 * @link    https://github.com/dompdf/php-font-lib
    55 * @author  Fabien Ménager <fabien.menager@gmail.com>
    66 * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
  • wpwing-pdf-invoice-packing-slip-for-woocommerce/tags/1.4.1/vendor/phenx/php-font-lib/src/FontLib/Table/Type/name.php

    r2614294 r3024399  
    22/**
    33 * @package php-font-lib
    4  * @link    https://github.com/PhenX/php-font-lib
     4 * @link    https://github.com/dompdf/php-font-lib
    55 * @author  Fabien Ménager <fabien.menager@gmail.com>
    66 * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
     
    151151    }
    152152
     153    $system_encodings = mb_list_encodings();
     154    $system_encodings = array_change_key_case(array_fill_keys($system_encodings, true), CASE_UPPER);
     155   
    153156    $names = array();
    154157    foreach ($records as $record) {
    155158      $font->seek($tableOffset + $data["stringOffset"] + $record->offset);
    156       $s                      = $font->read($record->length);
    157       $record->string         = Font::UTF16ToUTF8($s);
     159      $record->stringRaw = $font->read($record->length);
     160
     161      $encoding = null;
     162      switch ($record->platformID) {
     163        case 3:
     164          switch ($record->platformSpecificID) {
     165            case 2:
     166              if (\array_key_exists("SJIS", $system_encodings)) {
     167                $encoding = "SJIS";
     168              }
     169              break;
     170            case 3:
     171              if (\array_key_exists("GB18030", $system_encodings)) {
     172                $encoding = "GB18030";
     173              }
     174              break;
     175            case 4:
     176              if (\array_key_exists("BIG-5", $system_encodings)) {
     177                $encoding = "BIG-5";
     178              }
     179              break;
     180            case 5:
     181              if (\array_key_exists("UHC", $system_encodings)) {
     182                $encoding = "UHC";
     183              }
     184              break;
     185          }
     186          break;
     187      }
     188      if ($encoding === null) {
     189        $encoding = "UTF-16";
     190      }
     191
     192      $record->string = mb_convert_encoding($record->stringRaw, "UTF-8", $encoding);
     193      if (strpos($record->string, "\0") !== false) {
     194        $record->string = str_replace("\0", "", $record->string);
     195      }
    158196      $names[$record->nameID] = $record;
    159197    }
     
    169207    /** @var nameRecord[] $records */
    170208    $records       = $this->data["records"];
    171     $count_records = count($records);
     209    $count_records = \count($records);
    172210
    173211    $this->data["count"]        = $count_records;
    174     $this->data["stringOffset"] = 6 + $count_records * 12; // 6 => uint16 * 3, 12 => sizeof self::$record_format
     212    $this->data["stringOffset"] = 6 + ($count_records * 12); // 6 => uint16 * 3, 12 => sizeof self::$record_format
    175213
    176214    $length = $font->pack(self::$header_format, $this->data);
    177215
    178216    $offset = 0;
     217
     218    /** @var nameRecord[] $records_to_encode */
     219    $records_to_encode = array();
    179220    foreach ($records as $record) {
    180       $record->length = mb_strlen($record->getUTF16(), "8bit");
    181       $record->offset = $offset;
    182       $offset += $record->length;
    183       $length += $font->pack(nameRecord::$format, (array)$record);
    184     }
    185 
    186     foreach ($records as $record) {
     221      $encoded_record = new nameRecord();
     222      $encoded_record->platformID = 3;
     223      $encoded_record->platformSpecificID = 1;
     224      $encoded_record->languageID = $record->languageID;
     225      $encoded_record->nameID = $record->nameID;
     226      $encoded_record->offset = $offset;
     227      $encoded_record->string = $record->string;
     228      $encoded_record->length = mb_strlen($encoded_record->getUTF16(), "8bit");
     229      $records_to_encode[] = $encoded_record;
     230
     231      $offset += $encoded_record->length;
     232      $length += $font->pack(nameRecord::$format, (array)$encoded_record);
     233    }
     234
     235    foreach ($records_to_encode as $record) {
    187236      $str = $record->getUTF16();
    188237      $length += $font->write($str, mb_strlen($str, "8bit"));
  • wpwing-pdf-invoice-packing-slip-for-woocommerce/tags/1.4.1/vendor/phenx/php-font-lib/src/FontLib/Table/Type/nameRecord.php

    r2614294 r3024399  
    22/**
    33 * @package php-font-lib
    4  * @link    https://github.com/PhenX/php-font-lib
     4 * @link    https://github.com/dompdf/php-font-lib
    55 * @author  Fabien Ménager <fabien.menager@gmail.com>
    66 * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
     
    2424  public $offset;
    2525  public $string;
     26  public $stringRaw;
    2627
    2728  public static $format = array(
  • wpwing-pdf-invoice-packing-slip-for-woocommerce/tags/1.4.1/vendor/phenx/php-font-lib/src/FontLib/Table/Type/os2.php

    r2614294 r3024399  
    22/**
    33 * @package php-font-lib
    4  * @link    https://github.com/PhenX/php-font-lib
     4 * @link    https://github.com/dompdf/php-font-lib
    55 * @author  Fabien Ménager <fabien.menager@gmail.com>
    66 * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
  • wpwing-pdf-invoice-packing-slip-for-woocommerce/tags/1.4.1/vendor/phenx/php-font-lib/src/FontLib/Table/Type/post.php

    r2672742 r3024399  
    22/**
    33 * @package php-font-lib
    4  * @link    https://github.com/PhenX/php-font-lib
     4 * @link    https://github.com/dompdf/php-font-lib
    55 * @author  Fabien Ménager <fabien.menager@gmail.com>
    66 * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
  • wpwing-pdf-invoice-packing-slip-for-woocommerce/tags/1.4.1/vendor/phenx/php-font-lib/src/FontLib/TrueType/Collection.php

    r2614294 r3024399  
    22/**
    33 * @package php-font-lib
    4  * @link    https://github.com/PhenX/php-font-lib
     4 * @link    https://github.com/dompdf/php-font-lib
    55 * @author  Fabien Ménager <fabien.menager@gmail.com>
    66 * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
  • wpwing-pdf-invoice-packing-slip-for-woocommerce/tags/1.4.1/vendor/phenx/php-font-lib/src/FontLib/TrueType/File.php

    r2672742 r3024399  
    22/**
    33 * @package php-font-lib
    4  * @link    https://github.com/PhenX/php-font-lib
     4 * @link    https://github.com/dompdf/php-font-lib
    55 * @author  Fabien Ménager <fabien.menager@gmail.com>
    66 * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
     
    102102  );
    103103
     104  private function uniord (string $c, string $encoding = null) {
     105    if (function_exists("mb_ord")) {
     106      if (PHP_VERSION_ID < 80000 && $encoding === null) {
     107          // in PHP < 8 the encoding argument, if supplied, must be a valid encoding
     108          $encoding = "UTF-8";
     109      }
     110      return mb_ord($c, $encoding);
     111    }
     112
     113    if ($encoding != "UTF-8" && $encoding !== null) {
     114      $c = mb_convert_encoding($c, "UTF-8", $encoding);
     115    }
     116
     117    $length = mb_strlen(mb_substr($c, 0, 1), '8bit');
     118    $ord = false;
     119    $bytes = [];
     120    $numbytes = 1;
     121    for ($i = 0; $i < $length; $i++) {
     122      $o = \ord($c[$i]); // get one string character at time
     123      if (\count($bytes) === 0) { // get starting octect
     124        if ($o <= 0x7F) {
     125          $ord = $o;
     126          $numbytes = 1;
     127        } elseif (($o >> 0x05) === 0x06) { // 2 bytes character (0x06 = 110 BIN)
     128          $bytes[] = ($o - 0xC0) << 0x06;
     129          $numbytes = 2;
     130        } elseif (($o >> 0x04) === 0x0E) { // 3 bytes character (0x0E = 1110 BIN)
     131          $bytes[] = ($o - 0xE0) << 0x0C;
     132          $numbytes = 3;
     133        } elseif (($o >> 0x03) === 0x1E) { // 4 bytes character (0x1E = 11110 BIN)
     134          $bytes[] = ($o - 0xF0) << 0x12;
     135          $numbytes = 4;
     136        } else {
     137          $ord = false;
     138          break;
     139        }
     140      } elseif (($o >> 0x06) === 0x02) { // bytes 2, 3 and 4 must start with 0x02 = 10 BIN
     141          $bytes[] = $o - 0x80;
     142          if (\count($bytes) === $numbytes) {
     143            // compose UTF-8 bytes to a single unicode value
     144            $o = $bytes[0];
     145            for ($j = 1; $j < $numbytes; $j++) {
     146              $o += ($bytes[$j] << (($numbytes - $j - 1) * 0x06));
     147            }
     148            if ((($o >= 0xD800) and ($o <= 0xDFFF)) or ($o >= 0x10FFFF)) {
     149              // The definition of UTF-8 prohibits encoding character numbers between
     150              // U+D800 and U+DFFF, which are reserved for use with the UTF-16
     151              // encoding form (as surrogate pairs) and do not directly represent
     152              // characters.
     153              return false;
     154            } else {
     155              $ord = $o; // add char to array
     156            }
     157            // reset data for next char
     158            $bytes = [];
     159            $numbytes = 1;
     160          }
     161      } else {
     162        $ord = false;
     163        break;
     164      }
     165    }
     166
     167    return $ord;
     168  }
     169
    104170  function getTable() {
    105171    $this->parseTableEntries();
     
    158224    $subtable = null;
    159225    foreach ($this->getData("cmap", "subtables") as $_subtable) {
    160       if ($_subtable["platformID"] == 0 || $_subtable["platformID"] == 3 && $_subtable["platformSpecificID"] == 1) {
     226      if ($_subtable["platformID"] == 0 || ($_subtable["platformID"] == 3 && $_subtable["platformSpecificID"] == 1)) {
    161227        $subtable = $_subtable;
    162228        break;
     
    168234    }
    169235
     236    $system_encodings = mb_list_encodings();
     237    $system_encodings = array_change_key_case(array_fill_keys($system_encodings, true), CASE_UPPER);
     238    foreach ($this->getData("cmap", "subtables") as $_subtable) {
     239      $encoding = null;
     240      switch ($_subtable["platformID"]) {
     241        case 3:
     242          switch ($_subtable["platformSpecificID"]) {
     243            case 2:
     244              if (\array_key_exists("SJIS", $system_encodings)) {
     245                $encoding = "SJIS";
     246              }
     247              break;
     248            case 3:
     249              if (\array_key_exists("GB18030", $system_encodings)) {
     250                $encoding = "GB18030";
     251              }
     252              break;
     253            case 4:
     254              if (\array_key_exists("BIG-5", $system_encodings)) {
     255                $encoding = "BIG-5";
     256              }
     257              break;
     258            case 5:
     259              if (\array_key_exists("UHC", $system_encodings)) {
     260                $encoding = "UHC";
     261              }
     262              break;
     263          }
     264          break;
     265      }
     266      if ($encoding) {
     267        $glyphIndexArray = array();
     268        foreach ($_subtable["glyphIndexArray"] as $c => $gid) {
     269          $str = trim(pack("N", $c));
     270          if (\strlen($str) > 0) {
     271            $ord = $this->uniord($str, $encoding);
     272            if ($ord > 0) {
     273              $glyphIndexArray[$ord] = $gid;
     274            }
     275          }
     276        }
     277        return $glyphIndexArray;
     278      }
     279    }
     280   
    170281    return null;
    171282  }
     
    218329  function encode($tags = array()) {
    219330    if (!self::$raw) {
    220       $tags = array_merge(array("head", "hhea", "cmap", "hmtx", "maxp", "glyf", "loca", "name", "post"), $tags);
     331      $tags = array_merge(array("head", "hhea", "cmap", "hmtx", "maxp", "glyf", "loca", "name", "post", "cvt ", "fpgm", "prep"), $tags);
    221332    }
    222333    else {
     
    224335    }
    225336
    226     $num_tables = count($tags);
    227337    $n          = 16; // @todo
    228338
     
    240350    }
    241351
     352    $num_tables = count($entries);
     353    $exponent = floor(log($num_tables, 2));
     354    $power_of_two = pow(2, $exponent);
     355
    242356    $this->header->data["numTables"] = $num_tables;
     357    $this->header->data["searchRange"] = $power_of_two * 16;
     358    $this->header->data["entrySelector"] = log($power_of_two, 2);
     359    $this->header->data["rangeShift"] = $num_tables * 16 - $this->header->data["searchRange"];
    243360    $this->header->encode();
    244361
  • wpwing-pdf-invoice-packing-slip-for-woocommerce/tags/1.4.1/vendor/phenx/php-font-lib/src/FontLib/TrueType/Header.php

    r2614294 r3024399  
    22/**
    33 * @package php-font-lib
    4  * @link    https://github.com/PhenX/php-font-lib
     4 * @link    https://github.com/dompdf/php-font-lib
    55 * @author  Fabien Ménager <fabien.menager@gmail.com>
    66 * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
  • wpwing-pdf-invoice-packing-slip-for-woocommerce/tags/1.4.1/vendor/phenx/php-font-lib/src/FontLib/TrueType/TableDirectoryEntry.php

    r2614294 r3024399  
    22/**
    33 * @package php-font-lib
    4  * @link    https://github.com/PhenX/php-font-lib
     4 * @link    https://github.com/dompdf/php-font-lib
    55 * @author  Fabien Ménager <fabien.menager@gmail.com>
    66 * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
  • wpwing-pdf-invoice-packing-slip-for-woocommerce/tags/1.4.1/vendor/phenx/php-font-lib/src/FontLib/WOFF/File.php

    r2672742 r3024399  
    22/**
    33 * @package php-font-lib
    4  * @link    https://github.com/PhenX/php-font-lib
     4 * @link    https://github.com/dompdf/php-font-lib
    55 * @author  Fabien Ménager <fabien.menager@gmail.com>
    66 * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
  • wpwing-pdf-invoice-packing-slip-for-woocommerce/tags/1.4.1/vendor/phenx/php-font-lib/src/FontLib/WOFF/Header.php

    r2614294 r3024399  
    22/**
    33 * @package php-font-lib
    4  * @link    https://github.com/PhenX/php-font-lib
     4 * @link    https://github.com/dompdf/php-font-lib
    55 * @author  Fabien Ménager <fabien.menager@gmail.com>
    66 * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
  • wpwing-pdf-invoice-packing-slip-for-woocommerce/tags/1.4.1/vendor/phenx/php-font-lib/src/FontLib/WOFF/TableDirectoryEntry.php

    r2614294 r3024399  
    22/**
    33 * @package php-font-lib
    4  * @link    https://github.com/PhenX/php-font-lib
     4 * @link    https://github.com/dompdf/php-font-lib
    55 * @author  Fabien Ménager <fabien.menager@gmail.com>
    66 * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
  • wpwing-pdf-invoice-packing-slip-for-woocommerce/tags/1.4.1/vendor/phenx/php-svg-lib/src/Svg/Document.php

    r2900363 r3024399  
    5353    /** @var \Sabberworm\CSS\CSSList\Document[] */
    5454    protected $styleSheets = array();
     55
     56    public $allowExternalReferences = true;
    5557
    5658    public function loadFile($filename)
  • wpwing-pdf-invoice-packing-slip-for-woocommerce/tags/1.4.1/vendor/phenx/php-svg-lib/src/Svg/Style.php

    r2900363 r3024399  
    139139                        break;
    140140                    }
     141                }
     142
     143                if (
     144                    \array_key_exists("font-family", $styles)
     145                    && (
     146                        \strtolower(\substr($this->href, 0, 7)) === "phar://"
     147                        || ($this->document->allowExternalReferences === false && \strtolower(\substr($this->href, 0, 5)) !== "data:")
     148                    )
     149                ) {
     150                    unset($style["font-family"]);
    141151                }
    142152            }
  • wpwing-pdf-invoice-packing-slip-for-woocommerce/tags/1.4.1/vendor/phenx/php-svg-lib/src/Svg/Tag/Image.php

    r2900363 r3024399  
    5959        $this->document->getSurface()->transform(1, 0, 0, -1, 0, $height);
    6060
     61        if (\strtolower(\substr($this->href, 0, 7)) === "phar://" || ($this->document->allowExternalReferences === false && \strtolower(\substr($this->href, 0, 5) !== "data:"))) {
     62            return;
     63        }
     64
    6165        $this->document->getSurface()->drawImage($this->href, $this->x, $this->y, $this->width, $this->height);
    6266    }
  • wpwing-pdf-invoice-packing-slip-for-woocommerce/tags/1.4.1/vendor/phenx/php-svg-lib/src/Svg/Tag/UseTag.php

    r2900363 r3024399  
    1515    protected $width;
    1616    protected $height;
     17    protected $instances = 0;
    1718
    1819    /** @var AbstractTag */
     
    2122    protected function before($attributes)
    2223    {
     24        $this->instances++;
     25        if ($this->instances > 1) {
     26            //TODO: log circular reference error state
     27            return;
     28        }
     29
    2330        if (isset($attributes['x'])) {
    2431            $this->x = $attributes['x'];
     
    5360
    5461    protected function after() {
     62        if ($this->instances > 0) {
     63            return;
     64        }
    5565        parent::after();
    5666
     
    6474    public function handle($attributes)
    6575    {
     76        if ($this->instances > 1) {
     77            //TODO: log circular reference error state
     78            return;
     79        }
     80
    6681        parent::handle($attributes);
    6782
     
    7186
    7287        $mergedAttributes = $this->reference->attributes;
    73         $attributesToNotMerge = ['x', 'y', 'width', 'height'];
     88        $attributesToNotMerge = ['x', 'y', 'width', 'height', 'href', 'xlink:href', 'id'];
    7489        foreach ($attributes as $attrKey => $attrVal) {
    7590            if (!in_array($attrKey, $attributesToNotMerge) && !isset($mergedAttributes[$attrKey])) {
     
    88103    public function handleEnd()
    89104    {
     105        $this->instances--;
     106        if ($this->instances > 0) {
     107            return;
     108        }
     109
    90110        parent::handleEnd();
    91111
  • wpwing-pdf-invoice-packing-slip-for-woocommerce/tags/1.4.1/wpwing-pdf-invoice-packing-slip-for-woocommerce.php

    r2927383 r3024399  
    55 * Plugin URI:            https://wpwing.com/
    66 * Description:           Download your WooCommerce order invoice and packing slip as PDF format for print or email.
    7  * Version:               1.4.0
     7 * Version:               1.4.1
    88 * Author:                WPWing
    99 * Author URI:            https://wpwing.com/
    1010 * Requires PHP:          7.1
    1111 * Requires at least:     4.8
    12  * Tested up to:          6.2
     12 * Tested up to:          6.4
    1313 * WC requires at least:  4.5
    14  * WC tested up to:       7.8
     14 * WC tested up to:       8.5
    1515 * License:               GPL-3.0-or-later
    1616 * License URI:           https://www.gnu.org/licenses/gpl-3.0.html
  • wpwing-pdf-invoice-packing-slip-for-woocommerce/trunk/readme.txt

    r2927383 r3024399  
    55Tags:               PDF, Invoice, Packing Slip, Packing List, Proforma Invoice, Delivery Notes, Shipping Labels, WooCommerce, WPWing
    66Requires at least:  4.8
    7 Tested up to:       6.2
     7Tested up to:       6.4
    88Requires PHP:       7.1
    9 Stable tag:         1.4.0
     9Stable tag:         1.4.1
    1010License:            GPL-3.0-or-later
    1111License URI:        https://www.gnu.org/licenses/gpl-3.0.html
    1212
    13 Want to print your WooCommerce order invoice or packing slip? Or download them in PDF format? You are in the right place! With WooCommerce you will feel the lacking of print invoices or packing lists, which we are happy to fulfill. **WPWing PDF Invoice and Packing Slip for WooCommerce** can download your WooCommerce order invoice and packing slip in PDF format for print or email.
     13Want to print your WooCommerce order invoice or packing slip? Or download them in PDF format? You are in the right place! With WooCommerce you will feel the lack of print invoices or packing lists, which we are happy to fulfill. **WPWing PDF Invoice and Packing Slip for WooCommerce** can download your WooCommerce order invoice and packing slip in PDF format for print or email.
    1414
    1515
     
    1818= Must have plugin for WooCommerce with tremendous support =
    1919
    20 Want to print your WooCommerce order invoice or packing slip? Or download them in PDF format? You are in the right place! With WooCommerce you will feel the lacking of print invoices or packing lists, which we are happy to fulfill. **WPWing PDF Invoice and Packing Slip for WooCommerce** can download your WooCommerce order invoice and packing slip in PDF format for print or email.
     20Want to print your WooCommerce order invoice or packing slip? Or download them in PDF format? You are in the right place! With WooCommerce you will feel the lack of print invoices or packing lists, which we are happy to fulfill. **WPWing PDF Invoice and Packing Slip for WooCommerce** can download your WooCommerce order invoice and packing slip in PDF format for print or email.
    2121
    22 ✅ Tested OK with WooCommerce 6.5
     22✅ Tested OK with WooCommerce 8.5
    2323
    2424### 🔥 FEATURES: ###
     
    7373== Changelog ==
    7474
     75= 1.4.1 - 20/01/2024
     76
     77* Update: DOM PDF version 2.0.4
     78* Compatibility check with WP's latest version.
     79* Compatibility check with WC's latest version.
     80* Few minor improvements.
     81
    7582= 1.4.0 - 17/06/2023
    7683
    77 * Update: Remove WPWing prefix from plugin name
     84* Update: Remove WPWing prefix from the plugin name
    7885* Update: Invoice and Packing slip open in new tab
    7986* Few minor improvements.
  • wpwing-pdf-invoice-packing-slip-for-woocommerce/trunk/vendor/autoload.php

    r2900363 r3024399  
    55require_once __DIR__ . '/composer/autoload_real.php';
    66
    7 return ComposerAutoloaderInit02775e21763226d85a226d55c9acfc98::getLoader();
     7return ComposerAutoloaderInitbf78a1f8678d210391362580614bce81::getLoader();
  • wpwing-pdf-invoice-packing-slip-for-woocommerce/trunk/vendor/composer/autoload_real.php

    r2900363 r3024399  
    33// autoload_real.php @generated by Composer
    44
    5 class ComposerAutoloaderInit02775e21763226d85a226d55c9acfc98
     5class ComposerAutoloaderInitbf78a1f8678d210391362580614bce81
    66{
    77    private static $loader;
     
    2525        require __DIR__ . '/platform_check.php';
    2626
    27         spl_autoload_register(array('ComposerAutoloaderInit02775e21763226d85a226d55c9acfc98', 'loadClassLoader'), true, true);
     27        spl_autoload_register(array('ComposerAutoloaderInitbf78a1f8678d210391362580614bce81', 'loadClassLoader'), true, true);
    2828        self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
    29         spl_autoload_unregister(array('ComposerAutoloaderInit02775e21763226d85a226d55c9acfc98', 'loadClassLoader'));
     29        spl_autoload_unregister(array('ComposerAutoloaderInitbf78a1f8678d210391362580614bce81', 'loadClassLoader'));
    3030
    3131        $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
     
    3333            require __DIR__ . '/autoload_static.php';
    3434
    35             call_user_func(\Composer\Autoload\ComposerStaticInit02775e21763226d85a226d55c9acfc98::getInitializer($loader));
     35            call_user_func(\Composer\Autoload\ComposerStaticInitbf78a1f8678d210391362580614bce81::getInitializer($loader));
    3636        } else {
    3737            $map = require __DIR__ . '/autoload_namespaces.php';
  • wpwing-pdf-invoice-packing-slip-for-woocommerce/trunk/vendor/composer/autoload_static.php

    r2900363 r3024399  
    55namespace Composer\Autoload;
    66
    7 class ComposerStaticInit02775e21763226d85a226d55c9acfc98
     7class ComposerStaticInitbf78a1f8678d210391362580614bce81
    88{
    99    public static $prefixLengthsPsr4 = array (
     
    5858    {
    5959        return \Closure::bind(function () use ($loader) {
    60             $loader->prefixLengthsPsr4 = ComposerStaticInit02775e21763226d85a226d55c9acfc98::$prefixLengthsPsr4;
    61             $loader->prefixDirsPsr4 = ComposerStaticInit02775e21763226d85a226d55c9acfc98::$prefixDirsPsr4;
    62             $loader->classMap = ComposerStaticInit02775e21763226d85a226d55c9acfc98::$classMap;
     60            $loader->prefixLengthsPsr4 = ComposerStaticInitbf78a1f8678d210391362580614bce81::$prefixLengthsPsr4;
     61            $loader->prefixDirsPsr4 = ComposerStaticInitbf78a1f8678d210391362580614bce81::$prefixDirsPsr4;
     62            $loader->classMap = ComposerStaticInitbf78a1f8678d210391362580614bce81::$classMap;
    6363
    6464        }, null, ClassLoader::class);
  • wpwing-pdf-invoice-packing-slip-for-woocommerce/trunk/vendor/composer/installed.json

    r2900363 r3024399  
    33        {
    44            "name": "dompdf/dompdf",
    5             "version": "v2.0.3",
    6             "version_normalized": "2.0.3.0",
     5            "version": "v2.0.4",
     6            "version_normalized": "2.0.4.0",
    77            "source": {
    88                "type": "git",
    99                "url": "https://github.com/dompdf/dompdf.git",
    10                 "reference": "e8d2d5e37e8b0b30f0732a011295ab80680d7e85"
    11             },
    12             "dist": {
    13                 "type": "zip",
    14                 "url": "https://api.github.com/repos/dompdf/dompdf/zipball/e8d2d5e37e8b0b30f0732a011295ab80680d7e85",
    15                 "reference": "e8d2d5e37e8b0b30f0732a011295ab80680d7e85",
     10                "reference": "093f2d9739cec57428e39ddadedfd4f3ae862c0f"
     11            },
     12            "dist": {
     13                "type": "zip",
     14                "url": "https://api.github.com/repos/dompdf/dompdf/zipball/093f2d9739cec57428e39ddadedfd4f3ae862c0f",
     15                "reference": "093f2d9739cec57428e39ddadedfd4f3ae862c0f",
    1616                "shasum": ""
    1717            },
     
    3737                "ext-zlib": "Needed for pdf stream compression"
    3838            },
    39             "time": "2023-02-07T12:51:48+00:00",
     39            "time": "2023-12-12T20:19:39+00:00",
    4040            "type": "library",
    4141            "installation-source": "dist",
     
    6262            "support": {
    6363                "issues": "https://github.com/dompdf/dompdf/issues",
    64                 "source": "https://github.com/dompdf/dompdf/tree/v2.0.3"
     64                "source": "https://github.com/dompdf/dompdf/tree/v2.0.4"
    6565            },
    6666            "install-path": "../dompdf/dompdf"
     
    6868        {
    6969            "name": "masterminds/html5",
    70             "version": "2.7.6",
    71             "version_normalized": "2.7.6.0",
     70            "version": "2.8.1",
     71            "version_normalized": "2.8.1.0",
    7272            "source": {
    7373                "type": "git",
    7474                "url": "https://github.com/Masterminds/html5-php.git",
    75                 "reference": "897eb517a343a2281f11bc5556d6548db7d93947"
    76             },
    77             "dist": {
    78                 "type": "zip",
    79                 "url": "https://api.github.com/repos/Masterminds/html5-php/zipball/897eb517a343a2281f11bc5556d6548db7d93947",
    80                 "reference": "897eb517a343a2281f11bc5556d6548db7d93947",
    81                 "shasum": ""
    82             },
    83             "require": {
    84                 "ext-ctype": "*",
     75                "reference": "f47dcf3c70c584de14f21143c55d9939631bc6cf"
     76            },
     77            "dist": {
     78                "type": "zip",
     79                "url": "https://api.github.com/repos/Masterminds/html5-php/zipball/f47dcf3c70c584de14f21143c55d9939631bc6cf",
     80                "reference": "f47dcf3c70c584de14f21143c55d9939631bc6cf",
     81                "shasum": ""
     82            },
     83            "require": {
    8584                "ext-dom": "*",
    86                 "ext-libxml": "*",
    8785                "php": ">=5.3.0"
    8886            },
    8987            "require-dev": {
    90                 "phpunit/phpunit": "^4.8.35 || ^5.7.21 || ^6 || ^7"
    91             },
    92             "time": "2022-08-18T16:18:26+00:00",
     88                "phpunit/phpunit": "^4.8.35 || ^5.7.21 || ^6 || ^7 || ^8"
     89            },
     90            "time": "2023-05-10T11:58:31+00:00",
    9391            "type": "library",
    9492            "extra": {
     
    134132            "support": {
    135133                "issues": "https://github.com/Masterminds/html5-php/issues",
    136                 "source": "https://github.com/Masterminds/html5-php/tree/2.7.6"
     134                "source": "https://github.com/Masterminds/html5-php/tree/2.8.1"
    137135            },
    138136            "install-path": "../masterminds/html5"
     
    140138        {
    141139            "name": "phenx/php-font-lib",
    142             "version": "0.5.4",
    143             "version_normalized": "0.5.4.0",
     140            "version": "0.5.5",
     141            "version_normalized": "0.5.5.0",
    144142            "source": {
    145143                "type": "git",
    146144                "url": "https://github.com/dompdf/php-font-lib.git",
    147                 "reference": "dd448ad1ce34c63d09baccd05415e361300c35b4"
    148             },
    149             "dist": {
    150                 "type": "zip",
    151                 "url": "https://api.github.com/repos/dompdf/php-font-lib/zipball/dd448ad1ce34c63d09baccd05415e361300c35b4",
    152                 "reference": "dd448ad1ce34c63d09baccd05415e361300c35b4",
     145                "reference": "671df0f3516252011aa94f9e8e3b3b66199339f8"
     146            },
     147            "dist": {
     148                "type": "zip",
     149                "url": "https://api.github.com/repos/dompdf/php-font-lib/zipball/671df0f3516252011aa94f9e8e3b3b66199339f8",
     150                "reference": "671df0f3516252011aa94f9e8e3b3b66199339f8",
    153151                "shasum": ""
    154152            },
     
    157155            },
    158156            "require-dev": {
    159                 "symfony/phpunit-bridge": "^3 || ^4 || ^5"
    160             },
    161             "time": "2021-12-17T19:44:54+00:00",
     157                "symfony/phpunit-bridge": "^3 || ^4 || ^5 || ^6"
     158            },
     159            "time": "2024-01-07T18:13:29+00:00",
    162160            "type": "library",
    163161            "installation-source": "dist",
     
    169167            "notification-url": "https://packagist.org/downloads/",
    170168            "license": [
    171                 "LGPL-3.0"
     169                "LGPL-2.1-or-later"
    172170            ],
    173171            "authors": [
     
    181179            "support": {
    182180                "issues": "https://github.com/dompdf/php-font-lib/issues",
    183                 "source": "https://github.com/dompdf/php-font-lib/tree/0.5.4"
     181                "source": "https://github.com/dompdf/php-font-lib/tree/0.5.5"
    184182            },
    185183            "install-path": "../phenx/php-font-lib"
     
    187185        {
    188186            "name": "phenx/php-svg-lib",
    189             "version": "0.5.0",
    190             "version_normalized": "0.5.0.0",
     187            "version": "0.5.1",
     188            "version_normalized": "0.5.1.0",
    191189            "source": {
    192190                "type": "git",
    193191                "url": "https://github.com/dompdf/php-svg-lib.git",
    194                 "reference": "76876c6cf3080bcb6f249d7d59705108166a6685"
    195             },
    196             "dist": {
    197                 "type": "zip",
    198                 "url": "https://api.github.com/repos/dompdf/php-svg-lib/zipball/76876c6cf3080bcb6f249d7d59705108166a6685",
    199                 "reference": "76876c6cf3080bcb6f249d7d59705108166a6685",
     192                "reference": "8a8a1ebcf6aea861ef30197999f096f7bd4b4456"
     193            },
     194            "dist": {
     195                "type": "zip",
     196                "url": "https://api.github.com/repos/dompdf/php-svg-lib/zipball/8a8a1ebcf6aea861ef30197999f096f7bd4b4456",
     197                "reference": "8a8a1ebcf6aea861ef30197999f096f7bd4b4456",
    200198                "shasum": ""
    201199            },
     
    208206                "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5"
    209207            },
    210             "time": "2022-09-06T12:16:56+00:00",
     208            "time": "2023-12-11T20:56:08+00:00",
    211209            "type": "library",
    212210            "installation-source": "dist",
     
    230228            "support": {
    231229                "issues": "https://github.com/dompdf/php-svg-lib/issues",
    232                 "source": "https://github.com/dompdf/php-svg-lib/tree/0.5.0"
     230                "source": "https://github.com/dompdf/php-svg-lib/tree/0.5.1"
    233231            },
    234232            "install-path": "../phenx/php-svg-lib"
  • wpwing-pdf-invoice-packing-slip-for-woocommerce/trunk/vendor/composer/installed.php

    r2927383 r3024399  
    66        'install_path' => __DIR__ . '/../../',
    77        'aliases' => array(),
    8         'reference' => '73e7da86a1b51ee4c3594d66d3281f361cd3753d',
     8        'reference' => 'feb79eda7375cc2bdf54e38dc5c640dd62a0b663',
    99        'name' => '__root__',
    1010        'dev' => true,
     
    1717            'install_path' => __DIR__ . '/../../',
    1818            'aliases' => array(),
    19             'reference' => '73e7da86a1b51ee4c3594d66d3281f361cd3753d',
     19            'reference' => 'feb79eda7375cc2bdf54e38dc5c640dd62a0b663',
    2020            'dev_requirement' => false,
    2121        ),
    2222        'dompdf/dompdf' => array(
    23             'pretty_version' => 'v2.0.3',
    24             'version' => '2.0.3.0',
     23            'pretty_version' => 'v2.0.4',
     24            'version' => '2.0.4.0',
    2525            'type' => 'library',
    2626            'install_path' => __DIR__ . '/../dompdf/dompdf',
    2727            'aliases' => array(),
    28             'reference' => 'e8d2d5e37e8b0b30f0732a011295ab80680d7e85',
     28            'reference' => '093f2d9739cec57428e39ddadedfd4f3ae862c0f',
    2929            'dev_requirement' => false,
    3030        ),
    3131        'masterminds/html5' => array(
    32             'pretty_version' => '2.7.6',
    33             'version' => '2.7.6.0',
     32            'pretty_version' => '2.8.1',
     33            'version' => '2.8.1.0',
    3434            'type' => 'library',
    3535            'install_path' => __DIR__ . '/../masterminds/html5',
    3636            'aliases' => array(),
    37             'reference' => '897eb517a343a2281f11bc5556d6548db7d93947',
     37            'reference' => 'f47dcf3c70c584de14f21143c55d9939631bc6cf',
    3838            'dev_requirement' => false,
    3939        ),
    4040        'phenx/php-font-lib' => array(
    41             'pretty_version' => '0.5.4',
    42             'version' => '0.5.4.0',
     41            'pretty_version' => '0.5.5',
     42            'version' => '0.5.5.0',
    4343            'type' => 'library',
    4444            'install_path' => __DIR__ . '/../phenx/php-font-lib',
    4545            'aliases' => array(),
    46             'reference' => 'dd448ad1ce34c63d09baccd05415e361300c35b4',
     46            'reference' => '671df0f3516252011aa94f9e8e3b3b66199339f8',
    4747            'dev_requirement' => false,
    4848        ),
    4949        'phenx/php-svg-lib' => array(
    50             'pretty_version' => '0.5.0',
    51             'version' => '0.5.0.0',
     50            'pretty_version' => '0.5.1',
     51            'version' => '0.5.1.0',
    5252            'type' => 'library',
    5353            'install_path' => __DIR__ . '/../phenx/php-svg-lib',
    5454            'aliases' => array(),
    55             'reference' => '76876c6cf3080bcb6f249d7d59705108166a6685',
     55            'reference' => '8a8a1ebcf6aea861ef30197999f096f7bd4b4456',
    5656            'dev_requirement' => false,
    5757        ),
  • wpwing-pdf-invoice-packing-slip-for-woocommerce/trunk/vendor/dompdf/dompdf/VERSION

    r2900363 r3024399  
    1 2.0.3
     12.0.4
  • wpwing-pdf-invoice-packing-slip-for-woocommerce/trunk/vendor/dompdf/dompdf/src/Image/Cache.php

    r2900363 r3024399  
    3333
    3434    /**
     35     * Array of image references from an SVG document.
     36     * Used to detect circular references across SVG documents.
     37     *
     38     * @var array
     39     */
     40    protected static $svgRefs = [];
     41
     42    /**
    3543     * The url to the "broken image" used when images can't be loaded
    3644     *
     
    135143                    function ($parser, $name, $attributes) use ($options, $parsed_url, $full_url) {
    136144                        if (strtolower($name) === "image") {
     145                            if (!\array_key_exists($full_url, self::$svgRefs)) {
     146                                self::$svgRefs[$full_url] = [];
     147                            }
    137148                            $attributes = array_change_key_case($attributes, CASE_LOWER);
    138149                            $urls = [];
     
    140151                            $urls[] = $attributes["href"] ?? "";
    141152                            foreach ($urls as $url) {
    142                                 if (!empty($url)) {
    143                                     $inner_full_url = Helpers::build_url($parsed_url["protocol"], $parsed_url["host"], $parsed_url["path"], $url);
    144                                     if ($inner_full_url === $full_url) {
    145                                         throw new ImageException("SVG self-reference is not allowed", E_WARNING);
    146                                     }
    147                                     [$resolved_url, $type, $message] = self::resolve_url($url, $parsed_url["protocol"], $parsed_url["host"], $parsed_url["path"], $options);
    148                                     if (!empty($message)) {
    149                                         throw new ImageException("This SVG document references a restricted resource. $message", E_WARNING);
    150                                     }
     153                                if (empty($url)) {
     154                                    continue;
     155                                }
     156
     157                                $inner_full_url = Helpers::build_url($parsed_url["protocol"], $parsed_url["host"], $parsed_url["path"], $url);
     158                                if (empty($inner_full_url)) {
     159                                    continue;
     160                                }
     161                               
     162                                self::detectCircularRef($full_url, $inner_full_url);
     163                                self::$svgRefs[$full_url][] = $inner_full_url;
     164                                [$resolved_url, $type, $message] = self::resolve_url($url, $parsed_url["protocol"], $parsed_url["host"], $parsed_url["path"], $options);
     165                                if (!empty($message)) {
     166                                    throw new ImageException("This SVG document references a restricted resource. $message", E_WARNING);
    151167                                }
    152168                            }
     
    179195    }
    180196
     197    static function detectCircularRef(string $src, string $target)
     198    {
     199        if (!\array_key_exists($target, self::$svgRefs)) {
     200            return;
     201        }
     202        foreach (self::$svgRefs[$target] as $ref) {
     203            if ($ref === $src) {
     204                throw new ImageException("Circular external SVG image reference detected.", E_WARNING);
     205            }
     206            self::detectCircularRef($src, $ref);
     207        }
     208    }
     209
    181210    /**
    182211     * Register a temp file for the given original image file.
     
    240269        self::$_cache = [];
    241270        self::$tempImages = [];
     271        self::$svgRefs = [];
    242272    }
    243273
  • wpwing-pdf-invoice-packing-slip-for-woocommerce/trunk/vendor/masterminds/html5/README.md

    r2900365 r3024399  
    190190  interpreter. While one may be supplied, not all features will be
    191191  supported.
    192 - Rentrance: The current parser is not re-entrant. (Thus you can't pause
     192- Reentrance: The current parser is not re-entrant. (Thus you can't pause
    193193  the parser to modify the HTML string mid-parse.)
    194194- Validation: The current tree builder is **not** a validating parser.
  • wpwing-pdf-invoice-packing-slip-for-woocommerce/trunk/vendor/masterminds/html5/composer.json

    r2900365 r3024399  
    2121    ],
    2222    "require" : {
    23         "ext-ctype": "*",
    2423        "ext-dom": "*",
    25         "ext-libxml" : "*",
    2624        "php" : ">=5.3.0"
    2725    },
    2826    "require-dev": {
    29         "phpunit/phpunit" : "^4.8.35 || ^5.7.21 || ^6 || ^7"
     27        "phpunit/phpunit" : "^4.8.35 || ^5.7.21 || ^6 || ^7 || ^8"
    3028    },
    3129    "autoload": {
  • wpwing-pdf-invoice-packing-slip-for-woocommerce/trunk/vendor/masterminds/html5/src/HTML5/Elements.php

    r2900365 r3024399  
    186186        'ul' => 81, // NORMAL | AUTOCLOSE_P | BLOCK_TAG
    187187        'var' => 1,
    188         'video' => 65, // NORMAL | BLOCK_TAG
     188        'video' => 1,
    189189        'wbr' => 9, // NORMAL | VOID_TAG
    190190
  • wpwing-pdf-invoice-packing-slip-for-woocommerce/trunk/vendor/masterminds/html5/src/HTML5/Parser/Tokenizer.php

    r2900365 r3024399  
    132132            $tok = $this->scanner->next();
    133133
    134             if ('!' === $tok) {
     134            if (false === $tok) {
     135                // end of string
     136                $this->parseError('Illegal tag opening');
     137            } elseif ('!' === $tok) {
    135138                $this->markupDeclaration();
    136139            } elseif ('/' === $tok) {
     
    138141            } elseif ('?' === $tok) {
    139142                $this->processingInstruction();
    140             } elseif (ctype_alpha($tok)) {
     143            } elseif ($this->is_alpha($tok)) {
    141144                $this->tagName();
    142145            } else {
     
    348351        // EOF -> parse error
    349352        // -> parse error
    350         if (!ctype_alpha($tok)) {
     353        if (!$this->is_alpha($tok)) {
    351354            $this->parseError("Expected tag name, got '%s'", $tok);
    352355            if ("\0" == $tok || false === $tok) {
     
    11951198        return '&';
    11961199    }
     1200
     1201    /**
     1202     * Checks whether a (single-byte) character is an ASCII letter or not.
     1203     *
     1204     * @param string $input A single-byte string
     1205     *
     1206     * @return bool True if it is a letter, False otherwise
     1207     */
     1208    protected function is_alpha($input)
     1209    {
     1210        $code = ord($input);
     1211
     1212        return ($code >= 97 && $code <= 122) || ($code >= 65 && $code <= 90);
     1213    }
    11971214}
  • wpwing-pdf-invoice-packing-slip-for-woocommerce/trunk/vendor/masterminds/html5/src/HTML5/Parser/UTF8Utils.php

    r2900365 r3024399  
    3939    /**
    4040     * Count the number of characters in a string.
    41      * UTF-8 aware. This will try (in order) iconv, MB, libxml, and finally a custom counter.
     41     * UTF-8 aware. This will try (in order) iconv, MB, and finally a custom counter.
    4242     *
    4343     * @param string $string
     
    5454        if (function_exists('iconv_strlen')) {
    5555            return iconv_strlen($string, 'utf-8');
    56         }
    57 
    58         if (function_exists('utf8_decode')) {
    59             // MPB: Will this work? Won't certain decodes lead to two chars
    60             // extrapolated out of 2-byte chars?
    61             return strlen(utf8_decode($string));
    6256        }
    6357
  • wpwing-pdf-invoice-packing-slip-for-woocommerce/trunk/vendor/phenx/php-font-lib/README.md

    r2672742 r3024399  
    99 * Make an Adobe Font Metrics (AFM) file from a font
    1010
    11 You can find a demo GUI [here](http://pxd.me/php-font-lib/www/font_explorer.html).
    12 
    1311This project was initiated by the need to read font files in the [DOMPDF project](https://github.com/dompdf/dompdf).
    1412
     
    1614-------------
    1715
    18 ```
    19 $font = \FontLib\Font::load('../../fontfile.ttf');
     16### Base font information
     17
     18```php
     19$font = \FontLib\Font::load('fontfile.ttf');
    2020$font->parse();  // for getFontWeight() to work this call must be done first!
    2121echo $font->getFontName() .'<br>';
     
    2626echo $font->getFontWeight() .'<br>';
    2727echo $font->getFontPostscriptName() .'<br>';
     28$font->close();
    2829```
     30
     31### Font Metrics Generation
     32
     33```php
     34$font = FontLib\Font::load('fontfile.ttf');
     35$font->parse();
     36$font->saveAdobeFontMetrics('fontfile.ufm');
     37```
     38
     39### Create a font subset
     40
     41```php
     42$font = FontLib\Font::load('fontfile.ttf');
     43$font->parse();
     44$font->setSubset("abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ.:,;' (!?)+-*/== 1234567890"); // characters to include
     45$font->reduce();
     46touch('fontfile.subset.ttf');
     47$font->open('fontfile.subset.ttf', FontLib\BinaryStream::modeReadWrite);
     48$font->encode(array("OS/2"));
     49$font->close();
     50```
  • wpwing-pdf-invoice-packing-slip-for-woocommerce/trunk/vendor/phenx/php-font-lib/composer.json

    r2672742 r3024399  
    44    "description": "A library to read, parse, export and make subsets of different types of font files.",
    55    "homepage": "https://github.com/PhenX/php-font-lib",
    6     "license": "LGPL-3.0",
     6    "license": "LGPL-2.1-or-later",
    77    "authors": [
    88        {
     
    2828    },
    2929    "require-dev": {
    30         "symfony/phpunit-bridge" : "^3 || ^4 || ^5"
     30        "symfony/phpunit-bridge" : "^3 || ^4 || ^5 || ^6"
    3131    }
    3232}
  • wpwing-pdf-invoice-packing-slip-for-woocommerce/trunk/vendor/phenx/php-font-lib/src/FontLib/AdobeFontMetrics.php

    r2672742 r3024399  
    22/**
    33 * @package php-font-lib
    4  * @link    https://github.com/PhenX/php-font-lib
     4 * @link    https://github.com/dompdf/php-font-lib
    55 * @author  Fabien Ménager <fabien.menager@gmail.com>
    66 * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
     
    4949    $this->startSection("FontMetrics", 4.1);
    5050    $this->addPair("Notice", "Converted by PHP-font-lib");
    51     $this->addPair("Comment", "https://github.com/PhenX/php-font-lib");
     51    $this->addPair("Comment", "https://github.com/dompdf/php-font-lib");
    5252
    5353    $encoding_scheme = ($encoding ? $encoding : "FontSpecific");
     
    7676    if (isset($hhea["ascent"])) {
    7777      $this->addPair("FontHeightOffset", $font->normalizeFUnit($hhea["lineGap"]));
    78       $this->addPair("Ascender", $font->normalizeFUnit($hhea["ascent"]));
    79       $this->addPair("Descender", $font->normalizeFUnit($hhea["descent"]));
    8078    }
    8179    else {
    8280      $this->addPair("FontHeightOffset", $font->normalizeFUnit($os2["typoLineGap"]));
     81    }
     82
     83    $glyf = $font->getData("glyf");
     84    $glyphIndexArray = $font->getUnicodeCharMap();
     85
     86    // capHeight is based on capital H
     87    if (\array_key_exists(72, $glyphIndexArray)) {
     88      $upperH = $glyf[$glyphIndexArray[72]];
     89      $upperH->parseData();
     90      $this->addPair("CapHeight", $font->normalizeFUnit($upperH->yMax));
     91    }
     92
     93    // xHeight is based on lowercase x
     94    if (\array_key_exists(120, $glyphIndexArray)) {
     95      $lowerX = $glyf[$glyphIndexArray[120]];
     96      $lowerX->parseData();
     97      $this->addPair("XHeight", $font->normalizeFUnit($lowerX->yMax));
     98    }
     99
     100    // ascender is based on lowercase d
     101    if (\array_key_exists(100, $glyphIndexArray)) {
     102      $lowerD = $glyf[$glyphIndexArray[100]];
     103      $lowerD->parseData();
     104      $this->addPair("Ascender", $font->normalizeFUnit($lowerD->yMax));
     105    } elseif (isset($hhea["ascent"])) {
     106      $this->addPair("Ascender", $font->normalizeFUnit($hhea["ascent"]));
     107    }
     108    else {
    83109      $this->addPair("Ascender", $font->normalizeFUnit($os2["typoAscender"]));
     110    }
     111
     112    // descender is based on lowercase p
     113    if (\array_key_exists(112, $glyphIndexArray)) {
     114      $lowerP = $glyf[$glyphIndexArray[112]];
     115      $lowerP->parseData();
     116      $this->addPair("Descender", $font->normalizeFUnit($lowerP->yMin));
     117    } elseif (isset($hhea["ascent"])) {
     118      $this->addPair("Descender", $font->normalizeFUnit($hhea["descent"]));
     119    }
     120    else {
    84121      $this->addPair("Descender", -abs($font->normalizeFUnit($os2["typoDescender"])));
    85122    }
     
    93130    ));
    94131
    95     $glyphIndexArray = $font->getUnicodeCharMap();
    96 
    97132    if ($glyphIndexArray) {
    98133      $hmtx  = $font->getData("hmtx");
  • wpwing-pdf-invoice-packing-slip-for-woocommerce/trunk/vendor/phenx/php-font-lib/src/FontLib/BinaryStream.php

    r2672742 r3024399  
    22/**
    33 * @package php-font-lib
    4  * @link    https://github.com/PhenX/php-font-lib
     4 * @link    https://github.com/dompdf/php-font-lib
    55 * @author  Fabien Ménager <fabien.menager@gmail.com>
    66 * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
  • wpwing-pdf-invoice-packing-slip-for-woocommerce/trunk/vendor/phenx/php-font-lib/src/FontLib/EOT/File.php

    r2672742 r3024399  
    22/**
    33 * @package php-font-lib
    4  * @link    https://github.com/PhenX/php-font-lib
     4 * @link    https://github.com/dompdf/php-font-lib
    55 * @author  Fabien Ménager <fabien.menager@gmail.com>
    66 * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
  • wpwing-pdf-invoice-packing-slip-for-woocommerce/trunk/vendor/phenx/php-font-lib/src/FontLib/EOT/Header.php

    r2614294 r3024399  
    22/**
    33 * @package php-font-lib
    4  * @link    https://github.com/PhenX/php-font-lib
     4 * @link    https://github.com/dompdf/php-font-lib
    55 * @author  Fabien Ménager <fabien.menager@gmail.com>
    66 * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
  • wpwing-pdf-invoice-packing-slip-for-woocommerce/trunk/vendor/phenx/php-font-lib/src/FontLib/EncodingMap.php

    r2614294 r3024399  
    22/**
    33 * @package php-font-lib
    4  * @link    https://github.com/PhenX/php-font-lib
     4 * @link    https://github.com/dompdf/php-font-lib
    55 * @author  Fabien Ménager <fabien.menager@gmail.com>
    66 * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
  • wpwing-pdf-invoice-packing-slip-for-woocommerce/trunk/vendor/phenx/php-font-lib/src/FontLib/Font.php

    r2672742 r3024399  
    22/**
    33 * @package php-font-lib
    4  * @link    https://github.com/PhenX/php-font-lib
     4 * @link    https://github.com/dompdf/php-font-lib
    55 * @author  Fabien Ménager <fabien.menager@gmail.com>
    66 * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
  • wpwing-pdf-invoice-packing-slip-for-woocommerce/trunk/vendor/phenx/php-font-lib/src/FontLib/Glyph/Outline.php

    r2672742 r3024399  
    22/**
    33 * @package php-font-lib
    4  * @link    https://github.com/PhenX/php-font-lib
     4 * @link    https://github.com/dompdf/php-font-lib
    55 * @author  Fabien Ménager <fabien.menager@gmail.com>
    66 * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
     
    4949    $font->seek($offset);
    5050
    51     if ($font->readInt16() > -1) {
     51    if ($size === 0 || $font->readInt16() > -1) {
    5252      /** @var OutlineSimple $glyph */
    5353      $glyph = new OutlineSimple($table, $offset, $size);
  • wpwing-pdf-invoice-packing-slip-for-woocommerce/trunk/vendor/phenx/php-font-lib/src/FontLib/Glyph/OutlineComponent.php

    r2614294 r3024399  
    22/**
    33 * @package php-font-lib
    4  * @link    https://github.com/PhenX/php-font-lib
     4 * @link    https://github.com/dompdf/php-font-lib
    55 * @author  Fabien Ménager <fabien.menager@gmail.com>
    66 * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
  • wpwing-pdf-invoice-packing-slip-for-woocommerce/trunk/vendor/phenx/php-font-lib/src/FontLib/Glyph/OutlineComposite.php

    r2614294 r3024399  
    22/**
    33 * @package php-font-lib
    4  * @link    https://github.com/PhenX/php-font-lib
     4 * @link    https://github.com/dompdf/php-font-lib
    55 * @author  Fabien Ménager <fabien.menager@gmail.com>
    66 * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
     
    130130      $this->components[] = $component;
    131131    } while ($flags & self::MORE_COMPONENTS);
     132    if ($flags & self::WE_HAVE_INSTRUCTIONS) {
     133      $numInstr = $font->readUInt16();
     134      $instr = $font->read($numInstr);
     135      $this->components[count($this->components) - 1]->instructions = pack('n', $numInstr) . $instr;
     136    }
    132137  }
    133138
     
    172177      if ($_i < count($this->components) - 1) {
    173178        $flags |= self::MORE_COMPONENTS;
     179      } elseif($_component->instructions !== null) {
     180        $flags |= self::WE_HAVE_INSTRUCTIONS;
    174181      }
    175182
     
    215222    }
    216223
     224    if($_component->instructions !== null) {
     225      $size += $font->write($_component->instructions, strlen($_component->instructions));
     226    }
     227
    217228    return $size;
    218229  }
  • wpwing-pdf-invoice-packing-slip-for-woocommerce/trunk/vendor/phenx/php-font-lib/src/FontLib/Glyph/OutlineSimple.php

    r2672742 r3024399  
    22/**
    33 * @package php-font-lib
    4  * @link    https://github.com/PhenX/php-font-lib
     4 * @link    https://github.com/dompdf/php-font-lib
    55 * @author  Fabien Ménager <fabien.menager@gmail.com>
    66 * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
  • wpwing-pdf-invoice-packing-slip-for-woocommerce/trunk/vendor/phenx/php-font-lib/src/FontLib/Header.php

    r2614294 r3024399  
    22/**
    33 * @package php-font-lib
    4  * @link    https://github.com/PhenX/php-font-lib
     4 * @link    https://github.com/dompdf/php-font-lib
    55 * @author  Fabien Ménager <fabien.menager@gmail.com>
    66 * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
  • wpwing-pdf-invoice-packing-slip-for-woocommerce/trunk/vendor/phenx/php-font-lib/src/FontLib/OpenType/File.php

    r2614294 r3024399  
    22/**
    33 * @package php-font-lib
    4  * @link    https://github.com/PhenX/php-font-lib
     4 * @link    https://github.com/dompdf/php-font-lib
    55 * @author  Fabien Ménager <fabien.menager@gmail.com>
    66 * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
  • wpwing-pdf-invoice-packing-slip-for-woocommerce/trunk/vendor/phenx/php-font-lib/src/FontLib/OpenType/TableDirectoryEntry.php

    r2614294 r3024399  
    22/**
    33 * @package php-font-lib
    4  * @link    https://github.com/PhenX/php-font-lib
     4 * @link    https://github.com/dompdf/php-font-lib
    55 * @author  Fabien Ménager <fabien.menager@gmail.com>
    66 * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
  • wpwing-pdf-invoice-packing-slip-for-woocommerce/trunk/vendor/phenx/php-font-lib/src/FontLib/Table/DirectoryEntry.php

    r2672742 r3024399  
    22/**
    33 * @package php-font-lib
    4  * @link    https://github.com/PhenX/php-font-lib
     4 * @link    https://github.com/dompdf/php-font-lib
    55 * @author  Fabien Ménager <fabien.menager@gmail.com>
    66 * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
     
    5050    }
    5151
    52     $len = mb_strlen($data, '8bit');
    53 
    54     $hi = 0x0000;
    55     $lo = 0x0000;
    56 
    57     for ($i = 0; $i < $len; $i += 4) {
    58       $hi += (ord($data[$i]) << 8) + ord($data[$i + 1]);
    59       $lo += (ord($data[$i + 2]) << 8) + ord($data[$i + 3]);
    60       $hi += $lo >> 16;
    61       $lo = $lo & 0xFFFF;
    62       $hi = $hi & 0xFFFF;
    63     }
    64 
    65     return ($hi << 8) + $lo;
     52    $table = unpack("N*", $data);
     53    return array_sum($table);
    6654  }
    6755
     
    9482    $table_length = $data->encode();
    9583
     84    $font->seek($table_offset + $table_length);
     85    $pad = 0;
     86    $mod = $table_length % 4;
     87    if ($mod != 0) {
     88      $pad = 4 - $mod;
     89      $font->write(str_pad("", $pad, "\0"), $pad);
     90    }
     91
    9692    $font->seek($table_offset);
    9793    $table_data = $font->read($table_length);
     
    106102    Font::d("Bytes written = $table_length");
    107103
    108     $font->seek($table_offset + $table_length);
     104    $font->seek($table_offset + $table_length + $pad);
    109105  }
    110106
  • wpwing-pdf-invoice-packing-slip-for-woocommerce/trunk/vendor/phenx/php-font-lib/src/FontLib/Table/Table.php

    r2614294 r3024399  
    22/**
    33 * @package php-font-lib
    4  * @link    https://github.com/PhenX/php-font-lib
     4 * @link    https://github.com/dompdf/php-font-lib
    55 * @author  Fabien Ménager <fabien.menager@gmail.com>
    66 * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
  • wpwing-pdf-invoice-packing-slip-for-woocommerce/trunk/vendor/phenx/php-font-lib/src/FontLib/Table/Type/cmap.php

    r2614294 r3024399  
    22/**
    33 * @package php-font-lib
    4  * @link    https://github.com/PhenX/php-font-lib
     4 * @link    https://github.com/dompdf/php-font-lib
    55 * @author  Fabien Ménager <fabien.menager@gmail.com>
    66 * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
     
    2727  );
    2828
     29  private static $subtable_v2_format = array(
     30    "length"        => self::uint16,
     31    "language"      => self::uint16
     32  );
     33
     34  private static $subtable_v2_format_subheader = array(
     35    "firstCode"     => self::uint16,
     36    "entryCount"    => self::uint16,
     37    "idDelta"       => self::int16,
     38    "idRangeOffset" => self::uint16
     39  );
     40
    2941  private static $subtable_v4_format = array(
    3042    "length"        => self::uint16,
     
    3951    "length"        => self::uint32,
    4052    "language"      => self::uint32,
    41     "ngroups"    => self::uint32
     53    "ngroups"       => self::uint32
    4254  );
    4355
     
    6173      $subtable["format"] = $font->readUInt16();
    6274
    63       // @todo Only CMAP version 4 and 12
    64       if (($subtable["format"] != 4) && ($subtable["format"] != 12)) {
    65         unset($data["subtables"][$i]);
    66         $data["numberSubtables"]--;
    67         continue;
    68       }
    69 
    70       if ($subtable["format"] == 12) {
    71 
    72         $font->readUInt16();
    73 
    74         $subtable += $font->unpack(self::$subtable_v12_format);
    75 
    76         $glyphIndexArray = array();
    77         $endCodes = array();
    78         $startCodes = array();
    79 
    80         for ($p = 0; $p < $subtable['ngroups']; $p++) {
    81 
    82           $startCode = $startCodes[] = $font->readUInt32();
    83           $endCode = $endCodes[] = $font->readUInt32();
    84           $startGlyphCode = $font->readUInt32();
    85 
    86           for ($c = $startCode; $c <= $endCode; $c++) {
    87             $glyphIndexArray[$c] = $startGlyphCode;
    88             $startGlyphCode++;
     75      switch ($subtable["format"]) {
     76        case 0:
     77        case 6:
     78        case 8:
     79        case 10:
     80        case 13:
     81        case 14:
     82          unset($data["subtables"][$i]);
     83          $data["numberSubtables"]--;
     84          continue 2;
     85
     86        case 2:
     87          $subtable += $font->unpack(self::$subtable_v2_format);
     88
     89          $subHeaderKeys = array_map(function($val) { return $val / 8; }, $font->readUInt16Many(256));
     90          $subHeaders = array();
     91
     92          $glyphIdArray = array();
     93          $maxSubHeaderIndex = max($subHeaderKeys);
     94          for ($i = 0; $i <= $maxSubHeaderIndex; $i++) {
     95            $subHeader = $font->unpack(self::$subtable_v2_format_subheader);
     96            $offset = $font->pos();
     97            $subHeader["glyphIdArrayOffset"] = $offset + $subHeader["idRangeOffset"] - 2;
     98            $subHeaders[$i] = $subHeader;
     99
     100            if (!\array_key_exists($subHeader["glyphIdArrayOffset"], $glyphIdArray) || count($glyphIdArray[$subHeader["glyphIdArrayOffset"]]) < $subHeader["entryCount"]) {
     101              $font->seek($subHeader["glyphIdArrayOffset"]);
     102              $glyphIdArray[$subHeader["glyphIdArrayOffset"]] = $font->readUInt16Many($subHeader["entryCount"]);
     103              $font->seek($offset);
     104            }
    89105          }
    90         }
    91 
    92         $subtable += array(
    93           "startCode" => $startCodes,
    94           "endCode" => $endCodes,
    95           "glyphIndexArray" => $glyphIndexArray,
    96         );
    97 
    98       }
    99       else if ($subtable["format"] == 4) {
    100 
    101         $subtable += $font->unpack(self::$subtable_v4_format);
    102 
    103         $segCount             = $subtable["segCountX2"] / 2;
    104         $subtable["segCount"] = $segCount;
    105 
    106         $endCode = $font->readUInt16Many($segCount);
    107 
    108         $font->readUInt16(); // reservedPad
    109 
    110         $startCode = $font->readUInt16Many($segCount);
    111         $idDelta   = $font->readInt16Many($segCount);
    112 
    113         $ro_start      = $font->pos();
    114         $idRangeOffset = $font->readUInt16Many($segCount);
    115 
    116         $glyphIndexArray = array();
    117         for ($i = 0; $i < $segCount; $i++) {
    118           $c1 = $startCode[$i];
    119           $c2 = $endCode[$i];
    120           $d  = $idDelta[$i];
    121           $ro = $idRangeOffset[$i];
    122 
    123           if ($ro > 0) {
    124             $font->seek($subtable["offset"] + 2 * $i + $ro);
     106
     107          $glyphIndexArray = array();
     108          foreach ($subHeaderKeys as $highByte => $subHeaderKey) {
     109            $subHeader = $subHeaders[$subHeaderKey];
     110            if ($subHeaderKey === 0) {
     111              $c = $highByte;
     112              if ($c < $subHeader["firstCode"] || $c >= ($subHeader["firstCode"] + $subHeader["entryCount"])) {
     113                $glyphIndexArray[$c] = 0;
     114                continue;
     115              }
     116              $c = $highByte;
     117              $index = $c - $subHeader["firstCode"];
     118              $glyphId = $glyphIdArray[$subHeader["glyphIdArrayOffset"]][$index];
     119              if ($glyphId === 0) {
     120                $glyphIndexArray[$c] = 0;
     121              } else {
     122                $glyphIndexArray[$c] = ($glyphId + $subHeader["idDelta"]) & 0xFFFF;
     123              }
     124            } else {
     125              for ($index = 0; $index < $subHeader["entryCount"]; $index++) {
     126                $c = null;
     127                $lowByte = $subHeader["firstCode"] + $index;
     128                $c = (($highByte & 0xFF) << 8) | ($lowByte & 0xFF);
     129                $glyphId = $glyphIdArray[$subHeader["glyphIdArrayOffset"]][$index];
     130                if ($glyphId === 0) {
     131                  $glyphIndexArray[$c] = 0;
     132                } else {
     133                  $glyphIndexArray[$c] = ($glyphId + $subHeader["idDelta"]) & 0xFFFF;
     134                }
     135              }
     136            }
    125137          }
    126138
    127           for ($c = $c1; $c <= $c2; $c++) {
    128             if ($ro == 0) {
    129               $gid = ($c + $d) & 0xFFFF;
    130             }
    131             else {
    132               $offset = ($c - $c1) * 2 + $ro;
    133               $offset = $ro_start + 2 * $i + $offset;
    134 
    135               $font->seek($offset);
    136               $gid = $font->readUInt16();
    137 
    138               if ($gid != 0) {
    139                 $gid = ($gid + $d) & 0xFFFF;
    140               }
    141             }
    142 
    143             if ($gid > 0) {
    144               $glyphIndexArray[$c] = $gid;
     139          $subtable += array(
     140            "subHeaderKeys" => $subHeaderKeys,
     141            "subHeaders" => $subHeaders,
     142            "glyphIdArray" => $glyphIdArray,
     143            "glyphIndexArray" => $glyphIndexArray
     144          );
     145
     146          break;
     147
     148        case 4:
     149          $subtable += $font->unpack(self::$subtable_v4_format);
     150
     151          $segCount             = $subtable["segCountX2"] / 2;
     152          $subtable["segCount"] = $segCount;
     153 
     154          $endCode = $font->readUInt16Many($segCount);
     155 
     156          $font->readUInt16(); // reservedPad
     157 
     158          $startCode = $font->readUInt16Many($segCount);
     159          $idDelta   = $font->readInt16Many($segCount);
     160 
     161          $ro_start      = $font->pos();
     162          $idRangeOffset = $font->readUInt16Many($segCount);
     163 
     164          $glyphIndexArray = array();
     165          for ($i = 0; $i < $segCount; $i++) {
     166            $c1 = $startCode[$i];
     167            $c2 = $endCode[$i];
     168            $d  = $idDelta[$i];
     169            $ro = $idRangeOffset[$i];
     170 
     171            if ($ro > 0) {
     172              $font->seek($subtable["offset"] + 2 * $i + $ro);
     173            }
     174 
     175            for ($c = $c1; $c <= $c2; $c++) {
     176              if ($c === 0xFFFF) {
     177                continue;
     178              }
     179 
     180              if ($ro == 0) {
     181                $gid = ($c + $d) & 0xFFFF;
     182              }
     183              else {
     184                $offset = ($c - $c1) * 2 + $ro;
     185                $offset = $ro_start + 2 * $i + $offset;
     186 
     187                $gid = 0;
     188                if ($font->seek($offset) === true) {
     189                  $gid = $font->readUInt16();
     190                }
     191 
     192                if ($gid != 0) {
     193                  $gid = ($gid + $d) & 0xFFFF;
     194                }
     195              }
     196 
     197              if ($gid >= 0) {
     198                $glyphIndexArray[$c] = $gid;
     199              }
    145200            }
    146201          }
    147         }
    148 
    149         $subtable += array(
    150           "endCode"         => $endCode,
    151           "startCode"       => $startCode,
    152           "idDelta"         => $idDelta,
    153           "idRangeOffset"   => $idRangeOffset,
    154           "glyphIndexArray" => $glyphIndexArray,
    155         );
     202 
     203          $subtable += array(
     204            "endCode"         => $endCode,
     205            "startCode"       => $startCode,
     206            "idDelta"         => $idDelta,
     207            "idRangeOffset"   => $idRangeOffset,
     208            "glyphIndexArray" => $glyphIndexArray
     209          );
     210          break;
     211
     212        case 12:
     213          $font->readUInt16();
     214
     215          $subtable += $font->unpack(self::$subtable_v12_format);
     216
     217          $glyphIndexArray = array();
     218          $endCodes = array();
     219          $startCodes = array();
     220
     221          for ($p = 0; $p < $subtable['ngroups']; $p++) {
     222
     223            $startCode = $startCodes[] = $font->readUInt32();
     224            $endCode = $endCodes[] = $font->readUInt32();
     225            $startGlyphCode = $font->readUInt32();
     226
     227            for ($c = $startCode; $c <= $endCode; $c++) {
     228              $glyphIndexArray[$c] = $startGlyphCode;
     229              $startGlyphCode++;
     230            }
     231          }
     232
     233          $subtable += array(
     234            "startCode" => $startCodes,
     235            "endCode" => $endCodes,
     236            "glyphIndexArray" => $glyphIndexArray,
     237          );
     238          break;
    156239      }
    157240    }
     
    197280    }
    198281
    199     $segments[][] = array(0xFFFF, 0xFFFF);
     282    $segments[][] = array(0xFFFF, null);
    200283
    201284    $startCode = array();
     
    283366      $subtable["length"] = $length - $length_before;
    284367      $font->seek($before_subheader);
    285       $length += $font->pack(self::$subtable_v4_format, $subtable);
     368      $font->pack(self::$subtable_v4_format, $subtable);
    286369
    287370      $font->seek($after_subtable);
  • wpwing-pdf-invoice-packing-slip-for-woocommerce/trunk/vendor/phenx/php-font-lib/src/FontLib/Table/Type/glyf.php

    r2614294 r3024399  
    22/**
    33 * @package php-font-lib
    4  * @link    https://github.com/PhenX/php-font-lib
     4 * @link    https://github.com/dompdf/php-font-lib
    55 * @author  Fabien Ménager <fabien.menager@gmail.com>
    66 * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
     
    4949  }
    5050
    51   public function toHTML() {
     51  public function toHTML($n = 500) {
    5252    $max  = 160;
    5353    $font = $this->getFont();
     
    7474      $height = round($height / $ratio);
    7575    }
    76 
    77     $n = 500;
    7876
    7977    $s = "<h3>" . "Only the first $n simple glyphs are shown (" . count($this->data) . " total)
     
    112110      $char = $char ? "&#{$glyphIndexArray[$g]};" : "";
    113111
     112      if ($char === "" && empty($shape["SVGContours"])) {
     113        $n++;
     114        continue;
     115      }
     116
    114117      $s .= "<div class='glyph-view $type' id='glyph-$g'>
    115118              <span class='glyph-id'>$g</span>
     
    144147    foreach ($subset as $gid) {
    145148      $loca[] = $length;
    146       $length += $data[$gid]->encode();
     149
     150      $bytes = $data[$gid]->encode();
     151
     152      $pad = 0;
     153      $mod = $bytes % 4;
     154      if ($mod != 0) {
     155        $pad = 4 - $mod;
     156        $font->write(str_pad("", $pad, "\0"), $pad);
     157      }
     158      $length += $bytes + $pad;
    147159    }
    148160
  • wpwing-pdf-invoice-packing-slip-for-woocommerce/trunk/vendor/phenx/php-font-lib/src/FontLib/Table/Type/head.php

    r2614294 r3024399  
    22/**
    33 * @package php-font-lib
    4  * @link    https://github.com/PhenX/php-font-lib
     4 * @link    https://github.com/dompdf/php-font-lib
    55 * @author  Fabien Ménager <fabien.menager@gmail.com>
    66 * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
     
    4444    }
    4545  }
     46
     47  function _encode() {
     48    $this->data["checkSumAdjustment"] = 0;
     49    return parent::_encode();
     50  }
    4651}
  • wpwing-pdf-invoice-packing-slip-for-woocommerce/trunk/vendor/phenx/php-font-lib/src/FontLib/Table/Type/hhea.php

    r2614294 r3024399  
    22/**
    33 * @package php-font-lib
    4  * @link    https://github.com/PhenX/php-font-lib
     4 * @link    https://github.com/dompdf/php-font-lib
    55 * @author  Fabien Ménager <fabien.menager@gmail.com>
    66 * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
  • wpwing-pdf-invoice-packing-slip-for-woocommerce/trunk/vendor/phenx/php-font-lib/src/FontLib/Table/Type/hmtx.php

    r2614294 r3024399  
    22/**
    33 * @package php-font-lib
    4  * @link    https://github.com/PhenX/php-font-lib
     4 * @link    https://github.com/dompdf/php-font-lib
    55 * @author  Fabien Ménager <fabien.menager@gmail.com>
    66 * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
     
    3636
    3737    if ($numOfLongHorMetrics < $numGlyphs) {
    38       $lastWidth = end($data);
    39       $data      = array_pad($data, $numGlyphs, $lastWidth);
     38      $lastWidth = end($data)[0];
     39      $numLeft   = $numGlyphs - $numOfLongHorMetrics;
     40      $metrics   = $font->readUInt16Many($numLeft);
     41      for($i = 0; $i < $numLeft; $i++) {
     42        $gid             = $numOfLongHorMetrics + $i;
     43        $leftSideBearing = isset($metrics[$i]) ? $metrics[$i] : 0;
     44        $data[$gid]      = array($lastWidth, $leftSideBearing);
     45      }
    4046    }
    4147
  • wpwing-pdf-invoice-packing-slip-for-woocommerce/trunk/vendor/phenx/php-font-lib/src/FontLib/Table/Type/kern.php

    r2614294 r3024399  
    22/**
    33 * @package php-font-lib
    4  * @link    https://github.com/PhenX/php-font-lib
     4 * @link    https://github.com/dompdf/php-font-lib
    55 * @author  Fabien Ménager <fabien.menager@gmail.com>
    66 * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
  • wpwing-pdf-invoice-packing-slip-for-woocommerce/trunk/vendor/phenx/php-font-lib/src/FontLib/Table/Type/loca.php

    r2614294 r3024399  
    22/**
    33 * @package php-font-lib
    4  * @link    https://github.com/PhenX/php-font-lib
     4 * @link    https://github.com/dompdf/php-font-lib
    55 * @author  Fabien Ménager <fabien.menager@gmail.com>
    66 * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
  • wpwing-pdf-invoice-packing-slip-for-woocommerce/trunk/vendor/phenx/php-font-lib/src/FontLib/Table/Type/maxp.php

    r2614294 r3024399  
    22/**
    33 * @package php-font-lib
    4  * @link    https://github.com/PhenX/php-font-lib
     4 * @link    https://github.com/dompdf/php-font-lib
    55 * @author  Fabien Ménager <fabien.menager@gmail.com>
    66 * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
  • wpwing-pdf-invoice-packing-slip-for-woocommerce/trunk/vendor/phenx/php-font-lib/src/FontLib/Table/Type/name.php

    r2614294 r3024399  
    22/**
    33 * @package php-font-lib
    4  * @link    https://github.com/PhenX/php-font-lib
     4 * @link    https://github.com/dompdf/php-font-lib
    55 * @author  Fabien Ménager <fabien.menager@gmail.com>
    66 * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
     
    151151    }
    152152
     153    $system_encodings = mb_list_encodings();
     154    $system_encodings = array_change_key_case(array_fill_keys($system_encodings, true), CASE_UPPER);
     155   
    153156    $names = array();
    154157    foreach ($records as $record) {
    155158      $font->seek($tableOffset + $data["stringOffset"] + $record->offset);
    156       $s                      = $font->read($record->length);
    157       $record->string         = Font::UTF16ToUTF8($s);
     159      $record->stringRaw = $font->read($record->length);
     160
     161      $encoding = null;
     162      switch ($record->platformID) {
     163        case 3:
     164          switch ($record->platformSpecificID) {
     165            case 2:
     166              if (\array_key_exists("SJIS", $system_encodings)) {
     167                $encoding = "SJIS";
     168              }
     169              break;
     170            case 3:
     171              if (\array_key_exists("GB18030", $system_encodings)) {
     172                $encoding = "GB18030";
     173              }
     174              break;
     175            case 4:
     176              if (\array_key_exists("BIG-5", $system_encodings)) {
     177                $encoding = "BIG-5";
     178              }
     179              break;
     180            case 5:
     181              if (\array_key_exists("UHC", $system_encodings)) {
     182                $encoding = "UHC";
     183              }
     184              break;
     185          }
     186          break;
     187      }
     188      if ($encoding === null) {
     189        $encoding = "UTF-16";
     190      }
     191
     192      $record->string = mb_convert_encoding($record->stringRaw, "UTF-8", $encoding);
     193      if (strpos($record->string, "\0") !== false) {
     194        $record->string = str_replace("\0", "", $record->string);
     195      }
    158196      $names[$record->nameID] = $record;
    159197    }
     
    169207    /** @var nameRecord[] $records */
    170208    $records       = $this->data["records"];
    171     $count_records = count($records);
     209    $count_records = \count($records);
    172210
    173211    $this->data["count"]        = $count_records;
    174     $this->data["stringOffset"] = 6 + $count_records * 12; // 6 => uint16 * 3, 12 => sizeof self::$record_format
     212    $this->data["stringOffset"] = 6 + ($count_records * 12); // 6 => uint16 * 3, 12 => sizeof self::$record_format
    175213
    176214    $length = $font->pack(self::$header_format, $this->data);
    177215
    178216    $offset = 0;
     217
     218    /** @var nameRecord[] $records_to_encode */
     219    $records_to_encode = array();
    179220    foreach ($records as $record) {
    180       $record->length = mb_strlen($record->getUTF16(), "8bit");
    181       $record->offset = $offset;
    182       $offset += $record->length;
    183       $length += $font->pack(nameRecord::$format, (array)$record);
    184     }
    185 
    186     foreach ($records as $record) {
     221      $encoded_record = new nameRecord();
     222      $encoded_record->platformID = 3;
     223      $encoded_record->platformSpecificID = 1;
     224      $encoded_record->languageID = $record->languageID;
     225      $encoded_record->nameID = $record->nameID;
     226      $encoded_record->offset = $offset;
     227      $encoded_record->string = $record->string;
     228      $encoded_record->length = mb_strlen($encoded_record->getUTF16(), "8bit");
     229      $records_to_encode[] = $encoded_record;
     230
     231      $offset += $encoded_record->length;
     232      $length += $font->pack(nameRecord::$format, (array)$encoded_record);
     233    }
     234
     235    foreach ($records_to_encode as $record) {
    187236      $str = $record->getUTF16();
    188237      $length += $font->write($str, mb_strlen($str, "8bit"));
  • wpwing-pdf-invoice-packing-slip-for-woocommerce/trunk/vendor/phenx/php-font-lib/src/FontLib/Table/Type/nameRecord.php

    r2614294 r3024399  
    22/**
    33 * @package php-font-lib
    4  * @link    https://github.com/PhenX/php-font-lib
     4 * @link    https://github.com/dompdf/php-font-lib
    55 * @author  Fabien Ménager <fabien.menager@gmail.com>
    66 * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
     
    2424  public $offset;
    2525  public $string;
     26  public $stringRaw;
    2627
    2728  public static $format = array(
  • wpwing-pdf-invoice-packing-slip-for-woocommerce/trunk/vendor/phenx/php-font-lib/src/FontLib/Table/Type/os2.php

    r2614294 r3024399  
    22/**
    33 * @package php-font-lib
    4  * @link    https://github.com/PhenX/php-font-lib
     4 * @link    https://github.com/dompdf/php-font-lib
    55 * @author  Fabien Ménager <fabien.menager@gmail.com>
    66 * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
  • wpwing-pdf-invoice-packing-slip-for-woocommerce/trunk/vendor/phenx/php-font-lib/src/FontLib/Table/Type/post.php

    r2672742 r3024399  
    22/**
    33 * @package php-font-lib
    4  * @link    https://github.com/PhenX/php-font-lib
     4 * @link    https://github.com/dompdf/php-font-lib
    55 * @author  Fabien Ménager <fabien.menager@gmail.com>
    66 * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
  • wpwing-pdf-invoice-packing-slip-for-woocommerce/trunk/vendor/phenx/php-font-lib/src/FontLib/TrueType/Collection.php

    r2614294 r3024399  
    22/**
    33 * @package php-font-lib
    4  * @link    https://github.com/PhenX/php-font-lib
     4 * @link    https://github.com/dompdf/php-font-lib
    55 * @author  Fabien Ménager <fabien.menager@gmail.com>
    66 * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
  • wpwing-pdf-invoice-packing-slip-for-woocommerce/trunk/vendor/phenx/php-font-lib/src/FontLib/TrueType/File.php

    r2672742 r3024399  
    22/**
    33 * @package php-font-lib
    4  * @link    https://github.com/PhenX/php-font-lib
     4 * @link    https://github.com/dompdf/php-font-lib
    55 * @author  Fabien Ménager <fabien.menager@gmail.com>
    66 * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
     
    102102  );
    103103
     104  private function uniord (string $c, string $encoding = null) {
     105    if (function_exists("mb_ord")) {
     106      if (PHP_VERSION_ID < 80000 && $encoding === null) {
     107          // in PHP < 8 the encoding argument, if supplied, must be a valid encoding
     108          $encoding = "UTF-8";
     109      }
     110      return mb_ord($c, $encoding);
     111    }
     112
     113    if ($encoding != "UTF-8" && $encoding !== null) {
     114      $c = mb_convert_encoding($c, "UTF-8", $encoding);
     115    }
     116
     117    $length = mb_strlen(mb_substr($c, 0, 1), '8bit');
     118    $ord = false;
     119    $bytes = [];
     120    $numbytes = 1;
     121    for ($i = 0; $i < $length; $i++) {
     122      $o = \ord($c[$i]); // get one string character at time
     123      if (\count($bytes) === 0) { // get starting octect
     124        if ($o <= 0x7F) {
     125          $ord = $o;
     126          $numbytes = 1;
     127        } elseif (($o >> 0x05) === 0x06) { // 2 bytes character (0x06 = 110 BIN)
     128          $bytes[] = ($o - 0xC0) << 0x06;
     129          $numbytes = 2;
     130        } elseif (($o >> 0x04) === 0x0E) { // 3 bytes character (0x0E = 1110 BIN)
     131          $bytes[] = ($o - 0xE0) << 0x0C;
     132          $numbytes = 3;
     133        } elseif (($o >> 0x03) === 0x1E) { // 4 bytes character (0x1E = 11110 BIN)
     134          $bytes[] = ($o - 0xF0) << 0x12;
     135          $numbytes = 4;
     136        } else {
     137          $ord = false;
     138          break;
     139        }
     140      } elseif (($o >> 0x06) === 0x02) { // bytes 2, 3 and 4 must start with 0x02 = 10 BIN
     141          $bytes[] = $o - 0x80;
     142          if (\count($bytes) === $numbytes) {
     143            // compose UTF-8 bytes to a single unicode value
     144            $o = $bytes[0];
     145            for ($j = 1; $j < $numbytes; $j++) {
     146              $o += ($bytes[$j] << (($numbytes - $j - 1) * 0x06));
     147            }
     148            if ((($o >= 0xD800) and ($o <= 0xDFFF)) or ($o >= 0x10FFFF)) {
     149              // The definition of UTF-8 prohibits encoding character numbers between
     150              // U+D800 and U+DFFF, which are reserved for use with the UTF-16
     151              // encoding form (as surrogate pairs) and do not directly represent
     152              // characters.
     153              return false;
     154            } else {
     155              $ord = $o; // add char to array
     156            }
     157            // reset data for next char
     158            $bytes = [];
     159            $numbytes = 1;
     160          }
     161      } else {
     162        $ord = false;
     163        break;
     164      }
     165    }
     166
     167    return $ord;
     168  }
     169
    104170  function getTable() {
    105171    $this->parseTableEntries();
     
    158224    $subtable = null;
    159225    foreach ($this->getData("cmap", "subtables") as $_subtable) {
    160       if ($_subtable["platformID"] == 0 || $_subtable["platformID"] == 3 && $_subtable["platformSpecificID"] == 1) {
     226      if ($_subtable["platformID"] == 0 || ($_subtable["platformID"] == 3 && $_subtable["platformSpecificID"] == 1)) {
    161227        $subtable = $_subtable;
    162228        break;
     
    168234    }
    169235
     236    $system_encodings = mb_list_encodings();
     237    $system_encodings = array_change_key_case(array_fill_keys($system_encodings, true), CASE_UPPER);
     238    foreach ($this->getData("cmap", "subtables") as $_subtable) {
     239      $encoding = null;
     240      switch ($_subtable["platformID"]) {
     241        case 3:
     242          switch ($_subtable["platformSpecificID"]) {
     243            case 2:
     244              if (\array_key_exists("SJIS", $system_encodings)) {
     245                $encoding = "SJIS";
     246              }
     247              break;
     248            case 3:
     249              if (\array_key_exists("GB18030", $system_encodings)) {
     250                $encoding = "GB18030";
     251              }
     252              break;
     253            case 4:
     254              if (\array_key_exists("BIG-5", $system_encodings)) {
     255                $encoding = "BIG-5";
     256              }
     257              break;
     258            case 5:
     259              if (\array_key_exists("UHC", $system_encodings)) {
     260                $encoding = "UHC";
     261              }
     262              break;
     263          }
     264          break;
     265      }
     266      if ($encoding) {
     267        $glyphIndexArray = array();
     268        foreach ($_subtable["glyphIndexArray"] as $c => $gid) {
     269          $str = trim(pack("N", $c));
     270          if (\strlen($str) > 0) {
     271            $ord = $this->uniord($str, $encoding);
     272            if ($ord > 0) {
     273              $glyphIndexArray[$ord] = $gid;
     274            }
     275          }
     276        }
     277        return $glyphIndexArray;
     278      }
     279    }
     280   
    170281    return null;
    171282  }
     
    218329  function encode($tags = array()) {
    219330    if (!self::$raw) {
    220       $tags = array_merge(array("head", "hhea", "cmap", "hmtx", "maxp", "glyf", "loca", "name", "post"), $tags);
     331      $tags = array_merge(array("head", "hhea", "cmap", "hmtx", "maxp", "glyf", "loca", "name", "post", "cvt ", "fpgm", "prep"), $tags);
    221332    }
    222333    else {
     
    224335    }
    225336
    226     $num_tables = count($tags);
    227337    $n          = 16; // @todo
    228338
     
    240350    }
    241351
     352    $num_tables = count($entries);
     353    $exponent = floor(log($num_tables, 2));
     354    $power_of_two = pow(2, $exponent);
     355
    242356    $this->header->data["numTables"] = $num_tables;
     357    $this->header->data["searchRange"] = $power_of_two * 16;
     358    $this->header->data["entrySelector"] = log($power_of_two, 2);
     359    $this->header->data["rangeShift"] = $num_tables * 16 - $this->header->data["searchRange"];
    243360    $this->header->encode();
    244361
  • wpwing-pdf-invoice-packing-slip-for-woocommerce/trunk/vendor/phenx/php-font-lib/src/FontLib/TrueType/Header.php

    r2614294 r3024399  
    22/**
    33 * @package php-font-lib
    4  * @link    https://github.com/PhenX/php-font-lib
     4 * @link    https://github.com/dompdf/php-font-lib
    55 * @author  Fabien Ménager <fabien.menager@gmail.com>
    66 * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
  • wpwing-pdf-invoice-packing-slip-for-woocommerce/trunk/vendor/phenx/php-font-lib/src/FontLib/TrueType/TableDirectoryEntry.php

    r2614294 r3024399  
    22/**
    33 * @package php-font-lib
    4  * @link    https://github.com/PhenX/php-font-lib
     4 * @link    https://github.com/dompdf/php-font-lib
    55 * @author  Fabien Ménager <fabien.menager@gmail.com>
    66 * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
  • wpwing-pdf-invoice-packing-slip-for-woocommerce/trunk/vendor/phenx/php-font-lib/src/FontLib/WOFF/File.php

    r2672742 r3024399  
    22/**
    33 * @package php-font-lib
    4  * @link    https://github.com/PhenX/php-font-lib
     4 * @link    https://github.com/dompdf/php-font-lib
    55 * @author  Fabien Ménager <fabien.menager@gmail.com>
    66 * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
  • wpwing-pdf-invoice-packing-slip-for-woocommerce/trunk/vendor/phenx/php-font-lib/src/FontLib/WOFF/Header.php

    r2614294 r3024399  
    22/**
    33 * @package php-font-lib
    4  * @link    https://github.com/PhenX/php-font-lib
     4 * @link    https://github.com/dompdf/php-font-lib
    55 * @author  Fabien Ménager <fabien.menager@gmail.com>
    66 * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
  • wpwing-pdf-invoice-packing-slip-for-woocommerce/trunk/vendor/phenx/php-font-lib/src/FontLib/WOFF/TableDirectoryEntry.php

    r2614294 r3024399  
    22/**
    33 * @package php-font-lib
    4  * @link    https://github.com/PhenX/php-font-lib
     4 * @link    https://github.com/dompdf/php-font-lib
    55 * @author  Fabien Ménager <fabien.menager@gmail.com>
    66 * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
  • wpwing-pdf-invoice-packing-slip-for-woocommerce/trunk/vendor/phenx/php-svg-lib/src/Svg/Document.php

    r2900363 r3024399  
    5353    /** @var \Sabberworm\CSS\CSSList\Document[] */
    5454    protected $styleSheets = array();
     55
     56    public $allowExternalReferences = true;
    5557
    5658    public function loadFile($filename)
  • wpwing-pdf-invoice-packing-slip-for-woocommerce/trunk/vendor/phenx/php-svg-lib/src/Svg/Style.php

    r2900363 r3024399  
    139139                        break;
    140140                    }
     141                }
     142
     143                if (
     144                    \array_key_exists("font-family", $styles)
     145                    && (
     146                        \strtolower(\substr($this->href, 0, 7)) === "phar://"
     147                        || ($this->document->allowExternalReferences === false && \strtolower(\substr($this->href, 0, 5)) !== "data:")
     148                    )
     149                ) {
     150                    unset($style["font-family"]);
    141151                }
    142152            }
  • wpwing-pdf-invoice-packing-slip-for-woocommerce/trunk/vendor/phenx/php-svg-lib/src/Svg/Tag/Image.php

    r2900363 r3024399  
    5959        $this->document->getSurface()->transform(1, 0, 0, -1, 0, $height);
    6060
     61        if (\strtolower(\substr($this->href, 0, 7)) === "phar://" || ($this->document->allowExternalReferences === false && \strtolower(\substr($this->href, 0, 5) !== "data:"))) {
     62            return;
     63        }
     64
    6165        $this->document->getSurface()->drawImage($this->href, $this->x, $this->y, $this->width, $this->height);
    6266    }
  • wpwing-pdf-invoice-packing-slip-for-woocommerce/trunk/vendor/phenx/php-svg-lib/src/Svg/Tag/UseTag.php

    r2900363 r3024399  
    1515    protected $width;
    1616    protected $height;
     17    protected $instances = 0;
    1718
    1819    /** @var AbstractTag */
     
    2122    protected function before($attributes)
    2223    {
     24        $this->instances++;
     25        if ($this->instances > 1) {
     26            //TODO: log circular reference error state
     27            return;
     28        }
     29
    2330        if (isset($attributes['x'])) {
    2431            $this->x = $attributes['x'];
     
    5360
    5461    protected function after() {
     62        if ($this->instances > 0) {
     63            return;
     64        }
    5565        parent::after();
    5666
     
    6474    public function handle($attributes)
    6575    {
     76        if ($this->instances > 1) {
     77            //TODO: log circular reference error state
     78            return;
     79        }
     80
    6681        parent::handle($attributes);
    6782
     
    7186
    7287        $mergedAttributes = $this->reference->attributes;
    73         $attributesToNotMerge = ['x', 'y', 'width', 'height'];
     88        $attributesToNotMerge = ['x', 'y', 'width', 'height', 'href', 'xlink:href', 'id'];
    7489        foreach ($attributes as $attrKey => $attrVal) {
    7590            if (!in_array($attrKey, $attributesToNotMerge) && !isset($mergedAttributes[$attrKey])) {
     
    88103    public function handleEnd()
    89104    {
     105        $this->instances--;
     106        if ($this->instances > 0) {
     107            return;
     108        }
     109
    90110        parent::handleEnd();
    91111
  • wpwing-pdf-invoice-packing-slip-for-woocommerce/trunk/wpwing-pdf-invoice-packing-slip-for-woocommerce.php

    r2927383 r3024399  
    55 * Plugin URI:            https://wpwing.com/
    66 * Description:           Download your WooCommerce order invoice and packing slip as PDF format for print or email.
    7  * Version:               1.4.0
     7 * Version:               1.4.1
    88 * Author:                WPWing
    99 * Author URI:            https://wpwing.com/
    1010 * Requires PHP:          7.1
    1111 * Requires at least:     4.8
    12  * Tested up to:          6.2
     12 * Tested up to:          6.4
    1313 * WC requires at least:  4.5
    14  * WC tested up to:       7.8
     14 * WC tested up to:       8.5
    1515 * License:               GPL-3.0-or-later
    1616 * License URI:           https://www.gnu.org/licenses/gpl-3.0.html
Note: See TracChangeset for help on using the changeset viewer.