diff --git a/.gitattributes b/.gitattributes
index 1a549fc0b..b361124d3 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -2,6 +2,7 @@
*.gitattributes export-ignore
/utils export-ignore
/tests export-ignore
+/packages export-ignore
# Set the default behavior, in case people don't have core.autocrlf set.
* text=auto
diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml
index 9ae56589d..0deb28ba4 100644
--- a/.github/workflows/coverage.yml
+++ b/.github/workflows/coverage.yml
@@ -38,5 +38,8 @@ jobs:
- name: "Install dependencies"
run: "composer install --no-interaction --no-progress"
+ - name: "Install fonts"
+ run: "composer require mpdf/font-bundle-lite --no-interaction --no-progress"
+
- name: "Code coverage"
run: composer coverage
diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml
index a7dd7f45b..cb7e027f2 100644
--- a/.github/workflows/tests.yml
+++ b/.github/workflows/tests.yml
@@ -52,5 +52,8 @@ jobs:
- name: "Install dependencies"
run: "composer install --no-interaction --no-progress"
+ - name: "Install fonts"
+ run: "composer require mpdf/font-bundle-lite --no-interaction --no-progress"
+
- name: "Tests"
run: composer test
diff --git a/composer.json b/composer.json
index 1d114a9ef..59c7f0e68 100644
--- a/composer.json
+++ b/composer.json
@@ -20,9 +20,16 @@
"source": "https://github.com/mpdf/mpdf",
"docs": "https://mpdf.github.io"
},
+ "repositories": [
+ {
+ "type": "path",
+ "url": "packages/*"
+ }
+ ],
"require": {
"php": "^5.6 || ^7.0 || ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0",
"ext-gd": "*",
+ "ext-json": "*",
"ext-mbstring": "*",
"mpdf/psr-http-message-shim": "^1.0 || ^2.0",
"mpdf/psr-log-aware-trait": "^2.0 || ^3.0",
@@ -34,6 +41,7 @@
},
"require-dev": {
"mockery/mockery": "^1.3.0",
+ "mpdf/font-bundle-all": "*",
"mpdf/qrcode": "^1.1.0",
"squizlabs/php_codesniffer": "^3.5.0",
"tracy/tracy": "~2.5",
@@ -43,8 +51,11 @@
"ext-bcmath": "Needed for generation of some types of barcodes",
"ext-zlib": "Needed for compression of embedded resources, such as fonts",
"ext-xml": "Needed mainly for SVG manipulation",
- "ext-imagick": "Needed if developing the Mpdf library"
- },
+ "ext-imagick": "Needed if developing the Mpdf library",
+ "mpdf/font-bundle-all": "All official mPDF fonts that offers coverage for common and uncommon scripts worldwide. Uses 110MB of disk space.",
+ "mpdf/font-bundle-lite": "A subset of official mPDF fonts that offers coverage for most common scripts. Uses 30MB of disk space.",
+ "mpdf/font-dejavu-family": "A unicode font family with reasonable coverage of common scripts. Uses 10MB of disk space."
+ },
"autoload": {
"psr-4": {
"Mpdf\\": "src/"
diff --git a/packages/Aboriginal-Family/Languages.php b/packages/Aboriginal-Family/Languages.php
new file mode 100644
index 000000000..6398a9596
--- /dev/null
+++ b/packages/Aboriginal-Family/Languages.php
@@ -0,0 +1,34 @@
+WriteHTML('
+
+
+
Hello World in aboriginalserif
+
+Some text in the aboriginalsans font-family
+');
+
+$mpdf->OutputHttpDownload('example.pdf');
+```
+
+## Advanced Installation
+
+To manually register the font package with mPDF, you can initialize the package's `Registration` class and pass it to the `FontRegistry` constructor:
+
+```php
+ $registry
+]);
+```
+
+## License
+
+This package is licensed under the MIT License. Fonts are licensed separately by their authors, and can be found in the [`/fonts/LICENSE.txt`](./fonts/LICENSE.txt) file.
\ No newline at end of file
diff --git a/packages/Aboriginal-Family/Registration.php b/packages/Aboriginal-Family/Registration.php
new file mode 100644
index 000000000..208d4a2b8
--- /dev/null
+++ b/packages/Aboriginal-Family/Registration.php
@@ -0,0 +1,112 @@
+ 0xFF, Enable use of OTL features.
+ * ['useKashida'] => 75, Enable use of kashida for text justification in Arabic text
+ *
+ * If a .ttc TrueType collection file is referenced, the number of the font
+ * within the collection is required. Fonts in the collection are numbered
+ * starting at 1, as they appear in the .ttc file.
+ *
+ * @return array{
+ * 'R': string,
+ * 'B'?: string,
+ * 'I'?: string,
+ * 'BI'?: string,
+ * 'sip-ext'?: string,
+ * 'useOTL'?: int,
+ * 'useKashida'?: int,
+ * 'TTCfontID'?: array{
+ * 'R': int,
+ * 'B'?: int,
+ * 'I'?: int,
+ * 'BI'?: int,
+ * }
+ * }
+ */
+ public function getFonts()
+ {
+ return [
+ 'aboriginalsans' => [
+ 'R' => 'AboriginalSansREGULAR.ttf',
+ 'B' => 'AboriginalSansBOLD.ttf',
+ 'I' => 'AboriginalSansITALIC.ttf',
+ 'BI' => 'AboriginalSansBOLDITALIC.ttf',
+ ],
+
+ 'aboriginalserif' => [
+ 'R' => 'AboriginalSerifREGULAR.ttf',
+ 'B' => 'AboriginalSerifBOLD.ttf',
+ 'I' => 'AboriginalSerifITALIC.ttf',
+ 'BI' => 'AboriginalSerifBOLDITALIC.ttf',
+ ],
+ ];
+ }
+
+ /**
+ * Get the Language Package LanguageToFont implementation
+ *
+ * @return \Mpdf\Language\LanguageToFontInterface|null
+ */
+ public function getLanguageToFont()
+ {
+ return new Languages();
+ }
+
+ /**
+ * Define fonts to be used for character substitution, when the useSubstitutions configuration option enabled
+ *
+ * @return array The list of fonts to exclude using the keys found in $this->getFontData()
+ */
+ public function getBackupSubsFonts()
+ {
+ return [
+ 'aboriginalsans',
+ ];
+ }
+
+ /**
+ * Get a list of substituted fonts used when a font is not available in mPDF
+ *
+ * @return array Multidimensional array with keys 'sans_fonts', 'serif_fonts', and 'mono_fonts'
+ */
+ public function getFontFamilySubstitution()
+ {
+ return [
+ 'sans_fonts' => [
+ 'aboriginalsans',
+ ],
+
+ 'serif_fonts' => [
+ 'aboriginalserif',
+ ],
+ ];
+ }
+}
diff --git a/packages/Aboriginal-Family/composer.json b/packages/Aboriginal-Family/composer.json
new file mode 100644
index 000000000..69eb2202c
--- /dev/null
+++ b/packages/Aboriginal-Family/composer.json
@@ -0,0 +1,22 @@
+{
+
+ "name": "mpdf/font-aboriginal-family",
+ "version": "0.1",
+ "type": "library",
+ "description": "The Aboriginal family of fonts for mPDF. Includes sans and serif varieties. Supported scripts include: Cherokee, Candian Aboriginal, and Latin.",
+ "keywords": ["mpdf", "mpdf-fonts"],
+ "license": ["MIT"],
+ "autoload": {
+ "psr-4": {
+ "Mpdf\\Fonts\\AboriginalFamily\\": ""
+ }
+ },
+ "require": {
+ "mpdf/mpdf": "*"
+ },
+ "extra": {
+ "mpdf": {
+ "fonts": "\\Mpdf\\Fonts\\AboriginalFamily\\Registration"
+ }
+ }
+}
\ No newline at end of file
diff --git a/packages/Aboriginal-Family/fonts/AboriginalSansBOLD.ttf b/packages/Aboriginal-Family/fonts/AboriginalSansBOLD.ttf
new file mode 100644
index 000000000..2c1739218
Binary files /dev/null and b/packages/Aboriginal-Family/fonts/AboriginalSansBOLD.ttf differ
diff --git a/packages/Aboriginal-Family/fonts/AboriginalSansBOLDITALIC.ttf b/packages/Aboriginal-Family/fonts/AboriginalSansBOLDITALIC.ttf
new file mode 100644
index 000000000..7c39a4a44
Binary files /dev/null and b/packages/Aboriginal-Family/fonts/AboriginalSansBOLDITALIC.ttf differ
diff --git a/packages/Aboriginal-Family/fonts/AboriginalSansITALIC.ttf b/packages/Aboriginal-Family/fonts/AboriginalSansITALIC.ttf
new file mode 100644
index 000000000..f4b22f097
Binary files /dev/null and b/packages/Aboriginal-Family/fonts/AboriginalSansITALIC.ttf differ
diff --git a/packages/Aboriginal-Family/fonts/AboriginalSansREGULAR.ttf b/packages/Aboriginal-Family/fonts/AboriginalSansREGULAR.ttf
new file mode 100644
index 000000000..e556040d5
Binary files /dev/null and b/packages/Aboriginal-Family/fonts/AboriginalSansREGULAR.ttf differ
diff --git a/packages/Aboriginal-Family/fonts/AboriginalSerifBOLD.ttf b/packages/Aboriginal-Family/fonts/AboriginalSerifBOLD.ttf
new file mode 100644
index 000000000..5867d143b
Binary files /dev/null and b/packages/Aboriginal-Family/fonts/AboriginalSerifBOLD.ttf differ
diff --git a/packages/Aboriginal-Family/fonts/AboriginalSerifBOLDITALIC.ttf b/packages/Aboriginal-Family/fonts/AboriginalSerifBOLDITALIC.ttf
new file mode 100644
index 000000000..023c53e53
Binary files /dev/null and b/packages/Aboriginal-Family/fonts/AboriginalSerifBOLDITALIC.ttf differ
diff --git a/packages/Aboriginal-Family/fonts/AboriginalSerifITALIC.ttf b/packages/Aboriginal-Family/fonts/AboriginalSerifITALIC.ttf
new file mode 100644
index 000000000..683a6a0f2
Binary files /dev/null and b/packages/Aboriginal-Family/fonts/AboriginalSerifITALIC.ttf differ
diff --git a/packages/Aboriginal-Family/fonts/AboriginalSerifREGULAR.ttf b/packages/Aboriginal-Family/fonts/AboriginalSerifREGULAR.ttf
new file mode 100644
index 000000000..e3985c954
Binary files /dev/null and b/packages/Aboriginal-Family/fonts/AboriginalSerifREGULAR.ttf differ
diff --git a/packages/Aboriginal-Family/fonts/LICENSE.txt b/packages/Aboriginal-Family/fonts/LICENSE.txt
new file mode 100644
index 000000000..135ee909b
--- /dev/null
+++ b/packages/Aboriginal-Family/fonts/LICENSE.txt
@@ -0,0 +1,155 @@
+TERMS AND CONDITIONS
+0. Definitions.
+“This License” refers to version 3 of the GNU General Public License.
+
+“Copyright” also means copyright-like laws that apply to other kinds of works, such as semiconductor masks.
+
+“The Program” refers to any copyrightable work licensed under this License. Each licensee is addressed as “you”. “Licensees” and “recipients” may be individuals or organizations.
+
+To “modify” a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a “modified version” of the earlier work or a work “based on” the earlier work.
+
+A “covered work” means either the unmodified Program or a work based on the Program.
+
+To “propagate” a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well.
+
+To “convey” a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying.
+
+An interactive user interface displays “Appropriate Legal Notices” to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion.
+
+1. Source Code.
+The “source code” for a work means the preferred form of the work for making modifications to it. “Object code” means any non-source form of a work.
+
+A “Standard Interface” means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language.
+
+The “System Libraries” of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A “Major Component”, in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it.
+
+The “Corresponding Source” for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work.
+
+The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source.
+
+The Corresponding Source for a work in source code form is that same work.
+
+2. Basic Permissions.
+All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law.
+
+You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you.
+
+Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary.
+
+3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures.
+
+When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures.
+
+4. Conveying Verbatim Copies.
+You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program.
+
+You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee.
+
+5. Conveying Modified Source Versions.
+You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions:
+
+a) The work must carry prominent notices stating that you modified it, and giving a relevant date.
+b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to “keep intact all notices”.
+c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it.
+d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so.
+A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an “aggregate” if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate.
+
+6. Conveying Non-Source Forms.
+You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways:
+
+a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange.
+b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge.
+c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b.
+d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements.
+e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d.
+A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work.
+
+A “User Product” is either (1) a “consumer product”, which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, “normally used” refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product.
+
+“Installation Information” for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made.
+
+If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM).
+
+The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network.
+
+Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying.
+
+7. Additional Terms.
+“Additional permissions” are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions.
+
+When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission.
+
+Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms:
+
+a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or
+b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or
+c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or
+d) Limiting the use for publicity purposes of names of licensors or authors of the material; or
+e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or
+f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors.
+All other non-permissive additional terms are considered “further restrictions” within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying.
+
+If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms.
+
+Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way.
+
+8. Termination.
+You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11).
+
+However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation.
+
+Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice.
+
+Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10.
+
+9. Acceptance Not Required for Having Copies.
+You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so.
+
+10. Automatic Licensing of Downstream Recipients.
+Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License.
+
+An “entity transaction” is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts.
+
+You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it.
+
+11. Patents.
+A “contributor” is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's “contributor version”.
+
+A contributor's “essential patent claims” are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, “control” includes the right to grant patent sublicenses in a manner consistent with the requirements of this License.
+
+Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version.
+
+In the following three paragraphs, a “patent license” is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To “grant” such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party.
+
+If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. “Knowingly relying” means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid.
+
+If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it.
+
+A patent license is “discriminatory” if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007.
+
+Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law.
+
+12. No Surrender of Others' Freedom.
+If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program.
+
+13. Use with the GNU Affero General Public License.
+Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such.
+
+14. Revised Versions of this License.
+The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License “or any later version” applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation.
+
+If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program.
+
+Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version.
+
+15. Disclaimer of Warranty.
+THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+16. Limitation of Liability.
+IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+17. Interpretation of Sections 15 and 16.
+If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee.
\ No newline at end of file
diff --git a/packages/Abyssinica-SIL/Languages.php b/packages/Abyssinica-SIL/Languages.php
new file mode 100644
index 000000000..3fa15a9a7
--- /dev/null
+++ b/packages/Abyssinica-SIL/Languages.php
@@ -0,0 +1,46 @@
+fontByScript($script);
+ }
+
+ return '';
+ }
+
+ protected function fontByScript($script)
+ {
+ switch ($script) {
+ case 'ethi': // ETHIOPIC
+ return 'abyssinicasil';
+ }
+
+ return '';
+ }
+}
diff --git a/packages/Abyssinica-SIL/README.md b/packages/Abyssinica-SIL/README.md
new file mode 100644
index 000000000..28e4bf3b9
--- /dev/null
+++ b/packages/Abyssinica-SIL/README.md
@@ -0,0 +1,63 @@
+# mPDF Font Package
+
+## Introduction
+
+Abyssinica SIL is a unicode font that supports Ethiopic and Latin languages. This package is used with the [mPDF library](https://github.com/mpdf/mpdf).
+
+**Supported Scripts**:
+* Ethiopic
+* Latin
+
+## Installation
+
+```bash
+composer require mpdf/font-abyssinica-sil
+```
+
+## Usage
+
+This package automatically registers the following fonts with mPDF:
+
+- `abyssinicasil`
+
+Example usage in mPDF:
+```php
+WriteHTML('
+
+
+Hello World in abyssinicasil
+');
+
+$mpdf->OutputHttpDownload('example.pdf');
+```
+
+## Advanced Installation
+
+To manually register the font package with mPDF, you can initialize the package's `Registration` class and pass it to the `FontRegistry` constructor:
+
+```php
+ $registry
+]);
+```
+
+## License
+
+This package is licensed under the MIT License. Fonts are licensed separately by their authors, and can be found in the [`/fonts/LICENSE.txt`](./fonts/LICENSE.txt) file.
\ No newline at end of file
diff --git a/packages/Abyssinica-SIL/Registration.php b/packages/Abyssinica-SIL/Registration.php
new file mode 100644
index 000000000..516ffec96
--- /dev/null
+++ b/packages/Abyssinica-SIL/Registration.php
@@ -0,0 +1,85 @@
+ 0xFF, Enable use of OTL features.
+ * ['useKashida'] => 75, Enable use of kashida for text justification in Arabic text
+ *
+ * If a .ttc TrueType collection file is referenced, the number of the font
+ * within the collection is required. Fonts in the collection are numbered
+ * starting at 1, as they appear in the .ttc file.
+ *
+ * @return array{
+ * 'R': string,
+ * 'B'?: string,
+ * 'I'?: string,
+ * 'BI'?: string,
+ * 'sip-ext'?: string,
+ * 'useOTL'?: int,
+ * 'useKashida'?: int,
+ * 'TTCfontID'?: array{
+ * 'R': int,
+ * 'B'?: int,
+ * 'I'?: int,
+ * 'BI'?: int,
+ * }
+ * }
+ */
+ public function getFonts()
+ {
+ return [
+ 'abyssinicasil' => [
+ 'R' => 'AbyssinicaSIL-Regular.ttf',
+ 'useOTL' => 0xFF,
+ ],
+ ];
+ }
+
+ /**
+ * Get the Language Package LanguageToFont implementation
+ *
+ * @return \Mpdf\Language\LanguageToFontInterface|null
+ */
+ public function getLanguageToFont()
+ {
+ return new Languages();
+ }
+
+ /**
+ * Get a list of substituted fonts used when a font is not available in mPDF
+ *
+ * @return array Multidimensional array with keys 'sans_fonts', 'serif_fonts', and 'mono_fonts'
+ */
+ public function getBackupSubsFonts()
+ {
+ return [
+ 'abyssinicasil',
+ ];
+ }
+}
diff --git a/packages/Abyssinica-SIL/composer.json b/packages/Abyssinica-SIL/composer.json
new file mode 100644
index 000000000..513926bdb
--- /dev/null
+++ b/packages/Abyssinica-SIL/composer.json
@@ -0,0 +1,22 @@
+{
+
+ "name": "mpdf/font-abyssinica-sil",
+ "version": "0.1",
+ "type": "library",
+ "description": "Abyssinica SIL is a unicode font that supports Ethiopic and Latin languages. Supported scripts include: Ethipic, and Latin.",
+ "keywords": ["mpdf", "mpdf-fonts"],
+ "license": ["MIT"],
+ "autoload": {
+ "psr-4": {
+ "Mpdf\\Fonts\\AbyssinicaSil\\": ""
+ }
+ },
+ "require": {
+ "mpdf/mpdf": "*"
+ },
+ "extra": {
+ "mpdf": {
+ "fonts": "\\Mpdf\\Fonts\\AbyssinicaSil\\Registration"
+ }
+ }
+}
\ No newline at end of file
diff --git a/ttfonts/Abyssinica_SIL.ttf b/packages/Abyssinica-SIL/fonts/AbyssinicaSIL-Regular.ttf
similarity index 100%
rename from ttfonts/Abyssinica_SIL.ttf
rename to packages/Abyssinica-SIL/fonts/AbyssinicaSIL-Regular.ttf
diff --git a/packages/Abyssinica-SIL/fonts/LICENSE.txt b/packages/Abyssinica-SIL/fonts/LICENSE.txt
new file mode 100644
index 000000000..b5fd17ede
--- /dev/null
+++ b/packages/Abyssinica-SIL/fonts/LICENSE.txt
@@ -0,0 +1,97 @@
+This Font Software is Copyright (c) 2000-2024, SIL Global (https://www.sil.org/)
+with Reserved Font Names "Abyssinica" and "SIL".
+
+Modern Gurage glyphs Copyright (c) 2021-2022 The Ge'ez Frontier Foundation.
+
+This Font Software is licensed under the SIL Open Font License, Version 1.1.
+This license is copied below, and is also available with a FAQ at:
+https://openfontlicense.org/
+
+
+
+-----------------------------------------------------------
+SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
+-----------------------------------------------------------
+
+PREAMBLE
+The goals of the Open Font License (OFL) are to stimulate worldwide
+development of collaborative font projects, to support the font creation
+efforts of academic and linguistic communities, and to provide a free and
+open framework in which fonts may be shared and improved in partnership
+with others.
+
+The OFL allows the licensed fonts to be used, studied, modified and
+redistributed freely as long as they are not sold by themselves. The
+fonts, including any derivative works, can be bundled, embedded,
+redistributed and/or sold with any software provided that any reserved
+names are not used by derivative works. The fonts and derivatives,
+however, cannot be released under any other type of license. The
+requirement for fonts to remain under this license does not apply
+to any document created using the fonts or their derivatives.
+
+DEFINITIONS
+"Font Software" refers to the set of files released by the Copyright
+Holder(s) under this license and clearly marked as such. This may
+include source files, build scripts and documentation.
+
+"Reserved Font Name" refers to any names specified as such after the
+copyright statement(s).
+
+"Original Version" refers to the collection of Font Software components as
+distributed by the Copyright Holder(s).
+
+"Modified Version" refers to any derivative made by adding to, deleting,
+or substituting -- in part or in whole -- any of the components of the
+Original Version, by changing formats or by porting the Font Software to a
+new environment.
+
+"Author" refers to any designer, engineer, programmer, technical
+writer or other person who contributed to the Font Software.
+
+PERMISSION & CONDITIONS
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of the Font Software, to use, study, copy, merge, embed, modify,
+redistribute, and sell modified and unmodified copies of the Font
+Software, subject to the following conditions:
+
+1) Neither the Font Software nor any of its individual components,
+in Original or Modified Versions, may be sold by itself.
+
+2) Original or Modified Versions of the Font Software may be bundled,
+redistributed and/or sold with any software, provided that each copy
+contains the above copyright notice and this license. These can be
+included either as stand-alone text files, human-readable headers or
+in the appropriate machine-readable metadata fields within text or
+binary files as long as those fields can be easily viewed by the user.
+
+3) No Modified Version of the Font Software may use the Reserved Font
+Name(s) unless explicit written permission is granted by the corresponding
+Copyright Holder. This restriction only applies to the primary font name as
+presented to the users.
+
+4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
+Software shall not be used to promote, endorse or advertise any
+Modified Version, except to acknowledge the contribution(s) of the
+Copyright Holder(s) and the Author(s) or with their explicit written
+permission.
+
+5) The Font Software, modified or unmodified, in part or in whole,
+must be distributed entirely under this license, and must not be
+distributed under any other license. The requirement for fonts to
+remain under this license does not apply to any document created
+using the Font Software.
+
+TERMINATION
+This license becomes null and void if any of the above conditions are
+not met.
+
+DISCLAIMER
+THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
+OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
+COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
+DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
+OTHER DEALINGS IN THE FONT SOFTWARE.
diff --git a/packages/Ancient-Scripts-Bundle/Languages.php b/packages/Ancient-Scripts-Bundle/Languages.php
new file mode 100644
index 000000000..aa4a0351b
--- /dev/null
+++ b/packages/Ancient-Scripts-Bundle/Languages.php
@@ -0,0 +1,62 @@
+fontByScript($script);
+ }
+
+ return '';
+ }
+
+ protected function fontByScript($script)
+ {
+ switch ($script) {
+ // EGYPTIAN HIEROGLYPHS
+ case 'egyp':
+ return 'aegyptus';
+
+ case 'cprt': // CYPRIOT
+ case 'linb': // LINEAR_B
+ case 'ital': // OLD_ITALIC
+ return 'aegean';
+
+ case 'xsux': // CUNEIFORM
+ return 'akkadian';
+ }
+
+ return '';
+ }
+}
diff --git a/packages/Ancient-Scripts-Bundle/README.md b/packages/Ancient-Scripts-Bundle/README.md
new file mode 100644
index 000000000..9978672ad
--- /dev/null
+++ b/packages/Ancient-Scripts-Bundle/README.md
@@ -0,0 +1,77 @@
+# mPDF Font Package
+
+## Introduction
+
+The Ancient Scripts collection – designed by George Douros – includes Aegean, Aegyptus, and Akkadian fonts. This package is used with the [mPDF library](https://github.com/mpdf/mpdf).
+
+**Supported Scripts**:
+* Latin
+* Greek
+* Coptic
+* Egyptian Hieroglyphs
+
+## Installation
+
+```bash
+composer require mpdf/font-ancient-scripts-bundle
+```
+
+## Usage
+
+This package automatically registers the following fonts with mPDF:
+
+- `aegyptus`
+- `aegean`
+- `akkadian`
+
+Example usage in mPDF:
+```php
+WriteHTML('
+
+
+Hello World in aegyptus
+Some text in aegean
+Some text in akkadian
+');
+
+$mpdf->OutputHttpDownload('example.pdf');
+```
+
+## Advanced Installation
+
+To manually register the font package with mPDF, you can initialize the package's `Registration` class and pass it to the `FontRegistry` constructor:
+
+```php
+ $registry
+]);
+```
+
+## License
+
+This package is licensed under the MIT License. Fonts are licensed separately by their authors, and can be found in the [`/fonts/LICENSE.txt`](./fonts/LICENSE.txt) file.
\ No newline at end of file
diff --git a/packages/Ancient-Scripts-Bundle/Registration.php b/packages/Ancient-Scripts-Bundle/Registration.php
new file mode 100644
index 000000000..9f8b8868f
--- /dev/null
+++ b/packages/Ancient-Scripts-Bundle/Registration.php
@@ -0,0 +1,83 @@
+ 0xFF, Enable use of OTL features.
+ * ['useKashida'] => 75, Enable use of kashida for text justification in Arabic text
+ *
+ * If a .ttc TrueType collection file is referenced, the number of the font
+ * within the collection is required. Fonts in the collection are numbered
+ * starting at 1, as they appear in the .ttc file.
+ *
+ * @return array{
+ * 'R': string,
+ * 'B'?: string,
+ * 'I'?: string,
+ * 'BI'?: string,
+ * 'sip-ext'?: string,
+ * 'useOTL'?: int,
+ * 'useKashida'?: int,
+ * 'TTCfontID'?: array{
+ * 'R': int,
+ * 'B'?: int,
+ * 'I'?: int,
+ * 'BI'?: int,
+ * }
+ * }
+ */
+ public function getFonts()
+ {
+ return [
+ 'aegyptus' => [
+ 'R' => 'Aegyptus.otf',
+ 'useOTL' => 0xFF,
+ ],
+
+ 'aegean' => [
+ 'R' => 'Aegean.otf',
+ 'useOTL' => 0xFF,
+ ],
+
+ 'akkadian' => [
+ 'R' => 'Akkadian.otf',
+ 'useOTL' => 0xFF,
+ ],
+ ];
+ }
+
+ /**
+ * Get the Language Package LanguageToFont implementation
+ *
+ * @return \Mpdf\Language\LanguageToFontInterface|null
+ */
+ public function getLanguageToFont()
+ {
+ return new Languages();
+ }
+}
diff --git a/packages/Ancient-Scripts-Bundle/composer.json b/packages/Ancient-Scripts-Bundle/composer.json
new file mode 100644
index 000000000..01f946d52
--- /dev/null
+++ b/packages/Ancient-Scripts-Bundle/composer.json
@@ -0,0 +1,21 @@
+{
+ "name": "mpdf/font-ancient-scripts-bundle",
+ "version": "0.1",
+ "type": "library",
+ "description": "The Ancient Scripts collection – designed by George Douros – includes Aegean, Aegyptus, and Akkadian fonts. Supported scripts include: Latin, Greek, Coptic, and Egyptian Hieroglyphs.",
+ "keywords": ["mpdf", "mpdf-fonts"],
+ "license": ["MIT"],
+ "autoload": {
+ "psr-4": {
+ "Mpdf\\Fonts\\AncientScriptsBundle\\": ""
+ }
+ },
+ "require": {
+ "mpdf/mpdf": "*"
+ },
+ "extra": {
+ "mpdf": {
+ "fonts": "\\Mpdf\\Fonts\\AncientScriptsBundle\\Registration"
+ }
+ }
+}
\ No newline at end of file
diff --git a/ttfonts/Aegean.otf b/packages/Ancient-Scripts-Bundle/fonts/Aegean.otf
similarity index 100%
rename from ttfonts/Aegean.otf
rename to packages/Ancient-Scripts-Bundle/fonts/Aegean.otf
diff --git a/ttfonts/Aegyptus.otf b/packages/Ancient-Scripts-Bundle/fonts/Aegyptus.otf
similarity index 100%
rename from ttfonts/Aegyptus.otf
rename to packages/Ancient-Scripts-Bundle/fonts/Aegyptus.otf
diff --git a/ttfonts/Akkadian.otf b/packages/Ancient-Scripts-Bundle/fonts/Akkadian.otf
similarity index 100%
rename from ttfonts/Akkadian.otf
rename to packages/Ancient-Scripts-Bundle/fonts/Akkadian.otf
diff --git a/packages/Ancient-Scripts-Bundle/fonts/LICENSE.txt b/packages/Ancient-Scripts-Bundle/fonts/LICENSE.txt
new file mode 100644
index 000000000..05d79dcdb
--- /dev/null
+++ b/packages/Ancient-Scripts-Bundle/fonts/LICENSE.txt
@@ -0,0 +1,7 @@
+In lieu of a licence:
+
+Fonts in this site are offered free for any use; they may be opened, edited, modified, regenerated, posted, packaged and redistributed.
+
+fonts designed by George Douros
+
+http://users.teilar.gr/~g1951d/ (https://web.archive.org/web/20100214153144/http://users.teilar.gr/~g1951d/)
\ No newline at end of file
diff --git a/packages/DaiBanna-SIL/Languages.php b/packages/DaiBanna-SIL/Languages.php
new file mode 100644
index 000000000..c1d807f57
--- /dev/null
+++ b/packages/DaiBanna-SIL/Languages.php
@@ -0,0 +1,37 @@
+fontByScript($script);
+ }
+
+ return '';
+ }
+
+ protected function fontByScript($script)
+ {
+ switch ($script) {
+ case 'talu': // NEW_TAI_LUE
+ return 'daibannasil';
+ }
+
+ return '';
+ }
+}
diff --git a/packages/DaiBanna-SIL/README.md b/packages/DaiBanna-SIL/README.md
new file mode 100644
index 000000000..87c1904a6
--- /dev/null
+++ b/packages/DaiBanna-SIL/README.md
@@ -0,0 +1,63 @@
+# mPDF Font Package
+
+## Introduction
+
+Dai Banna provides a libre and open font family for the New Tai Lue (Xishuangbanna Dai) script. This package is used with the [mPDF library](https://github.com/mpdf/mpdf).
+
+**Supported Scripts**:
+* New Tai Lue
+* Latin
+
+## Installation
+
+```bash
+composer require mpdf/font-daibanna-sil
+```
+
+## Usage
+
+This package automatically registers the following fonts with mPDF:
+
+- `daibannasil` (regular, italic, bold, bold-italic)
+
+Example usage in mPDF:
+```php
+WriteHTML('
+
+
+Hello World in daibannasil
+');
+
+$mpdf->OutputHttpDownload('example.pdf');
+```
+
+## Advanced Installation
+
+To manually register the font package with mPDF, you can initialize the package's `Registration` class and pass it to the `FontRegistry` constructor:
+
+```php
+ $registry
+]);
+```
+
+## License
+
+This package is licensed under the MIT License. Fonts are licensed separately by their authors, and can be found in the [`/fonts/LICENSE.txt`](./fonts/LICENSE.txt) file.
\ No newline at end of file
diff --git a/packages/DaiBanna-SIL/Registration.php b/packages/DaiBanna-SIL/Registration.php
new file mode 100644
index 000000000..a33efee4e
--- /dev/null
+++ b/packages/DaiBanna-SIL/Registration.php
@@ -0,0 +1,87 @@
+ 0xFF, Enable use of OTL features.
+ * ['useKashida'] => 75, Enable use of kashida for text justification in Arabic text
+ *
+ * If a .ttc TrueType collection file is referenced, the number of the font
+ * within the collection is required. Fonts in the collection are numbered
+ * starting at 1, as they appear in the .ttc file.
+ *
+ * @return array{
+ * 'R': string,
+ * 'B'?: string,
+ * 'I'?: string,
+ * 'BI'?: string,
+ * 'sip-ext'?: string,
+ * 'useOTL'?: int,
+ * 'useKashida'?: int,
+ * 'TTCfontID'?: array{
+ * 'R': int,
+ * 'B'?: int,
+ * 'I'?: int,
+ * 'BI'?: int,
+ * }
+ * }
+ */
+ public function getFonts()
+ {
+ return [
+ 'daibannasil' => [
+ 'R' => 'DaiBannaSIL-Regular.ttf',
+ 'I' => 'DaiBannaSIL-Italic.ttf',
+ 'B' => 'DaiBannaSIL-SemiBold.ttf',
+ 'BI' => 'DaiBannaSIL-SemiBoldItalic.ttf',
+ ],
+ ];
+ }
+
+ /**
+ * Font alias mapping
+ *
+ * @return array{string, string} [ 'aliasName' => 'fontKey' ]
+ */
+ public function getFontAliases()
+ {
+ return [
+ 'daibannasilbook' => 'daibannasil',
+ ];
+ }
+
+ /**
+ * Get the Language Package LanguageToFont implementation
+ *
+ * @return \Mpdf\Language\LanguageToFontInterface|null
+ */
+ public function getLanguageToFont()
+ {
+ return new Languages();
+ }
+}
diff --git a/packages/DaiBanna-SIL/composer.json b/packages/DaiBanna-SIL/composer.json
new file mode 100644
index 000000000..0a2262a2a
--- /dev/null
+++ b/packages/DaiBanna-SIL/composer.json
@@ -0,0 +1,22 @@
+{
+
+ "name": "mpdf/font-daibanna-sil",
+ "version": "0.1",
+ "type": "library",
+ "description": "Dai Banna provides a libre and open font family for the New Tai Lue (Xishuangbanna Dai) script. Supported scripts include: New Tai Lue and Latin",
+ "keywords": ["mpdf", "mpdf-fonts"],
+ "license": ["MIT"],
+ "autoload": {
+ "psr-4": {
+ "Mpdf\\Fonts\\DaiBannaSil\\": ""
+ }
+ },
+ "require": {
+ "mpdf/mpdf": "*"
+ },
+ "extra": {
+ "mpdf": {
+ "fonts": "\\Mpdf\\Fonts\\DaiBannaSil\\Registration"
+ }
+ }
+}
\ No newline at end of file
diff --git a/packages/DaiBanna-SIL/fonts/DaiBannaSIL-Italic.ttf b/packages/DaiBanna-SIL/fonts/DaiBannaSIL-Italic.ttf
new file mode 100644
index 000000000..10306beb9
Binary files /dev/null and b/packages/DaiBanna-SIL/fonts/DaiBannaSIL-Italic.ttf differ
diff --git a/packages/DaiBanna-SIL/fonts/DaiBannaSIL-Regular.ttf b/packages/DaiBanna-SIL/fonts/DaiBannaSIL-Regular.ttf
new file mode 100644
index 000000000..61cd64193
Binary files /dev/null and b/packages/DaiBanna-SIL/fonts/DaiBannaSIL-Regular.ttf differ
diff --git a/packages/DaiBanna-SIL/fonts/DaiBannaSIL-SemiBold.ttf b/packages/DaiBanna-SIL/fonts/DaiBannaSIL-SemiBold.ttf
new file mode 100644
index 000000000..584858d75
Binary files /dev/null and b/packages/DaiBanna-SIL/fonts/DaiBannaSIL-SemiBold.ttf differ
diff --git a/packages/DaiBanna-SIL/fonts/DaiBannaSIL-SemiBoldItalic.ttf b/packages/DaiBanna-SIL/fonts/DaiBannaSIL-SemiBoldItalic.ttf
new file mode 100644
index 000000000..f104168f6
Binary files /dev/null and b/packages/DaiBanna-SIL/fonts/DaiBannaSIL-SemiBoldItalic.ttf differ
diff --git a/packages/DaiBanna-SIL/fonts/LICENSE.txt b/packages/DaiBanna-SIL/fonts/LICENSE.txt
new file mode 100644
index 000000000..9368280ce
--- /dev/null
+++ b/packages/DaiBanna-SIL/fonts/LICENSE.txt
@@ -0,0 +1,94 @@
+Copyright (c) 1998-2022 SIL International (http://www.sil.org/),
+with Reserved Font Name "SIL".
+
+This Font Software is licensed under the SIL Open Font License, Version 1.1.
+This license is copied below, and is also available with a FAQ at:
+https://openfontlicense.org
+
+
+-----------------------------------------------------------
+SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
+-----------------------------------------------------------
+
+PREAMBLE
+The goals of the Open Font License (OFL) are to stimulate worldwide
+development of collaborative font projects, to support the font creation
+efforts of academic and linguistic communities, and to provide a free and
+open framework in which fonts may be shared and improved in partnership
+with others.
+
+The OFL allows the licensed fonts to be used, studied, modified and
+redistributed freely as long as they are not sold by themselves. The
+fonts, including any derivative works, can be bundled, embedded,
+redistributed and/or sold with any software provided that any reserved
+names are not used by derivative works. The fonts and derivatives,
+however, cannot be released under any other type of license. The
+requirement for fonts to remain under this license does not apply
+to any document created using the fonts or their derivatives.
+
+DEFINITIONS
+"Font Software" refers to the set of files released by the Copyright
+Holder(s) under this license and clearly marked as such. This may
+include source files, build scripts and documentation.
+
+"Reserved Font Name" refers to any names specified as such after the
+copyright statement(s).
+
+"Original Version" refers to the collection of Font Software components as
+distributed by the Copyright Holder(s).
+
+"Modified Version" refers to any derivative made by adding to, deleting,
+or substituting -- in part or in whole -- any of the components of the
+Original Version, by changing formats or by porting the Font Software to a
+new environment.
+
+"Author" refers to any designer, engineer, programmer, technical
+writer or other person who contributed to the Font Software.
+
+PERMISSION & CONDITIONS
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of the Font Software, to use, study, copy, merge, embed, modify,
+redistribute, and sell modified and unmodified copies of the Font
+Software, subject to the following conditions:
+
+1) Neither the Font Software nor any of its individual components,
+in Original or Modified Versions, may be sold by itself.
+
+2) Original or Modified Versions of the Font Software may be bundled,
+redistributed and/or sold with any software, provided that each copy
+contains the above copyright notice and this license. These can be
+included either as stand-alone text files, human-readable headers or
+in the appropriate machine-readable metadata fields within text or
+binary files as long as those fields can be easily viewed by the user.
+
+3) No Modified Version of the Font Software may use the Reserved Font
+Name(s) unless explicit written permission is granted by the corresponding
+Copyright Holder. This restriction only applies to the primary font name as
+presented to the users.
+
+4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
+Software shall not be used to promote, endorse or advertise any
+Modified Version, except to acknowledge the contribution(s) of the
+Copyright Holder(s) and the Author(s) or with their explicit written
+permission.
+
+5) The Font Software, modified or unmodified, in part or in whole,
+must be distributed entirely under this license, and must not be
+distributed under any other license. The requirement for fonts to
+remain under this license does not apply to any document created
+using the Font Software.
+
+TERMINATION
+This license becomes null and void if any of the above conditions are
+not met.
+
+DISCLAIMER
+THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
+OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
+COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
+DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
+OTHER DEALINGS IN THE FONT SOFTWARE.
diff --git a/packages/Dejavu-Family/Languages.php b/packages/Dejavu-Family/Languages.php
new file mode 100644
index 000000000..a4e49f3aa
--- /dev/null
+++ b/packages/Dejavu-Family/Languages.php
@@ -0,0 +1,147 @@
+fontByScript($script);
+ }
+
+ return '';
+ }
+
+ protected function fontByScript($script)
+ {
+ switch ($script) {
+ case 'latn': // LATIN
+ case 'cyrl': // CYRILLIC
+ return 'dejavusanscondensed';
+
+ case 'ogam': // OGHAM
+ case 'tfng': // TIFINAGH
+ case 'brai': // BRAILLE
+ return 'dejavusans';
+ }
+
+ return '';
+ }
+}
diff --git a/packages/Dejavu-Family/README.md b/packages/Dejavu-Family/README.md
new file mode 100644
index 000000000..1affa0025
--- /dev/null
+++ b/packages/Dejavu-Family/README.md
@@ -0,0 +1,84 @@
+# mPDF Font Package
+
+## Introduction
+
+This font package contains a collection of DejaVu fonts – including serif, sans-serif, and monospace variants – to be used with the [mPDF library](https://github.com/mpdf/mpdf).
+
+**Supported Scripts**:
+* Latin
+* Greek
+* Cyrillic
+* Armenian
+* Hebrew
+* Arabic
+* Georgian
+* Canadian Aboriginal
+* Ogham
+* Braille
+* Coptic
+* NKO
+* Lisu
+
+## Installation
+
+```bash
+composer require mpdf/font-dejavu-family
+```
+
+## Usage
+
+This package automatically registers the following fonts with mPDF:
+
+- `dejavusans` (sans-serif)
+- `dejavusanscondensed` (sans-serif)
+- `dejavuserif` (serif)
+- `dejavuserifcondensed` (serif)
+- `dejavusansmono` (monospace)
+
+Example usage in mPDF:
+```php
+WriteHTML('
+
+
+Hello World in dejavusanscondensed
+
+Some text in the dejavuserif font-family
+');
+
+$mpdf->OutputHttpDownload('example.pdf');
+```
+
+## Advanced Installation
+
+To manually register the font package with mPDF, you can initialize the package's `Registration` class and pass it to the `FontRegistry` constructor:
+
+```php
+ $registry
+]);
+```
+
+## License
+
+This package is licensed under the MIT License. Fonts are licensed separately by their authors, and can be found in the [`/fonts/LICENSE.txt`](./fonts/LICENSE.txt) file.
\ No newline at end of file
diff --git a/packages/Dejavu-Family/Registration.php b/packages/Dejavu-Family/Registration.php
new file mode 100644
index 000000000..3920cbdee
--- /dev/null
+++ b/packages/Dejavu-Family/Registration.php
@@ -0,0 +1,162 @@
+ 0xFF, Enable use of OTL features.
+ * ['useKashida'] => 75, Enable use of kashida for text justification in Arabic text
+ *
+ * If a .ttc TrueType collection file is referenced, the number of the font
+ * within the collection is required. Fonts in the collection are numbered
+ * starting at 1, as they appear in the .ttc file.
+ *
+ * @return array{
+ * 'R': string,
+ * 'B'?: string,
+ * 'I'?: string,
+ * 'BI'?: string,
+ * 'sip-ext'?: string,
+ * 'useOTL'?: int,
+ * 'useKashida'?: int,
+ * 'TTCfontID'?: array{
+ * 'R': int,
+ * 'B'?: int,
+ * 'I'?: int,
+ * 'BI'?: int,
+ * }
+ * }
+ */
+ public function getFonts()
+ {
+ return [
+ 'dejavusanscondensed' => [
+ 'R' => 'DejaVuSansCondensed.ttf',
+ 'B' => 'DejaVuSansCondensed-Bold.ttf',
+ 'I' => 'DejaVuSansCondensed-Oblique.ttf',
+ 'BI' => 'DejaVuSansCondensed-BoldOblique.ttf',
+ 'useOTL' => 0xFF,
+ 'useKashida' => 75,
+ ],
+
+ 'dejavusans' => [
+ 'R' => 'DejaVuSans.ttf',
+ 'B' => 'DejaVuSans-Bold.ttf',
+ 'I' => 'DejaVuSans-Oblique.ttf',
+ 'BI' => 'DejaVuSans-BoldOblique.ttf',
+ 'useOTL' => 0xFF,
+ 'useKashida' => 75,
+ ],
+
+ 'dejavuserif' => [
+ 'R' => 'DejaVuSerif.ttf',
+ 'B' => 'DejaVuSerif-Bold.ttf',
+ 'I' => 'DejaVuSerif-Italic.ttf',
+ 'BI' => 'DejaVuSerif-BoldItalic.ttf',
+ ],
+
+ 'dejavuserifcondensed' => [
+ 'R' => 'DejaVuSerifCondensed.ttf',
+ 'B' => 'DejaVuSerifCondensed-Bold.ttf',
+ 'I' => 'DejaVuSerifCondensed-Italic.ttf',
+ 'BI' => 'DejaVuSerifCondensed-BoldItalic.ttf',
+ ],
+
+ 'dejavusansmono' => [
+ 'R' => 'DejaVuSansMono.ttf',
+ 'B' => 'DejaVuSansMono-Bold.ttf',
+ 'I' => 'DejaVuSansMono-Oblique.ttf',
+ 'BI' => 'DejaVuSansMono-BoldOblique.ttf',
+ 'useOTL' => 0xFF,
+ 'useKashida' => 75,
+ ],
+ ];
+ }
+
+ /**
+ * Get the Language Package LanguageToFont implementation
+ *
+ * @return \Mpdf\Language\LanguageToFontInterface|null
+ */
+ public function getLanguageToFont()
+ {
+ return new Languages();
+ }
+
+ /**
+ * Define fonts to be used for character substitution, when the useSubstitutions configuration option enabled
+ *
+ * @return array The list of fonts to exclude using the keys found in $this->getFontData()
+ */
+ public function getBackupSubsFonts()
+ {
+ return [
+ 'dejavusanscondensed',
+ ];
+ }
+
+ /**
+ * Get a list of fonts which contain characters in the SIP or SMP Unicode planes but is not required.
+ * This allows a more efficient form of subsetting to be used.
+ *
+ * @return array The list of fonts to exclude using the keys found in $this->getFontData()
+ */
+ public function getBmpFonts()
+ {
+ return [
+ 'dejavusanscondensed',
+ 'dejavusans',
+ 'dejavuserifcondensed',
+ 'dejavuserif',
+ 'dejavusansmono',
+ ];
+ }
+
+ /**
+ * Get a list of substituted fonts used when a font is not available in mPDF
+ *
+ * @return array Multidimensional array with keys 'sans_fonts', 'serif_fonts', and 'mono_fonts'
+ */
+ public function getFontFamilySubstitution()
+ {
+ return [
+ 'sans_fonts' => [
+ 'dejavusanscondensed',
+ 'dejavusans',
+ ],
+
+ 'serif_fonts' => [
+ 'dejavuserifcondensed',
+ 'dejavuserif',
+ ],
+
+ 'mono_fonts' => [
+ 'dejavusansmono',
+ ],
+ ];
+ }
+}
diff --git a/packages/Dejavu-Family/composer.json b/packages/Dejavu-Family/composer.json
new file mode 100644
index 000000000..f025fcda9
--- /dev/null
+++ b/packages/Dejavu-Family/composer.json
@@ -0,0 +1,23 @@
+{
+
+ "name": "mpdf/font-dejavu-family",
+ "version": "0.1",
+ "type": "library",
+ "description": "The DejaVu family of fonts for mPDF. Includes sans, serif, condensed, and mono font varieties. Supported scripts include: Latin, Greek, Cyrillic, Armenian, Hebrew, Arabic, Georgian, Candian Aboriginal, Ogham, Braille, Coptic, NKO, and Lisu.",
+ "keywords": ["mpdf", "mpdf-fonts"],
+ "license": ["MIT"],
+ "autoload": {
+ "psr-4": {
+ "Mpdf\\Fonts\\DejavuFamily\\": ""
+ }
+ },
+ "require": {
+ "mpdf/mpdf": "*"
+ },
+ "extra": {
+ "mpdf": {
+ "fonts": "\\Mpdf\\Fonts\\DejavuFamily\\Registration",
+ "fontOrder": 30
+ }
+ }
+}
\ No newline at end of file
diff --git a/ttfonts/DejaVuSans-Bold.ttf b/packages/Dejavu-Family/fonts/DejaVuSans-Bold.ttf
similarity index 100%
rename from ttfonts/DejaVuSans-Bold.ttf
rename to packages/Dejavu-Family/fonts/DejaVuSans-Bold.ttf
diff --git a/ttfonts/DejaVuSans-BoldOblique.ttf b/packages/Dejavu-Family/fonts/DejaVuSans-BoldOblique.ttf
similarity index 100%
rename from ttfonts/DejaVuSans-BoldOblique.ttf
rename to packages/Dejavu-Family/fonts/DejaVuSans-BoldOblique.ttf
diff --git a/ttfonts/DejaVuSans-Oblique.ttf b/packages/Dejavu-Family/fonts/DejaVuSans-Oblique.ttf
similarity index 100%
rename from ttfonts/DejaVuSans-Oblique.ttf
rename to packages/Dejavu-Family/fonts/DejaVuSans-Oblique.ttf
diff --git a/ttfonts/DejaVuSans.ttf b/packages/Dejavu-Family/fonts/DejaVuSans.ttf
similarity index 100%
rename from ttfonts/DejaVuSans.ttf
rename to packages/Dejavu-Family/fonts/DejaVuSans.ttf
diff --git a/ttfonts/DejaVuSansCondensed-Bold.ttf b/packages/Dejavu-Family/fonts/DejaVuSansCondensed-Bold.ttf
similarity index 100%
rename from ttfonts/DejaVuSansCondensed-Bold.ttf
rename to packages/Dejavu-Family/fonts/DejaVuSansCondensed-Bold.ttf
diff --git a/ttfonts/DejaVuSansCondensed-BoldOblique.ttf b/packages/Dejavu-Family/fonts/DejaVuSansCondensed-BoldOblique.ttf
similarity index 100%
rename from ttfonts/DejaVuSansCondensed-BoldOblique.ttf
rename to packages/Dejavu-Family/fonts/DejaVuSansCondensed-BoldOblique.ttf
diff --git a/ttfonts/DejaVuSansCondensed-Oblique.ttf b/packages/Dejavu-Family/fonts/DejaVuSansCondensed-Oblique.ttf
similarity index 100%
rename from ttfonts/DejaVuSansCondensed-Oblique.ttf
rename to packages/Dejavu-Family/fonts/DejaVuSansCondensed-Oblique.ttf
diff --git a/ttfonts/DejaVuSansCondensed.ttf b/packages/Dejavu-Family/fonts/DejaVuSansCondensed.ttf
similarity index 100%
rename from ttfonts/DejaVuSansCondensed.ttf
rename to packages/Dejavu-Family/fonts/DejaVuSansCondensed.ttf
diff --git a/ttfonts/DejaVuSansMono-Bold.ttf b/packages/Dejavu-Family/fonts/DejaVuSansMono-Bold.ttf
similarity index 100%
rename from ttfonts/DejaVuSansMono-Bold.ttf
rename to packages/Dejavu-Family/fonts/DejaVuSansMono-Bold.ttf
diff --git a/ttfonts/DejaVuSansMono-BoldOblique.ttf b/packages/Dejavu-Family/fonts/DejaVuSansMono-BoldOblique.ttf
similarity index 100%
rename from ttfonts/DejaVuSansMono-BoldOblique.ttf
rename to packages/Dejavu-Family/fonts/DejaVuSansMono-BoldOblique.ttf
diff --git a/ttfonts/DejaVuSansMono-Oblique.ttf b/packages/Dejavu-Family/fonts/DejaVuSansMono-Oblique.ttf
similarity index 100%
rename from ttfonts/DejaVuSansMono-Oblique.ttf
rename to packages/Dejavu-Family/fonts/DejaVuSansMono-Oblique.ttf
diff --git a/ttfonts/DejaVuSansMono.ttf b/packages/Dejavu-Family/fonts/DejaVuSansMono.ttf
similarity index 100%
rename from ttfonts/DejaVuSansMono.ttf
rename to packages/Dejavu-Family/fonts/DejaVuSansMono.ttf
diff --git a/ttfonts/DejaVuSerif-Bold.ttf b/packages/Dejavu-Family/fonts/DejaVuSerif-Bold.ttf
similarity index 100%
rename from ttfonts/DejaVuSerif-Bold.ttf
rename to packages/Dejavu-Family/fonts/DejaVuSerif-Bold.ttf
diff --git a/ttfonts/DejaVuSerif-BoldItalic.ttf b/packages/Dejavu-Family/fonts/DejaVuSerif-BoldItalic.ttf
similarity index 100%
rename from ttfonts/DejaVuSerif-BoldItalic.ttf
rename to packages/Dejavu-Family/fonts/DejaVuSerif-BoldItalic.ttf
diff --git a/ttfonts/DejaVuSerif-Italic.ttf b/packages/Dejavu-Family/fonts/DejaVuSerif-Italic.ttf
similarity index 100%
rename from ttfonts/DejaVuSerif-Italic.ttf
rename to packages/Dejavu-Family/fonts/DejaVuSerif-Italic.ttf
diff --git a/ttfonts/DejaVuSerif.ttf b/packages/Dejavu-Family/fonts/DejaVuSerif.ttf
similarity index 100%
rename from ttfonts/DejaVuSerif.ttf
rename to packages/Dejavu-Family/fonts/DejaVuSerif.ttf
diff --git a/ttfonts/DejaVuSerifCondensed-Bold.ttf b/packages/Dejavu-Family/fonts/DejaVuSerifCondensed-Bold.ttf
similarity index 100%
rename from ttfonts/DejaVuSerifCondensed-Bold.ttf
rename to packages/Dejavu-Family/fonts/DejaVuSerifCondensed-Bold.ttf
diff --git a/ttfonts/DejaVuSerifCondensed-BoldItalic.ttf b/packages/Dejavu-Family/fonts/DejaVuSerifCondensed-BoldItalic.ttf
similarity index 100%
rename from ttfonts/DejaVuSerifCondensed-BoldItalic.ttf
rename to packages/Dejavu-Family/fonts/DejaVuSerifCondensed-BoldItalic.ttf
diff --git a/ttfonts/DejaVuSerifCondensed-Italic.ttf b/packages/Dejavu-Family/fonts/DejaVuSerifCondensed-Italic.ttf
similarity index 100%
rename from ttfonts/DejaVuSerifCondensed-Italic.ttf
rename to packages/Dejavu-Family/fonts/DejaVuSerifCondensed-Italic.ttf
diff --git a/ttfonts/DejaVuSerifCondensed.ttf b/packages/Dejavu-Family/fonts/DejaVuSerifCondensed.ttf
similarity index 100%
rename from ttfonts/DejaVuSerifCondensed.ttf
rename to packages/Dejavu-Family/fonts/DejaVuSerifCondensed.ttf
diff --git a/ttfonts/DejaVuinfo.txt b/packages/Dejavu-Family/fonts/LICENSE.txt
similarity index 100%
rename from ttfonts/DejaVuinfo.txt
rename to packages/Dejavu-Family/fonts/LICENSE.txt
diff --git a/packages/Dhyana/Languages.php b/packages/Dhyana/Languages.php
new file mode 100644
index 000000000..33287af1c
--- /dev/null
+++ b/packages/Dhyana/Languages.php
@@ -0,0 +1,24 @@
+WriteHTML('
+
+
+Hello World in dhyana
+');
+
+$mpdf->OutputHttpDownload('example.pdf');
+```
+
+## Advanced Installation
+
+To manually register the font package with mPDF, you can initialize the package's `Registration` class and pass it to the `FontRegistry` constructor:
+
+```php
+ $registry
+]);
+```
+
+## License
+
+This package is licensed under the MIT License. Fonts are licensed separately by their authors, and can be found in the [`/fonts/LICENSE.txt`](./fonts/LICENSE.txt) file.
\ No newline at end of file
diff --git a/packages/Dhyana/Registration.php b/packages/Dhyana/Registration.php
new file mode 100644
index 000000000..c0831c806
--- /dev/null
+++ b/packages/Dhyana/Registration.php
@@ -0,0 +1,100 @@
+ 0xFF, Enable use of OTL features.
+ * ['useKashida'] => 75, Enable use of kashida for text justification in Arabic text
+ *
+ * If a .ttc TrueType collection file is referenced, the number of the font
+ * within the collection is required. Fonts in the collection are numbered
+ * starting at 1, as they appear in the .ttc file.
+ *
+ * @return array{
+ * 'R': string,
+ * 'B'?: string,
+ * 'I'?: string,
+ * 'BI'?: string,
+ * 'sip-ext'?: string,
+ * 'useOTL'?: int,
+ * 'useKashida'?: int,
+ * 'TTCfontID'?: array{
+ * 'R': int,
+ * 'B'?: int,
+ * 'I'?: int,
+ * 'BI'?: int,
+ * }
+ * }
+ */
+ public function getFonts()
+ {
+ return [
+ 'dhyana' => [
+ 'R' => 'Dhyana-Regular.ttf',
+ 'B' => 'Dhyana-Bold.ttf',
+ 'useOTL' => 0xFF,
+ ],
+ ];
+ }
+
+ /**
+ * Get the Language Package LanguageToFont implementation
+ *
+ * @return \Mpdf\Language\LanguageToFontInterface|null
+ */
+ public function getLanguageToFont()
+ {
+ return new Languages();
+ }
+
+ /**
+ * Get a list of substituted fonts used when a font is not available in mPDF
+ *
+ * @return array Multidimensional array with keys 'sans_fonts', 'serif_fonts', and 'mono_fonts'
+ */
+ public function getFontFamilySubstitution()
+ {
+ return [
+ 'sans_fonts' => [
+ 'dhyana'
+ ],
+ ];
+ }
+
+ /**
+ * Get the line-breaking dictionaries the package provides
+ *
+ * @return array mPDF shaper letter => absolute .dat path
+ */
+ public function getLineBreakDictionaries()
+ {
+ return [
+ 'L' => __DIR__ . '/fonts/linebrdictL.dat', /* Lao */
+ ];
+ }
+}
diff --git a/packages/Dhyana/composer.json b/packages/Dhyana/composer.json
new file mode 100644
index 000000000..85fb8d053
--- /dev/null
+++ b/packages/Dhyana/composer.json
@@ -0,0 +1,22 @@
+{
+
+ "name": "mpdf/font-dhyana",
+ "version": "0.1",
+ "type": "library",
+ "description": "Dhyana is a sans-serif font created by Vernon Adams. Supported scripts include: Lao and Latin",
+ "keywords": ["mpdf", "mpdf-fonts"],
+ "license": ["MIT"],
+ "autoload": {
+ "psr-4": {
+ "Mpdf\\Fonts\\Dhyana\\": ""
+ }
+ },
+ "require": {
+ "mpdf/mpdf": "*"
+ },
+ "extra": {
+ "mpdf": {
+ "fonts": "\\Mpdf\\Fonts\\Dhyana\\Registration"
+ }
+ }
+}
\ No newline at end of file
diff --git a/ttfonts/Dhyana-Bold.ttf b/packages/Dhyana/fonts/Dhyana-Bold.ttf
similarity index 100%
rename from ttfonts/Dhyana-Bold.ttf
rename to packages/Dhyana/fonts/Dhyana-Bold.ttf
diff --git a/ttfonts/Dhyana-Regular.ttf b/packages/Dhyana/fonts/Dhyana-Regular.ttf
similarity index 100%
rename from ttfonts/Dhyana-Regular.ttf
rename to packages/Dhyana/fonts/Dhyana-Regular.ttf
diff --git a/ttfonts/DhyanaOFL.txt b/packages/Dhyana/fonts/LICENSE.txt
similarity index 100%
rename from ttfonts/DhyanaOFL.txt
rename to packages/Dhyana/fonts/LICENSE.txt
diff --git a/data/linebrdictL.dat b/packages/Dhyana/fonts/linebrdictL.dat
similarity index 100%
rename from data/linebrdictL.dat
rename to packages/Dhyana/fonts/linebrdictL.dat
diff --git a/packages/Eeyek/Languages.php b/packages/Eeyek/Languages.php
new file mode 100644
index 000000000..e7d865d64
--- /dev/null
+++ b/packages/Eeyek/Languages.php
@@ -0,0 +1,38 @@
+fontByScript($script);
+ }
+
+ return '';
+ }
+
+ protected function fontByScript($script)
+ {
+ switch ($script) {
+ // MEETEI_MAYEK
+ case 'mtei':
+ return 'eeyek';
+ }
+
+ return '';
+ }
+}
diff --git a/packages/Eeyek/README.md b/packages/Eeyek/README.md
new file mode 100644
index 000000000..107ac6cc0
--- /dev/null
+++ b/packages/Eeyek/README.md
@@ -0,0 +1,63 @@
+# mPDF Font Package
+
+## Introduction
+
+Eeyek is a Unicode font for the Meetei Mayek script. This package is used with the [mPDF library](https://github.com/mpdf/mpdf).
+
+**Supported Scripts**:
+* Meetei Mayek
+* Latin
+
+## Installation
+
+```bash
+composer require mpdf/font-eeyek
+```
+
+## Usage
+
+This package automatically registers the following fonts with mPDF:
+
+- `eeyek`
+
+Example usage in mPDF:
+```php
+WriteHTML('
+
+
+Hello World in eeyek
+');
+
+$mpdf->OutputHttpDownload('example.pdf');
+```
+
+## Advanced Installation
+
+To manually register the font package with mPDF, you can initialize the package's `Registration` class and pass it to the `FontRegistry` constructor:
+
+```php
+ $registry
+]);
+```
+
+## License
+
+This package is licensed under the MIT License. Fonts are licensed separately by their authors, and can be found in the [`/fonts/LICENSE.txt`](./fonts/LICENSE.txt) file.
\ No newline at end of file
diff --git a/packages/Eeyek/Registration.php b/packages/Eeyek/Registration.php
new file mode 100644
index 000000000..de4fd7a5f
--- /dev/null
+++ b/packages/Eeyek/Registration.php
@@ -0,0 +1,84 @@
+ 0xFF, Enable use of OTL features.
+ * ['useKashida'] => 75, Enable use of kashida for text justification in Arabic text
+ *
+ * If a .ttc TrueType collection file is referenced, the number of the font
+ * within the collection is required. Fonts in the collection are numbered
+ * starting at 1, as they appear in the .ttc file.
+ *
+ * @return array{
+ * 'R': string,
+ * 'B'?: string,
+ * 'I'?: string,
+ * 'BI'?: string,
+ * 'sip-ext'?: string,
+ * 'useOTL'?: int,
+ * 'useKashida'?: int,
+ * 'TTCfontID'?: array{
+ * 'R': int,
+ * 'B'?: int,
+ * 'I'?: int,
+ * 'BI'?: int,
+ * }
+ * }
+ */
+ public function getFonts()
+ {
+ return [
+ 'eeyek' => [
+ 'R' => 'Eeyek-Regular.ttf',
+ ],
+ ];
+ }
+
+ /**
+ * Font alias mapping
+ *
+ * @return array{string, string} [ 'aliasName' => 'fontKey' ]
+ */
+ public function getFontAliases()
+ {
+ return [
+ 'eeyekunicode' => 'eeyek',
+ ];
+ }
+
+ /**
+ * Get the Language Package LanguageToFont implementation
+ *
+ * @return \Mpdf\Language\LanguageToFontInterface|null
+ */
+ public function getLanguageToFont()
+ {
+ return new Languages();
+ }
+}
diff --git a/packages/Eeyek/composer.json b/packages/Eeyek/composer.json
new file mode 100644
index 000000000..226c3c9c2
--- /dev/null
+++ b/packages/Eeyek/composer.json
@@ -0,0 +1,21 @@
+{
+ "name": "mpdf/font-eeyek",
+ "version": "0.1",
+ "type": "library",
+ "description": "Eeyek is a Unicode font for the Meetei Mayek script. Supported scripts include: Meetei Mayek and Latin",
+ "keywords": ["mpdf", "mpdf-fonts"],
+ "license": ["MIT"],
+ "autoload": {
+ "psr-4": {
+ "Mpdf\\Fonts\\Eeyek\\": ""
+ }
+ },
+ "require": {
+ "mpdf/mpdf": "*"
+ },
+ "extra": {
+ "mpdf": {
+ "fonts": "\\Mpdf\\Fonts\\Eeyek\\Registration"
+ }
+ }
+}
\ No newline at end of file
diff --git a/ttfonts/Eeyek-Regular.ttf b/packages/Eeyek/fonts/Eeyek-Regular.ttf
similarity index 100%
rename from ttfonts/Eeyek-Regular.ttf
rename to packages/Eeyek/fonts/Eeyek-Regular.ttf
diff --git a/packages/Eeyek/fonts/LICENSE.txt b/packages/Eeyek/fonts/LICENSE.txt
new file mode 100644
index 000000000..d02592499
--- /dev/null
+++ b/packages/Eeyek/fonts/LICENSE.txt
@@ -0,0 +1,95 @@
+Original Meetei Mayek copyright (c) 1999-2019 Pravabati Chingangbam and Tabish (tabishq@gmail.com)
+with Reserved Font Name "Eeyek".
+Revisions and Latin glyphs copyright (c) 1997-2019 SIL International.
+
+This Font Software is licensed under the SIL Open Font License, Version 1.1.
+This license is copied below, and is also available with a FAQ at:
+http://scripts.sil.org/OFL
+
+
+-----------------------------------------------------------
+SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
+-----------------------------------------------------------
+
+PREAMBLE
+The goals of the Open Font License (OFL) are to stimulate worldwide
+development of collaborative font projects, to support the font creation
+efforts of academic and linguistic communities, and to provide a free and
+open framework in which fonts may be shared and improved in partnership
+with others.
+
+The OFL allows the licensed fonts to be used, studied, modified and
+redistributed freely as long as they are not sold by themselves. The
+fonts, including any derivative works, can be bundled, embedded,
+redistributed and/or sold with any software provided that any reserved
+names are not used by derivative works. The fonts and derivatives,
+however, cannot be released under any other type of license. The
+requirement for fonts to remain under this license does not apply
+to any document created using the fonts or their derivatives.
+
+DEFINITIONS
+"Font Software" refers to the set of files released by the Copyright
+Holder(s) under this license and clearly marked as such. This may
+include source files, build scripts and documentation.
+
+"Reserved Font Name" refers to any names specified as such after the
+copyright statement(s).
+
+"Original Version" refers to the collection of Font Software components as
+distributed by the Copyright Holder(s).
+
+"Modified Version" refers to any derivative made by adding to, deleting,
+or substituting -- in part or in whole -- any of the components of the
+Original Version, by changing formats or by porting the Font Software to a
+new environment.
+
+"Author" refers to any designer, engineer, programmer, technical
+writer or other person who contributed to the Font Software.
+
+PERMISSION & CONDITIONS
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of the Font Software, to use, study, copy, merge, embed, modify,
+redistribute, and sell modified and unmodified copies of the Font
+Software, subject to the following conditions:
+
+1) Neither the Font Software nor any of its individual components,
+in Original or Modified Versions, may be sold by itself.
+
+2) Original or Modified Versions of the Font Software may be bundled,
+redistributed and/or sold with any software, provided that each copy
+contains the above copyright notice and this license. These can be
+included either as stand-alone text files, human-readable headers or
+in the appropriate machine-readable metadata fields within text or
+binary files as long as those fields can be easily viewed by the user.
+
+3) No Modified Version of the Font Software may use the Reserved Font
+Name(s) unless explicit written permission is granted by the corresponding
+Copyright Holder. This restriction only applies to the primary font name as
+presented to the users.
+
+4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
+Software shall not be used to promote, endorse or advertise any
+Modified Version, except to acknowledge the contribution(s) of the
+Copyright Holder(s) and the Author(s) or with their explicit written
+permission.
+
+5) The Font Software, modified or unmodified, in part or in whole,
+must be distributed entirely under this license, and must not be
+distributed under any other license. The requirement for fonts to
+remain under this license does not apply to any document created
+using the Font Software.
+
+TERMINATION
+This license becomes null and void if any of the above conditions are
+not met.
+
+DISCLAIMER
+THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
+OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
+COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
+DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
+OTHER DEALINGS IN THE FONT SOFTWARE.
diff --git a/packages/Emoji/README.md b/packages/Emoji/README.md
new file mode 100644
index 000000000..ea1b14c8e
--- /dev/null
+++ b/packages/Emoji/README.md
@@ -0,0 +1,52 @@
+# mPDF Font Package
+
+## Introduction
+
+This package adds monochrome emoji support to mPDF using the open source font Noto Emoji. This package is used with the [mPDF library](https://github.com/mpdf/mpdf).
+
+## Installation
+
+```bash
+composer require mpdf/font-emoji
+```
+
+## Usage
+
+This package automatically registers the following fonts with mPDF:
+
+- `emoji`
+
+Example usage in mPDF:
+```php
+ true]);
+$mpdf->WriteHTML('🥳🧁🍰🎁🎂🎈🎺');
+
+$mpdf->OutputHttpDownload('example.pdf');
+```
+
+## Advanced Installation
+
+To manually register the font package with mPDF, you can initialize the package's `Registration` class and pass it to the `FontRegistry` constructor:
+
+```php
+ true
+ 'fontRegistry' => $registry
+]);
+```
+
+## License
+
+This package is licensed under the MIT License. Fonts are licensed separately by their authors, and can be found in the [`/fonts/LICENSE.txt`](./fonts/LICENSE.txt) file.
\ No newline at end of file
diff --git a/packages/Emoji/Registration.php b/packages/Emoji/Registration.php
new file mode 100644
index 000000000..a3e08042b
--- /dev/null
+++ b/packages/Emoji/Registration.php
@@ -0,0 +1,68 @@
+ 0xFF, Enable use of OTL features.
+ * ['useKashida'] => 75, Enable use of kashida for text justification in Arabic text
+ *
+ * If a .ttc TrueType collection file is referenced, the number of the font
+ * within the collection is required. Fonts in the collection are numbered
+ * starting at 1, as they appear in the .ttc file.
+ *
+ * @return array{
+ * 'R': string,
+ * 'B'?: string,
+ * 'I'?: string,
+ * 'BI'?: string,
+ * 'sip-ext'?: string,
+ * 'useOTL'?: int,
+ * 'useKashida'?: int,
+ * 'TTCfontID'?: array{
+ * 'R': int,
+ * 'B'?: int,
+ * 'I'?: int,
+ * 'BI'?: int,
+ * }
+ * }
+ */
+ public function getFonts()
+ {
+ return [
+ 'emoji' => [
+ 'R' => 'NotoEmoji-Regular.ttf',
+ 'B' => 'NotoEmoji-SemiBold.ttf',
+ ],
+ ];
+ }
+
+ public function getBackupSubsFonts()
+ {
+ return [ 'emoji' ];
+ }
+}
diff --git a/packages/Emoji/composer.json b/packages/Emoji/composer.json
new file mode 100644
index 000000000..8c1c531a6
--- /dev/null
+++ b/packages/Emoji/composer.json
@@ -0,0 +1,22 @@
+{
+ "name": "mpdf/font-emoji",
+ "version": "0.1",
+ "type": "library",
+ "description": "A monochrome emoji font package with the open source font Noto Emoji.",
+ "keywords": ["mpdf", "mpdf-fonts"],
+ "license": ["MIT"],
+ "autoload": {
+ "psr-4": {
+ "Mpdf\\Fonts\\Emoji\\": ""
+ }
+ },
+ "require": {
+ "mpdf/mpdf": "*"
+ },
+ "extra": {
+ "mpdf": {
+ "fonts": "\\Mpdf\\Fonts\\Emoji\\Registration",
+ "fontOrder": 40
+ }
+ }
+}
\ No newline at end of file
diff --git a/ttfonts/Lateef font OFL.txt b/packages/Emoji/fonts/LICENSE.txt
similarity index 96%
rename from ttfonts/Lateef font OFL.txt
rename to packages/Emoji/fonts/LICENSE.txt
index 7a1b1c7e4..8f8e6f58c 100644
--- a/ttfonts/Lateef font OFL.txt
+++ b/packages/Emoji/fonts/LICENSE.txt
@@ -1,9 +1,9 @@
-Copyright (c) 2004-2011, SIL International (http://www.sil.org/),
-with Reserved Font Names "Scheherazade" and "SIL".
+Copyright 2013 Google LLC
This Font Software is licensed under the SIL Open Font License, Version 1.1.
This license is copied below, and is also available with a FAQ at:
-http://scripts.sil.org/OFL
+https://openfontlicense.org
+
-----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
diff --git a/packages/Emoji/fonts/NotoEmoji-Regular.ttf b/packages/Emoji/fonts/NotoEmoji-Regular.ttf
new file mode 100644
index 000000000..b50618f0f
Binary files /dev/null and b/packages/Emoji/fonts/NotoEmoji-Regular.ttf differ
diff --git a/packages/Emoji/fonts/NotoEmoji-SemiBold.ttf b/packages/Emoji/fonts/NotoEmoji-SemiBold.ttf
new file mode 100644
index 000000000..95c3e22e4
Binary files /dev/null and b/packages/Emoji/fonts/NotoEmoji-SemiBold.ttf differ
diff --git a/packages/Font-Bundle-All/README.md b/packages/Font-Bundle-All/README.md
new file mode 100644
index 000000000..63c80b28c
--- /dev/null
+++ b/packages/Font-Bundle-All/README.md
@@ -0,0 +1,65 @@
+# mPDF Font Package
+
+## Introduction
+
+A helper package that installs a full suite of fonts (110MB) designed to support most languages worldwide. This package is used with the [mPDF library](https://github.com/mpdf/mpdf).
+
+## Installation
+
+```bash
+composer require mpdf/font-bundle-all
+```
+
+## Usage
+
+This is a meta-package. Installing it will automatically install and register the following font packages with mPDF:
+
+- `mpdf/font-ocr-family`
+- `mpdf/font-ancient-scripts-bundle`
+- `mpdf/font-aboriginal-family`
+- `mpdf/font-tai-heritage-pro`
+- `mpdf/font-sundanese-unicode`
+- `mpdf/font-pothana-2000`
+- `mpdf/font-lohit-kannada`
+- `mpdf/font-lanna-alif`
+- `mpdf/font-khmer-os`
+- `mpdf/font-kaputa-unicode`
+- `mpdf/font-jomolhari`
+- `mpdf/font-eeyek`
+- `mpdf/font-dhyana`
+- `mpdf/font-daibanna-sil`
+- `mpdf/font-myanmar-bundle`
+- `mpdf/font-garuda`
+- `mpdf/font-unbatang`
+- `mpdf/font-mph-2b-damase`
+- `mpdf/font-quivira`
+- `mpdf/font-abyssinica-sil`
+- `mpdf/font-middle-east-scripts-bundle`
+- `mpdf/font-sunext`
+- `mpdf/font-free-family`
+- `mpdf/font-dejavu-family`
+
+Refer to each package for the specific fonts that can be used.
+
+Example usage in mPDF:
+```php
+ \Mpdf\Ucdn::SCRIPT_LATIN, // change this if your primary script is not latin (used so autoScriptToLang will ignore this script)
+ 'useSubsitutions' => true, // if a font is missing a character it will substitute with a similar character from another font
+ 'autoScriptToLang' => true, // automatically marks up HTML text using the lang attribute
+ 'autoLangToFont' => true, // automatically matches the lang attribute to a suitable font (ignoring the current font-family)
+ 'autoVietnamese' => true, //automatically marks up Vietnamese languages with the lang attribute
+ 'autoArabic' => true, // automatically marks up Arabic languages with the lang attribute
+]);
+$mpdf->WriteHTML('
+Hello World
+');
+
+$mpdf->OutputHttpDownload('example.pdf');
+```
+
+## License
+
+This package is licensed under the MIT License.
\ No newline at end of file
diff --git a/packages/Font-Bundle-All/composer.json b/packages/Font-Bundle-All/composer.json
new file mode 100644
index 000000000..e17643b36
--- /dev/null
+++ b/packages/Font-Bundle-All/composer.json
@@ -0,0 +1,36 @@
+{
+
+ "name": "mpdf/font-bundle-all",
+ "version": "0.1",
+ "type": "library",
+ "description": "A helper package that installs the full suite of official mPDF fonts. This bundle allows mPDF to support most languages worldwide (when the `useSubsitutions`, `autoScriptToLang` and `autoLangToFont` config options are `true`).",
+ "keywords": ["mpdf", "mpdf-fonts"],
+ "license": ["MIT"],
+ "require": {
+ "mpdf/font-ocr-family": "*",
+ "mpdf/font-ancient-scripts-bundle": "*",
+ "mpdf/font-aboriginal-family": "*",
+ "mpdf/font-tai-heritage-pro": "*",
+ "mpdf/font-sundanese-unicode": "*",
+ "mpdf/font-pothana-2000": "*",
+ "mpdf/font-lohit-kannada": "*",
+ "mpdf/font-lanna-alif": "*",
+ "mpdf/font-khmer-os": "*",
+ "mpdf/font-kaputa-unicode": "*",
+ "mpdf/font-jomolhari": "*",
+ "mpdf/font-eeyek": "*",
+ "mpdf/font-dhyana": "*",
+ "mpdf/font-daibanna-sil": "*",
+ "mpdf/font-myanmar-bundle": "*",
+ "mpdf/font-garuda": "*",
+ "mpdf/font-unbatang": "*",
+ "mpdf/font-mph-2b-damase": "*",
+ "mpdf/font-quivira": "*",
+ "mpdf/font-abyssinica-sil": "*",
+ "mpdf/font-middle-east-scripts-bundle": "*",
+ "mpdf/font-sunext": "*",
+ "mpdf/font-free-family": "*",
+ "mpdf/font-dejavu-family": "*",
+ "mpdf/font-emoji": "*"
+ }
+}
\ No newline at end of file
diff --git a/packages/Font-Bundle-Lite/README.md b/packages/Font-Bundle-Lite/README.md
new file mode 100644
index 000000000..eaadfd71a
--- /dev/null
+++ b/packages/Font-Bundle-Lite/README.md
@@ -0,0 +1,48 @@
+# mPDF Font Package
+
+## Introduction
+
+A helper package that installs a subset of fonts (30MB) designed to support most common languages worldwide. This package is used with the [mPDF library](https://github.com/mpdf/mpdf).
+
+## Installation
+
+```bash
+composer require mpdf/font-bundle-lite
+```
+
+## Usage
+
+This is a meta-package. Installing it will automatically install and register the following font packages with mPDF:
+
+- `mpdf/font-myanmar-bundle`
+- `mpdf/font-garuda`
+- `mpdf/font-mph-2b-damase`
+- `mpdf/font-quivira`
+- `mpdf/font-middle-east-scripts-bundle`
+- `mpdf/font-free-family`
+- `mpdf/font-dejavu-family`
+
+Refer to each package for the specific fonts that can be used.
+
+Example usage in mPDF:
+```php
+ \Mpdf\Ucdn::SCRIPT_LATIN, // change this if your primary script is not latin (used so autoScriptToLang will ignore this script)
+ 'useSubsitutions' => true, // if a font is missing a character it will substitute with a similar character from another font
+ 'autoScriptToLang' => true, // automatically marks up HTML text using the lang attribute
+ 'autoLangToFont' => true, // automatically matches the lang attribute to a suitable font (ignoring the current font-family)
+ 'autoVietnamese' => true, //automatically marks up Vietnamese languages with the lang attribute
+ 'autoArabic' => true, // automatically marks up Arabic languages with the lang attribute
+]);
+$mpdf->WriteHTML('
+Hello World
+');
+
+$mpdf->OutputHttpDownload('example.pdf');
+```
+
+## License
+
+This package is licensed under the MIT License.
\ No newline at end of file
diff --git a/packages/Font-Bundle-Lite/composer.json b/packages/Font-Bundle-Lite/composer.json
new file mode 100644
index 000000000..4371629bf
--- /dev/null
+++ b/packages/Font-Bundle-Lite/composer.json
@@ -0,0 +1,19 @@
+{
+
+ "name": "mpdf/font-bundle-lite",
+ "version": "0.1",
+ "type": "library",
+ "description": "A helper package that installs a subset of official mPDF fonts that offers coverage for common scripts (when the `useSubsitutions`, `autoScriptToLang`, `useAdobeCJK` and `autoLangToFont` config options are `true`).",
+ "keywords": ["mpdf", "mpdf-fonts"],
+ "license": ["MIT"],
+ "require": {
+ "mpdf/font-myanmar-bundle": "*",
+ "mpdf/font-garuda": "*",
+ "mpdf/font-mph-2b-damase": "*",
+ "mpdf/font-quivira": "*",
+ "mpdf/font-middle-east-scripts-bundle": "*",
+ "mpdf/font-free-family": "*",
+ "mpdf/font-dejavu-family": "*",
+ "mpdf/font-emoji": "*"
+ }
+}
\ No newline at end of file
diff --git a/packages/Free-Family/Languages.php b/packages/Free-Family/Languages.php
new file mode 100644
index 000000000..e2fa0962c
--- /dev/null
+++ b/packages/Free-Family/Languages.php
@@ -0,0 +1,120 @@
+fontByScript($script);
+ }
+
+ return '';
+ }
+
+ protected function fontByScript($script)
+ {
+ switch ($script) {
+ /* South East Asian */
+ case 'kali': // KAYAH_LI
+ return 'freemono';
+ }
+
+ return '';
+ }
+
+}
diff --git a/packages/Free-Family/README.md b/packages/Free-Family/README.md
new file mode 100644
index 000000000..2b8a18dc4
--- /dev/null
+++ b/packages/Free-Family/README.md
@@ -0,0 +1,97 @@
+# mPDF Font Package
+
+## Introduction
+
+The Free family of fonts includes sans, serif, and mono font varieties. This package is used with the [mPDF library](https://github.com/mpdf/mpdf).
+
+**Supported Scripts**:
+* Latin
+* Greek
+* Cyrillic
+* Armenian
+* Hebrew
+* Arabic
+* Syriac
+* Thaana
+* Devanagari
+* Bengali
+* Gurmukhi
+* Hujarati
+* Oriya
+* Tamil
+* Malayalam
+* Sinhala
+* Thai
+* Georgian
+* Ethiopic
+* Cherokee
+* Canadian Aboriginal
+* Hanunoo
+* Tai Le
+* Buginese
+* Coptic
+* Glagolitic
+* Tifinagh
+* Vai
+
+## Installation
+
+```bash
+composer require mpdf/font-free-family
+```
+
+## Usage
+
+This package automatically registers the following fonts with mPDF:
+
+- `freesans` (sans-serif)
+- `freeserif` (serif)
+- `freemono` (monospace)
+
+Example usage in mPDF:
+```php
+WriteHTML('
+
+
+Hello World in freesans
+
+Some text in freeserif
+');
+
+$mpdf->OutputHttpDownload('example.pdf');
+```
+
+## Advanced Installation
+
+To manually register the font package with mPDF, you can initialize the package's `Registration` class and pass it to the `FontRegistry` constructor:
+
+```php
+ $registry
+]);
+```
+
+## License
+
+This package is licensed under the MIT License. Fonts are licensed separately by their authors, and can be found in the [`/fonts/LICENSE.txt`](./fonts/LICENSE.txt) file.
\ No newline at end of file
diff --git a/packages/Free-Family/Registration.php b/packages/Free-Family/Registration.php
new file mode 100644
index 000000000..568487bd7
--- /dev/null
+++ b/packages/Free-Family/Registration.php
@@ -0,0 +1,127 @@
+ 0xFF, Enable use of OTL features.
+ * ['useKashida'] => 75, Enable use of kashida for text justification in Arabic text
+ *
+ * If a .ttc TrueType collection file is referenced, the number of the font
+ * within the collection is required. Fonts in the collection are numbered
+ * starting at 1, as they appear in the .ttc file.
+ *
+ * @return array{
+ * 'R': string,
+ * 'B'?: string,
+ * 'I'?: string,
+ * 'BI'?: string,
+ * 'sip-ext'?: string,
+ * 'useOTL'?: int,
+ * 'useKashida'?: int,
+ * 'TTCfontID'?: array{
+ * 'R': int,
+ * 'B'?: int,
+ * 'I'?: int,
+ * 'BI'?: int,
+ * }
+ * }
+ */
+ public function getFonts()
+ {
+ return [
+ 'freesans' => [
+ 'R' => 'FreeSans.ttf',
+ 'B' => 'FreeSansBold.ttf',
+ 'I' => 'FreeSansOblique.ttf',
+ 'BI' => 'FreeSansBoldOblique.ttf',
+ 'useOTL' => 0xFF,
+ ],
+
+ 'freeserif' => [
+ 'R' => 'FreeSerif.ttf',
+ 'B' => 'FreeSerifBold.ttf',
+ 'I' => 'FreeSerifItalic.ttf',
+ 'BI' => 'FreeSerifBoldItalic.ttf',
+ 'useOTL' => 0xFF,
+ 'useKashida' => 75,
+ ],
+
+ 'freemono' => [
+ 'R' => 'FreeMono.ttf',
+ 'B' => 'FreeMonoBold.ttf',
+ 'I' => 'FreeMonoOblique.ttf',
+ 'BI' => 'FreeMonoBoldOblique.ttf',
+ ],
+ ];
+ }
+
+ /**
+ * Get the Language Package LanguageToFont implementation
+ *
+ * @return \Mpdf\Language\LanguageToFontInterface|null
+ */
+ public function getLanguageToFont()
+ {
+ return new Languages();
+ }
+
+ /**
+ * Define fonts to be used for character substitution, when the useSubstitutions configuration option enabled
+ *
+ * @return array The list of fonts to exclude using the keys found in $this->getFontData()
+ */
+ public function getBackupSubsFonts()
+ {
+ return [
+ 'freesans',
+ ];
+ }
+
+ /**
+ * Get a list of substituted fonts used when a font is not available in mPDF
+ *
+ * @return array Multidimensional array with keys 'sans_fonts', 'serif_fonts', and 'mono_fonts'
+ */
+ public function getFontFamilySubstitution()
+ {
+ return [
+ 'sans_fonts' => [
+ 'freesans',
+ ],
+
+ 'serif_fonts' => [
+ 'freeserif',
+ ],
+
+ 'mono_fonts' => [
+ 'freemono',
+ ],
+ ];
+ }
+}
diff --git a/packages/Free-Family/composer.json b/packages/Free-Family/composer.json
new file mode 100644
index 000000000..b569884e7
--- /dev/null
+++ b/packages/Free-Family/composer.json
@@ -0,0 +1,23 @@
+{
+
+ "name": "mpdf/font-free-family",
+ "version": "0.1",
+ "type": "library",
+ "description": "The Free family of fonts for mPDF. Includes sans, serif, and mono font varieties. Supported scripts include: Latin, Greek, Cyrillic, Armenian, Hebrew, Arabic, Syriac, Thaana, Devanagari, Bengali, Gurmukhi, Hujarati, Oriya, Tamil, Malayalam, Sinhala, Thai, Georgian, Ethiopic, Cherokee, Canadian Aboriginal, Hanunoo, Tai Le, Buginese, Coptic, Glagolitic, Tifinagh, and Vai.",
+ "keywords": ["mpdf", "mpdf-fonts"],
+ "license": ["MIT"],
+ "autoload": {
+ "psr-4": {
+ "Mpdf\\Fonts\\FreeFamily\\": ""
+ }
+ },
+ "require": {
+ "mpdf/mpdf": "*"
+ },
+ "extra": {
+ "mpdf": {
+ "fonts": "\\Mpdf\\Fonts\\FreeFamily\\Registration",
+ "fontOrder": 20
+ }
+ }
+}
\ No newline at end of file
diff --git a/ttfonts/FreeMono.ttf b/packages/Free-Family/fonts/FreeMono.ttf
similarity index 100%
rename from ttfonts/FreeMono.ttf
rename to packages/Free-Family/fonts/FreeMono.ttf
diff --git a/ttfonts/FreeMonoBold.ttf b/packages/Free-Family/fonts/FreeMonoBold.ttf
similarity index 100%
rename from ttfonts/FreeMonoBold.ttf
rename to packages/Free-Family/fonts/FreeMonoBold.ttf
diff --git a/ttfonts/FreeMonoBoldOblique.ttf b/packages/Free-Family/fonts/FreeMonoBoldOblique.ttf
similarity index 100%
rename from ttfonts/FreeMonoBoldOblique.ttf
rename to packages/Free-Family/fonts/FreeMonoBoldOblique.ttf
diff --git a/ttfonts/FreeMonoOblique.ttf b/packages/Free-Family/fonts/FreeMonoOblique.ttf
similarity index 100%
rename from ttfonts/FreeMonoOblique.ttf
rename to packages/Free-Family/fonts/FreeMonoOblique.ttf
diff --git a/ttfonts/FreeSans.ttf b/packages/Free-Family/fonts/FreeSans.ttf
similarity index 100%
rename from ttfonts/FreeSans.ttf
rename to packages/Free-Family/fonts/FreeSans.ttf
diff --git a/ttfonts/FreeSansBold.ttf b/packages/Free-Family/fonts/FreeSansBold.ttf
similarity index 100%
rename from ttfonts/FreeSansBold.ttf
rename to packages/Free-Family/fonts/FreeSansBold.ttf
diff --git a/ttfonts/FreeSansBoldOblique.ttf b/packages/Free-Family/fonts/FreeSansBoldOblique.ttf
similarity index 100%
rename from ttfonts/FreeSansBoldOblique.ttf
rename to packages/Free-Family/fonts/FreeSansBoldOblique.ttf
diff --git a/ttfonts/FreeSansOblique.ttf b/packages/Free-Family/fonts/FreeSansOblique.ttf
similarity index 100%
rename from ttfonts/FreeSansOblique.ttf
rename to packages/Free-Family/fonts/FreeSansOblique.ttf
diff --git a/ttfonts/FreeSerif.ttf b/packages/Free-Family/fonts/FreeSerif.ttf
similarity index 100%
rename from ttfonts/FreeSerif.ttf
rename to packages/Free-Family/fonts/FreeSerif.ttf
diff --git a/ttfonts/FreeSerifBold.ttf b/packages/Free-Family/fonts/FreeSerifBold.ttf
similarity index 100%
rename from ttfonts/FreeSerifBold.ttf
rename to packages/Free-Family/fonts/FreeSerifBold.ttf
diff --git a/ttfonts/FreeSerifBoldItalic.ttf b/packages/Free-Family/fonts/FreeSerifBoldItalic.ttf
similarity index 100%
rename from ttfonts/FreeSerifBoldItalic.ttf
rename to packages/Free-Family/fonts/FreeSerifBoldItalic.ttf
diff --git a/ttfonts/FreeSerifItalic.ttf b/packages/Free-Family/fonts/FreeSerifItalic.ttf
similarity index 100%
rename from ttfonts/FreeSerifItalic.ttf
rename to packages/Free-Family/fonts/FreeSerifItalic.ttf
diff --git a/packages/Free-Family/fonts/LICENSE.txt b/packages/Free-Family/fonts/LICENSE.txt
new file mode 100644
index 000000000..91aa438ea
--- /dev/null
+++ b/packages/Free-Family/fonts/LICENSE.txt
@@ -0,0 +1,12 @@
+ Licensed under the GNU General Public License, version 3
+ or later along with the following exception:
+
+ As a special exception, if you create a document which uses this
+ font, and embed this font or unaltered portions of this font into the
+ document, this font does not by itself cause the resulting document
+ to be covered by the GNU General Public License. This exception does
+ not however invalidate any other reasons why the document might be
+ covered by the GNU General Public License. If you modify this font,
+ you may extend this exception to your version of the font, but you
+ are not obligated to do so. If you do not wish to do so, delete this
+ exception statement from your version.
diff --git a/packages/Garuda/Languages.php b/packages/Garuda/Languages.php
new file mode 100644
index 000000000..e97b65770
--- /dev/null
+++ b/packages/Garuda/Languages.php
@@ -0,0 +1,22 @@
+WriteHTML('
+
+
+Hello World in garuda
+');
+
+$mpdf->OutputHttpDownload('example.pdf');
+```
+
+## Advanced Installation
+
+To manually register the font package with mPDF, you can initialize the package's `Registration` class and pass it to the `FontRegistry` constructor:
+
+```php
+ $registry
+]);
+```
+
+## License
+
+This package is licensed under the MIT License. Fonts are licensed separately by their authors, and can be found in the [`/fonts/LICENSE.txt`](./fonts/LICENSE.txt) file.
\ No newline at end of file
diff --git a/packages/Garuda/Registration.php b/packages/Garuda/Registration.php
new file mode 100644
index 000000000..38fff2c94
--- /dev/null
+++ b/packages/Garuda/Registration.php
@@ -0,0 +1,114 @@
+ 0xFF, Enable use of OTL features.
+ * ['useKashida'] => 75, Enable use of kashida for text justification in Arabic text
+ *
+ * If a .ttc TrueType collection file is referenced, the number of the font
+ * within the collection is required. Fonts in the collection are numbered
+ * starting at 1, as they appear in the .ttc file.
+ *
+ * @return array{
+ * 'R': string,
+ * 'B'?: string,
+ * 'I'?: string,
+ * 'BI'?: string,
+ * 'sip-ext'?: string,
+ * 'useOTL'?: int,
+ * 'useKashida'?: int,
+ * 'TTCfontID'?: array{
+ * 'R': int,
+ * 'B'?: int,
+ * 'I'?: int,
+ * 'BI'?: int,
+ * }
+ * }
+ */
+ public function getFonts()
+ {
+ return [
+ 'garuda' => [/* Thai */
+ 'R' => 'Garuda.ttf',
+ 'B' => 'Garuda-Bold.ttf',
+ 'I' => 'Garuda-Oblique.ttf',
+ 'BI' => 'Garuda-BoldOblique.ttf',
+ 'useOTL' => 0xFF,
+ ],
+ ];
+ }
+
+ /**
+ * Get the Language Package LanguageToFont implementation
+ *
+ * @return \Mpdf\Language\LanguageToFontInterface|null
+ */
+ public function getLanguageToFont()
+ {
+ return new Languages();
+ }
+
+ /**
+ * Define fonts to be used for character substitution, when the useSubstitutions configuration option enabled
+ *
+ * @return array The list of fonts to exclude using the keys found in $this->getFontData()
+ */
+ public function getBackupSubsFonts()
+ {
+ return [
+ 'garuda',
+ ];
+ }
+
+ /**
+ * Get a list of substituted fonts used when a font is not available in mPDF
+ *
+ * @return array Multidimensional array with keys 'sans_fonts', 'serif_fonts', and 'mono_fonts'
+ */
+ public function getFontFamilySubstitution()
+ {
+ return [
+ 'sans_fonts' => [
+ 'garuda',
+ ],
+ ];
+ }
+
+ /**
+ * Get the line-breaking dictionaries the package provides
+ *
+ * @return array mPDF shaper letter => absolute .dat path
+ */
+ public function getLineBreakDictionaries()
+ {
+ return [
+ 'T' => __DIR__ . '/fonts/linebrdictT.dat', /* Thai */
+ ];
+ }
+}
diff --git a/packages/Garuda/composer.json b/packages/Garuda/composer.json
new file mode 100644
index 000000000..16e2107c8
--- /dev/null
+++ b/packages/Garuda/composer.json
@@ -0,0 +1,21 @@
+{
+ "name": "mpdf/font-garuda",
+ "version": "0.1",
+ "type": "library",
+ "description": "Garuda is a serif font designed to display Thai script. Supported scripts include: Thai and Latin.",
+ "keywords": ["mpdf", "mpdf-fonts"],
+ "license": ["MIT"],
+ "autoload": {
+ "psr-4": {
+ "Mpdf\\Fonts\\Garuda\\": ""
+ }
+ },
+ "require": {
+ "mpdf/mpdf": "*"
+ },
+ "extra": {
+ "mpdf": {
+ "fonts": "\\Mpdf\\Fonts\\Garuda\\Registration"
+ }
+ }
+}
\ No newline at end of file
diff --git a/ttfonts/Garuda-Bold.ttf b/packages/Garuda/fonts/Garuda-Bold.ttf
similarity index 100%
rename from ttfonts/Garuda-Bold.ttf
rename to packages/Garuda/fonts/Garuda-Bold.ttf
diff --git a/ttfonts/Garuda-BoldOblique.ttf b/packages/Garuda/fonts/Garuda-BoldOblique.ttf
similarity index 100%
rename from ttfonts/Garuda-BoldOblique.ttf
rename to packages/Garuda/fonts/Garuda-BoldOblique.ttf
diff --git a/ttfonts/Garuda-Oblique.ttf b/packages/Garuda/fonts/Garuda-Oblique.ttf
similarity index 100%
rename from ttfonts/Garuda-Oblique.ttf
rename to packages/Garuda/fonts/Garuda-Oblique.ttf
diff --git a/ttfonts/Garuda.ttf b/packages/Garuda/fonts/Garuda.ttf
similarity index 100%
rename from ttfonts/Garuda.ttf
rename to packages/Garuda/fonts/Garuda.ttf
diff --git a/packages/Garuda/fonts/LICENSE.txt b/packages/Garuda/fonts/LICENSE.txt
new file mode 100644
index 000000000..b94b84222
--- /dev/null
+++ b/packages/Garuda/fonts/LICENSE.txt
@@ -0,0 +1,7 @@
+Embedded copyright information in the font file says:
+
+Generated by NECTEC for Public Domain
+Modified under GNU General Public License by TLWG
+
+http://www.hawaii.edu/thai/thaifonts/ (https://web.archive.org/web/20071013110714/http://hawaii.edu/thai/thaifonts/)
+
diff --git a/data/linebrdictT.dat b/packages/Garuda/fonts/linebrdictT.dat
similarity index 100%
rename from data/linebrdictT.dat
rename to packages/Garuda/fonts/linebrdictT.dat
diff --git a/packages/Jomolhari/Languages.php b/packages/Jomolhari/Languages.php
new file mode 100644
index 000000000..6e353eeaf
--- /dev/null
+++ b/packages/Jomolhari/Languages.php
@@ -0,0 +1,27 @@
+WriteHTML('
+
+
+Hello World in jomolhari
+');
+
+$mpdf->OutputHttpDownload('example.pdf');
+```
+
+## Advanced Installation
+
+To manually register the font package with mPDF, you can initialize the package's `Registration` class and pass it to the `FontRegistry` constructor:
+
+```php
+ $registry
+]);
+```
+
+## License
+
+This package is licensed under the MIT License. Fonts are licensed separately by their authors, and can be found in the [`/fonts/LICENSE.txt`](./fonts/LICENSE.txt) file.
\ No newline at end of file
diff --git a/packages/Jomolhari/Registration.php b/packages/Jomolhari/Registration.php
new file mode 100644
index 000000000..1d89cf945
--- /dev/null
+++ b/packages/Jomolhari/Registration.php
@@ -0,0 +1,73 @@
+ 0xFF, Enable use of OTL features.
+ * ['useKashida'] => 75, Enable use of kashida for text justification in Arabic text
+ *
+ * If a .ttc TrueType collection file is referenced, the number of the font
+ * within the collection is required. Fonts in the collection are numbered
+ * starting at 1, as they appear in the .ttc file.
+ *
+ * @return array{
+ * 'R': string,
+ * 'B'?: string,
+ * 'I'?: string,
+ * 'BI'?: string,
+ * 'sip-ext'?: string,
+ * 'useOTL'?: int,
+ * 'useKashida'?: int,
+ * 'TTCfontID'?: array{
+ * 'R': int,
+ * 'B'?: int,
+ * 'I'?: int,
+ * 'BI'?: int,
+ * }
+ * }
+ */
+ public function getFonts()
+ {
+ return [
+ 'jomolhari' => [
+ 'R' => 'Jomolhari-Regular.ttf',
+ 'useOTL' => 0xFF,
+ ],
+ ];
+ }
+
+ /**
+ * Get the Language Package LanguageToFont implementation
+ *
+ * @return \Mpdf\Language\LanguageToFontInterface|null
+ */
+ public function getLanguageToFont()
+ {
+ return new Languages();
+ }
+}
diff --git a/packages/Jomolhari/composer.json b/packages/Jomolhari/composer.json
new file mode 100644
index 000000000..e98dc05bc
--- /dev/null
+++ b/packages/Jomolhari/composer.json
@@ -0,0 +1,21 @@
+{
+ "name": "mpdf/font-jomolhari",
+ "version": "0.1",
+ "type": "library",
+ "description": "Jomolhari was designed by Christopher Fynn for displaying Tibetan and Dzongkha text. Supported scripts include: Latin and Tibetan.",
+ "keywords": ["mpdf", "mpdf-fonts"],
+ "license": ["MIT"],
+ "autoload": {
+ "psr-4": {
+ "Mpdf\\Fonts\\Jomolhari\\": ""
+ }
+ },
+ "require": {
+ "mpdf/mpdf": "*"
+ },
+ "extra": {
+ "mpdf": {
+ "fonts": "\\Mpdf\\Fonts\\Jomolhari\\Registration"
+ }
+ }
+}
\ No newline at end of file
diff --git a/ttfonts/Jomolhari.ttf b/packages/Jomolhari/fonts/Jomolhari-Regular.ttf
similarity index 53%
rename from ttfonts/Jomolhari.ttf
rename to packages/Jomolhari/fonts/Jomolhari-Regular.ttf
index ca695b61d..0071b200a 100644
Binary files a/ttfonts/Jomolhari.ttf and b/packages/Jomolhari/fonts/Jomolhari-Regular.ttf differ
diff --git a/packages/Jomolhari/fonts/LICENSE.txt b/packages/Jomolhari/fonts/LICENSE.txt
new file mode 100644
index 000000000..483467039
--- /dev/null
+++ b/packages/Jomolhari/fonts/LICENSE.txt
@@ -0,0 +1,96 @@
+This Font Software is Copyright (c) 2006, Christopher J Fynn
+All Rights Reserved.
+
+"Jomolhari" is a Reserved Font Name for this Font Software.
+
+This Font Software is licensed under the SIL Open Font License, Version 1.1.
+This license is copied below, and is also available with a FAQ at:
+https://openfontlicense.org
+
+
+-----------------------------------------------------------
+SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
+-----------------------------------------------------------
+
+PREAMBLE
+The goals of the Open Font License (OFL) are to stimulate worldwide
+development of collaborative font projects, to support the font creation
+efforts of academic and linguistic communities, and to provide a free and
+open framework in which fonts may be shared and improved in partnership
+with others.
+
+The OFL allows the licensed fonts to be used, studied, modified and
+redistributed freely as long as they are not sold by themselves. The
+fonts, including any derivative works, can be bundled, embedded,
+redistributed and/or sold with any software provided that any reserved
+names are not used by derivative works. The fonts and derivatives,
+however, cannot be released under any other type of license. The
+requirement for fonts to remain under this license does not apply
+to any document created using the fonts or their derivatives.
+
+DEFINITIONS
+"Font Software" refers to the set of files released by the Copyright
+Holder(s) under this license and clearly marked as such. This may
+include source files, build scripts and documentation.
+
+"Reserved Font Name" refers to any names specified as such after the
+copyright statement(s).
+
+"Original Version" refers to the collection of Font Software components as
+distributed by the Copyright Holder(s).
+
+"Modified Version" refers to any derivative made by adding to, deleting,
+or substituting -- in part or in whole -- any of the components of the
+Original Version, by changing formats or by porting the Font Software to a
+new environment.
+
+"Author" refers to any designer, engineer, programmer, technical
+writer or other person who contributed to the Font Software.
+
+PERMISSION & CONDITIONS
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of the Font Software, to use, study, copy, merge, embed, modify,
+redistribute, and sell modified and unmodified copies of the Font
+Software, subject to the following conditions:
+
+1) Neither the Font Software nor any of its individual components,
+in Original or Modified Versions, may be sold by itself.
+
+2) Original or Modified Versions of the Font Software may be bundled,
+redistributed and/or sold with any software, provided that each copy
+contains the above copyright notice and this license. These can be
+included either as stand-alone text files, human-readable headers or
+in the appropriate machine-readable metadata fields within text or
+binary files as long as those fields can be easily viewed by the user.
+
+3) No Modified Version of the Font Software may use the Reserved Font
+Name(s) unless explicit written permission is granted by the corresponding
+Copyright Holder. This restriction only applies to the primary font name as
+presented to the users.
+
+4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
+Software shall not be used to promote, endorse or advertise any
+Modified Version, except to acknowledge the contribution(s) of the
+Copyright Holder(s) and the Author(s) or with their explicit written
+permission.
+
+5) The Font Software, modified or unmodified, in part or in whole,
+must be distributed entirely under this license, and must not be
+distributed under any other license. The requirement for fonts to
+remain under this license does not apply to any document created
+using the Font Software.
+
+TERMINATION
+This license becomes null and void if any of the above conditions are
+not met.
+
+DISCLAIMER
+THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
+OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
+COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
+DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
+OTHER DEALINGS IN THE FONT SOFTWARE.
diff --git a/packages/Kaputa-Unicode/Languages.php b/packages/Kaputa-Unicode/Languages.php
new file mode 100644
index 000000000..3333d1a2a
--- /dev/null
+++ b/packages/Kaputa-Unicode/Languages.php
@@ -0,0 +1,23 @@
+WriteHTML('
+
+
+Hello World in kaputaunicode
+');
+
+$mpdf->OutputHttpDownload('example.pdf');
+```
+
+## Advanced Installation
+
+To manually register the font package with mPDF, you can initialize the package's `Registration` class and pass it to the `FontRegistry` constructor:
+
+```php
+ $registry
+]);
+```
+
+## License
+
+This package is licensed under the MIT License. Fonts are licensed separately by their authors, and can be found in the [`/fonts/LICENSE.txt`](./fonts/LICENSE.txt) file.
\ No newline at end of file
diff --git a/packages/Kaputa-Unicode/Registration.php b/packages/Kaputa-Unicode/Registration.php
new file mode 100644
index 000000000..9d8749021
--- /dev/null
+++ b/packages/Kaputa-Unicode/Registration.php
@@ -0,0 +1,73 @@
+ 0xFF, Enable use of OTL features.
+ * ['useKashida'] => 75, Enable use of kashida for text justification in Arabic text
+ *
+ * If a .ttc TrueType collection file is referenced, the number of the font
+ * within the collection is required. Fonts in the collection are numbered
+ * starting at 1, as they appear in the .ttc file.
+ *
+ * @return array{
+ * 'R': string,
+ * 'B'?: string,
+ * 'I'?: string,
+ * 'BI'?: string,
+ * 'sip-ext'?: string,
+ * 'useOTL'?: int,
+ * 'useKashida'?: int,
+ * 'TTCfontID'?: array{
+ * 'R': int,
+ * 'B'?: int,
+ * 'I'?: int,
+ * 'BI'?: int,
+ * }
+ * }
+ */
+ public function getFonts()
+ {
+ return [
+ 'kaputaunicode' => [
+ 'R' => 'kaputaunicode.ttf',
+ 'useOTL' => 0xFF,
+ ],
+ ];
+ }
+
+ /**
+ * Get the Language Package LanguageToFont implementation
+ *
+ * @return \Mpdf\Language\LanguageToFontInterface|null
+ */
+ public function getLanguageToFont()
+ {
+ return new Languages();
+ }
+}
diff --git a/packages/Kaputa-Unicode/composer.json b/packages/Kaputa-Unicode/composer.json
new file mode 100644
index 000000000..24c879cff
--- /dev/null
+++ b/packages/Kaputa-Unicode/composer.json
@@ -0,0 +1,21 @@
+{
+ "name": "mpdf/font-kaputa-unicode",
+ "version": "0.1",
+ "type": "library",
+ "description": "Kaputa is one the most known and widely used Sinhala Unicode fonts. Supported scripts include: Sinhala and Latin.",
+ "keywords": ["mpdf", "mpdf-fonts"],
+ "license": ["MIT"],
+ "autoload": {
+ "psr-4": {
+ "Mpdf\\Fonts\\KaputaUnicode\\": ""
+ }
+ },
+ "require": {
+ "mpdf/mpdf": "*"
+ },
+ "extra": {
+ "mpdf": {
+ "fonts": "\\Mpdf\\Fonts\\KaputaUnicode\\Registration"
+ }
+ }
+}
\ No newline at end of file
diff --git a/packages/Kaputa-Unicode/fonts/LICENSE.txt b/packages/Kaputa-Unicode/fonts/LICENSE.txt
new file mode 100644
index 000000000..fe51d0306
--- /dev/null
+++ b/packages/Kaputa-Unicode/fonts/LICENSE.txt
@@ -0,0 +1 @@
+Released as a free unicode font on https://kaputa.com/slword/kaputaunicode.htm.
\ No newline at end of file
diff --git a/ttfonts/kaputaunicode.ttf b/packages/Kaputa-Unicode/fonts/kaputaunicode.ttf
similarity index 100%
rename from ttfonts/kaputaunicode.ttf
rename to packages/Kaputa-Unicode/fonts/kaputaunicode.ttf
diff --git a/packages/Khmer-OS/Languages.php b/packages/Khmer-OS/Languages.php
new file mode 100644
index 000000000..58bbef31e
--- /dev/null
+++ b/packages/Khmer-OS/Languages.php
@@ -0,0 +1,23 @@
+WriteHTML('
+
+
+Hello World in khmeros
+');
+
+$mpdf->OutputHttpDownload('example.pdf');
+```
+
+## Advanced Installation
+
+To manually register the font package with mPDF, you can initialize the package's `Registration` class and pass it to the `FontRegistry` constructor:
+
+```php
+ $registry
+]);
+```
+
+## License
+
+This package is licensed under the MIT License. Fonts are licensed separately by their authors, and can be found in the [`/fonts/LICENSE.txt`](./fonts/LICENSE.txt) file.
\ No newline at end of file
diff --git a/packages/Khmer-OS/Registration.php b/packages/Khmer-OS/Registration.php
new file mode 100644
index 000000000..0ce4dae8b
--- /dev/null
+++ b/packages/Khmer-OS/Registration.php
@@ -0,0 +1,85 @@
+ 0xFF, Enable use of OTL features.
+ * ['useKashida'] => 75, Enable use of kashida for text justification in Arabic text
+ *
+ * If a .ttc TrueType collection file is referenced, the number of the font
+ * within the collection is required. Fonts in the collection are numbered
+ * starting at 1, as they appear in the .ttc file.
+ *
+ * @return array{
+ * 'R': string,
+ * 'B'?: string,
+ * 'I'?: string,
+ * 'BI'?: string,
+ * 'sip-ext'?: string,
+ * 'useOTL'?: int,
+ * 'useKashida'?: int,
+ * 'TTCfontID'?: array{
+ * 'R': int,
+ * 'B'?: int,
+ * 'I'?: int,
+ * 'BI'?: int,
+ * }
+ * }
+ */
+ public function getFonts()
+ {
+ return [
+ 'khmeros' => [
+ 'R' => 'KhmerOS.ttf',
+ 'useOTL' => 0xFF,
+ ],
+ ];
+ }
+
+ /**
+ * Get the Language Package LanguageToFont implementation
+ *
+ * @return \Mpdf\Language\LanguageToFontInterface|null
+ */
+ public function getLanguageToFont()
+ {
+ return new Languages();
+ }
+
+ /**
+ * Get the line-breaking dictionaries the package provides
+ *
+ * @return array mPDF shaper letter => absolute .dat path
+ */
+ public function getLineBreakDictionaries()
+ {
+ return [
+ 'K' => __DIR__ . '/fonts/linebrdictK.dat', /* Khmer */
+ ];
+ }
+}
diff --git a/packages/Khmer-OS/composer.json b/packages/Khmer-OS/composer.json
new file mode 100644
index 000000000..ee3dc3730
--- /dev/null
+++ b/packages/Khmer-OS/composer.json
@@ -0,0 +1,21 @@
+{
+ "name": "mpdf/font-khmer-os",
+ "version": "0.1",
+ "type": "library",
+ "description": "A font for the Khmer language of Cambodia. Supported scripts include: Khmer and Latin.",
+ "keywords": ["mpdf", "mpdf-fonts"],
+ "license": ["MIT"],
+ "autoload": {
+ "psr-4": {
+ "Mpdf\\Fonts\\KhmerOs\\": ""
+ }
+ },
+ "require": {
+ "mpdf/mpdf": "*"
+ },
+ "extra": {
+ "mpdf": {
+ "fonts": "\\Mpdf\\Fonts\\KhmerOs\\Registration"
+ }
+ }
+}
\ No newline at end of file
diff --git a/ttfonts/KhmerOS.ttf b/packages/Khmer-OS/fonts/KhmerOS.ttf
similarity index 100%
rename from ttfonts/KhmerOS.ttf
rename to packages/Khmer-OS/fonts/KhmerOS.ttf
diff --git a/packages/Khmer-OS/fonts/LICENSE.txt b/packages/Khmer-OS/fonts/LICENSE.txt
new file mode 100644
index 000000000..022c3ca7d
--- /dev/null
+++ b/packages/Khmer-OS/fonts/LICENSE.txt
@@ -0,0 +1,9 @@
+KhmerOS - font for the Khmer language of Cambodia
+Copyright 2005 Danh Hong
+Copyright 2005 Open Forum of Cambodia
+
+This font is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.
+
+This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.? See the GNU Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with this font; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or visit http://www.gnu.org/licenses/lgpl.html
\ No newline at end of file
diff --git a/data/linebrdictK.dat b/packages/Khmer-OS/fonts/linebrdictK.dat
similarity index 100%
rename from data/linebrdictK.dat
rename to packages/Khmer-OS/fonts/linebrdictK.dat
diff --git a/packages/Lanna-Alif/Languages.php b/packages/Lanna-Alif/Languages.php
new file mode 100644
index 000000000..8842e58a0
--- /dev/null
+++ b/packages/Lanna-Alif/Languages.php
@@ -0,0 +1,38 @@
+fontByScript($script);
+ }
+
+ return '';
+ }
+
+ protected function fontByScript($script)
+ {
+ switch ($script) {
+ // TAI_THAM
+ case 'lana':
+ return 'lannaalif';
+ }
+
+ return '';
+ }
+}
diff --git a/packages/Lanna-Alif/README.md b/packages/Lanna-Alif/README.md
new file mode 100644
index 000000000..566c3670e
--- /dev/null
+++ b/packages/Lanna-Alif/README.md
@@ -0,0 +1,63 @@
+# mPDF Font Package
+
+## Introduction
+
+Lanna Alif is a Unicode font for the Tai Tham script. This package is used with the [mPDF library](https://github.com/mpdf/mpdf).
+
+**Supported Scripts**:
+* Tai Tham
+* Latin
+
+## Installation
+
+```bash
+composer require mpdf/font-lanna-alif
+```
+
+## Usage
+
+This package automatically registers the following fonts with mPDF:
+
+- `lannaalif`
+
+Example usage in mPDF:
+```php
+WriteHTML('
+
+
+Hello World in lannaalif
+');
+
+$mpdf->OutputHttpDownload('example.pdf');
+```
+
+## Advanced Installation
+
+To manually register the font package with mPDF, you can initialize the package's `Registration` class and pass it to the `FontRegistry` constructor:
+
+```php
+ $registry
+]);
+```
+
+## License
+
+This package is licensed under the MIT License. Fonts are licensed separately by their authors, and can be found in the [`/fonts/LICENSE.txt`](./fonts/LICENSE.txt) file.
\ No newline at end of file
diff --git a/packages/Lanna-Alif/Registration.php b/packages/Lanna-Alif/Registration.php
new file mode 100644
index 000000000..09126ce53
--- /dev/null
+++ b/packages/Lanna-Alif/Registration.php
@@ -0,0 +1,73 @@
+ 0xFF, Enable use of OTL features.
+ * ['useKashida'] => 75, Enable use of kashida for text justification in Arabic text
+ *
+ * If a .ttc TrueType collection file is referenced, the number of the font
+ * within the collection is required. Fonts in the collection are numbered
+ * starting at 1, as they appear in the .ttc file.
+ *
+ * @return array{
+ * 'R': string,
+ * 'B'?: string,
+ * 'I'?: string,
+ * 'BI'?: string,
+ * 'sip-ext'?: string,
+ * 'useOTL'?: int,
+ * 'useKashida'?: int,
+ * 'TTCfontID'?: array{
+ * 'R': int,
+ * 'B'?: int,
+ * 'I'?: int,
+ * 'BI'?: int,
+ * }
+ * }
+ */
+ public function getFonts()
+ {
+ return [
+ 'lannaalif' => [
+ 'R' => 'lannaalif-v1-03.ttf',
+ 'useOTL' => 0xFF,
+ ],
+ ];
+ }
+
+ /**
+ * Get the Language Package LanguageToFont implementation
+ *
+ * @return \Mpdf\Language\LanguageToFontInterface|null
+ */
+ public function getLanguageToFont()
+ {
+ return new Languages();
+ }
+}
diff --git a/packages/Lanna-Alif/composer.json b/packages/Lanna-Alif/composer.json
new file mode 100644
index 000000000..530c90eb4
--- /dev/null
+++ b/packages/Lanna-Alif/composer.json
@@ -0,0 +1,21 @@
+{
+ "name": "mpdf/font-lanna-alif",
+ "version": "0.1",
+ "type": "library",
+ "description": "Lanna Alif is a Unicode font created by Alif Silpachai for the Tai Tham script. Supported scripts include: Tai Tham and Latin",
+ "keywords": ["mpdf", "mpdf-fonts"],
+ "license": ["MIT"],
+ "autoload": {
+ "psr-4": {
+ "Mpdf\\Fonts\\LannaAlif\\": ""
+ }
+ },
+ "require": {
+ "mpdf/mpdf": "*"
+ },
+ "extra": {
+ "mpdf": {
+ "fonts": "\\Mpdf\\Fonts\\LannaAlif\\Registration"
+ }
+ }
+}
\ No newline at end of file
diff --git a/packages/Lanna-Alif/fonts/LICENSE.txt b/packages/Lanna-Alif/fonts/LICENSE.txt
new file mode 100644
index 000000000..8beeb57c8
--- /dev/null
+++ b/packages/Lanna-Alif/fonts/LICENSE.txt
@@ -0,0 +1,3 @@
+Unknown.
+
+https://web.archive.org/web/20160303201205/http://www.geocities.jp/simsheart_alif/taithamunicode.html
\ No newline at end of file
diff --git a/ttfonts/lannaalif-v1-03.ttf b/packages/Lanna-Alif/fonts/lannaalif-v1-03.ttf
similarity index 100%
rename from ttfonts/lannaalif-v1-03.ttf
rename to packages/Lanna-Alif/fonts/lannaalif-v1-03.ttf
diff --git a/packages/Lohit-Kannada/Languages.php b/packages/Lohit-Kannada/Languages.php
new file mode 100644
index 000000000..4a3311b39
--- /dev/null
+++ b/packages/Lohit-Kannada/Languages.php
@@ -0,0 +1,23 @@
+WriteHTML('
+
+
+Hello World in lohitkannada
+');
+
+$mpdf->OutputHttpDownload('example.pdf');
+```
+
+## Advanced Installation
+
+To manually register the font package with mPDF, you can initialize the package's `Registration` class and pass it to the `FontRegistry` constructor:
+
+```php
+ $registry
+]);
+```
+
+## License
+
+This package is licensed under the MIT License. Fonts are licensed separately by their authors, and can be found in the [`/fonts/LICENSE.txt`](./fonts/LICENSE.txt) file.
\ No newline at end of file
diff --git a/packages/Lohit-Kannada/Registration.php b/packages/Lohit-Kannada/Registration.php
new file mode 100644
index 000000000..7b887f187
--- /dev/null
+++ b/packages/Lohit-Kannada/Registration.php
@@ -0,0 +1,73 @@
+ 0xFF, Enable use of OTL features.
+ * ['useKashida'] => 75, Enable use of kashida for text justification in Arabic text
+ *
+ * If a .ttc TrueType collection file is referenced, the number of the font
+ * within the collection is required. Fonts in the collection are numbered
+ * starting at 1, as they appear in the .ttc file.
+ *
+ * @return array{
+ * 'R': string,
+ * 'B'?: string,
+ * 'I'?: string,
+ * 'BI'?: string,
+ * 'sip-ext'?: string,
+ * 'useOTL'?: int,
+ * 'useKashida'?: int,
+ * 'TTCfontID'?: array{
+ * 'R': int,
+ * 'B'?: int,
+ * 'I'?: int,
+ * 'BI'?: int,
+ * }
+ * }
+ */
+ public function getFonts()
+ {
+ return [
+ 'lohitkannada' => [
+ 'R' => 'Lohit-Kannada.ttf',
+ 'useOTL' => 0xFF,
+ ],
+ ];
+ }
+
+ /**
+ * Get the Language Package LanguageToFont implementation
+ *
+ * @return \Mpdf\Language\LanguageToFontInterface|null
+ */
+ public function getLanguageToFont()
+ {
+ return new Languages();
+ }
+}
diff --git a/packages/Lohit-Kannada/composer.json b/packages/Lohit-Kannada/composer.json
new file mode 100644
index 000000000..2cb6428c4
--- /dev/null
+++ b/packages/Lohit-Kannada/composer.json
@@ -0,0 +1,21 @@
+{
+ "name": "mpdf/font-lohit-kannada",
+ "version": "0.1",
+ "type": "library",
+ "description": "Lohit Kannada is a Unicode font. Supported scripts include: Kannada",
+ "keywords": ["mpdf", "mpdf-fonts"],
+ "license": ["MIT"],
+ "autoload": {
+ "psr-4": {
+ "Mpdf\\Fonts\\LohitKannada\\": ""
+ }
+ },
+ "require": {
+ "mpdf/mpdf": "*"
+ },
+ "extra": {
+ "mpdf": {
+ "fonts": "\\Mpdf\\Fonts\\LohitKannada\\Registration"
+ }
+ }
+}
\ No newline at end of file
diff --git a/ttfonts/LohitKannadaOFL.txt b/packages/Lohit-Kannada/fonts/LICENSE.txt
similarity index 99%
rename from ttfonts/LohitKannadaOFL.txt
rename to packages/Lohit-Kannada/fonts/LICENSE.txt
index 01b830782..55f0c153a 100644
--- a/ttfonts/LohitKannadaOFL.txt
+++ b/packages/Lohit-Kannada/fonts/LICENSE.txt
@@ -19,7 +19,7 @@ with others.
The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves. The
-fonts, including any derivative works, can be bundled, embedded,
+fonts, including any derivative works, can be bundled, embedded,
redistributed and/or sold with any software provided that any reserved
names are not used by derivative works. The fonts and derivatives,
however, cannot be released under any other type of license. The
diff --git a/ttfonts/Lohit-Kannada.ttf b/packages/Lohit-Kannada/fonts/Lohit-Kannada.ttf
similarity index 100%
rename from ttfonts/Lohit-Kannada.ttf
rename to packages/Lohit-Kannada/fonts/Lohit-Kannada.ttf
diff --git a/packages/Middle-East-Scripts-Bundle/Languages.php b/packages/Middle-East-Scripts-Bundle/Languages.php
new file mode 100644
index 000000000..0fdca5ec0
--- /dev/null
+++ b/packages/Middle-East-Scripts-Bundle/Languages.php
@@ -0,0 +1,76 @@
+fontByScript($script);
+ }
+
+ return '';
+ }
+
+ protected function fontByScript($script)
+ {
+ switch ($script) {
+ case 'arab': // ARABIC
+ return 'xbriyaz';
+ }
+
+ return '';
+ }
+}
diff --git a/packages/Middle-East-Scripts-Bundle/README.md b/packages/Middle-East-Scripts-Bundle/README.md
new file mode 100644
index 000000000..3389e1af7
--- /dev/null
+++ b/packages/Middle-East-Scripts-Bundle/README.md
@@ -0,0 +1,79 @@
+# mPDF Font Package
+
+## Introduction
+
+An mPDF scripts bundle designed for middle-eastern languages. This package is used with the [mPDF library](https://github.com/mpdf/mpdf).
+
+**Supported Scripts**:
+* Latin
+* Arabic
+* Hebrew
+* Syriac
+
+## Installation
+
+```bash
+composer require mpdf/font-middle-east-scripts-bundle
+```
+
+## Usage
+
+This package automatically registers the following fonts with mPDF:
+
+- `lateef`
+- `xbriyaz`
+- `estrangeloedessa`
+- `taameydavidclm`
+
+Example usage in mPDF:
+```php
+WriteHTML('
+
+
+Hello World in xbriyaz
+
+Some text in taameydavidclm
+');
+
+$mpdf->OutputHttpDownload('example.pdf');
+```
+
+## Advanced Installation
+
+To manually register the font package with mPDF, you can initialize the package's `Registration` class and pass it to the `FontRegistry` constructor:
+
+```php
+ $registry
+]);
+```
+
+## License
+
+This package is licensed under the MIT License. Fonts are licensed separately by their authors, and can be found in following license files:
+
+- `lateef`: [LICENSE-Lateef.txt](./fonts/LICENSE-Lateef.txt)
+- `xbriyaz`: [LICENSE-XB-Riyaz.txt](./fonts/LICENSE-XB-Riyaz.txt)
+- `estrangeloedessa`: [LICENSE-Estrangelo-Edessa.txt](./fonts/LICENSE-Estrangelo-Edessa.txt)
+- `taameydavidclm`: [LICENSE-TaameyDavidCLM.txt](./fonts/LICENSE-TaameyDavidCLM.txt)
\ No newline at end of file
diff --git a/packages/Middle-East-Scripts-Bundle/Registration.php b/packages/Middle-East-Scripts-Bundle/Registration.php
new file mode 100644
index 000000000..ffc99f1d4
--- /dev/null
+++ b/packages/Middle-East-Scripts-Bundle/Registration.php
@@ -0,0 +1,110 @@
+ 0xFF, Enable use of OTL features.
+ * ['useKashida'] => 75, Enable use of kashida for text justification in Arabic text
+ *
+ * If a .ttc TrueType collection file is referenced, the number of the font
+ * within the collection is required. Fonts in the collection are numbered
+ * starting at 1, as they appear in the .ttc file.
+ *
+ * @return array{
+ * 'R': string,
+ * 'B'?: string,
+ * 'I'?: string,
+ * 'BI'?: string,
+ * 'sip-ext'?: string,
+ * 'useOTL'?: int,
+ * 'useKashida'?: int,
+ * 'TTCfontID'?: array{
+ * 'R': int,
+ * 'B'?: int,
+ * 'I'?: int,
+ * 'BI'?: int,
+ * }
+ * }
+ */
+ public function getFonts()
+ {
+ return [
+ /* Sindhi, Pashto and Urdu */
+ 'lateef' => [
+ 'R' => 'LateefRegOT.ttf',
+ 'useOTL' => 0xFF,
+ 'useKashida' => 75,
+ ],
+
+ /* Arabic / Persian (Farsi) */
+ 'xbriyaz' => [
+ 'R' => 'XB Riyaz.ttf',
+ 'B' => 'XB RiyazBd.ttf',
+ 'I' => 'XB RiyazIt.ttf',
+ 'BI' => 'XB RiyazBdIt.ttf',
+ 'useOTL' => 0xFF,
+ 'useKashida' => 75,
+ ],
+
+ /* Syriac */
+ 'estrangeloedessa' => [
+ 'R' => 'Estrangelo-Edessa.otf',
+ 'useOTL' => 0xFF,
+ ],
+
+ /* Hebrew with full Niqud and Cantillation */
+ 'taameydavidclm' => [
+ 'R' => 'TaameyDavidCLM-Medium.ttf',
+ 'useOTL' => 0xFF,
+ ],
+ ];
+ }
+
+ /**
+ * Get the Language Package LanguageToFont implementation
+ *
+ * @return \Mpdf\Language\LanguageToFontInterface|null
+ */
+ public function getLanguageToFont()
+ {
+ return new Languages();
+ }
+
+ /**
+ * Define fonts to be used for character substitution, when the useSubstitutions configuration option enabled
+ *
+ * @return array The list of fonts to exclude using the keys found in $this->getFontData()
+ */
+ public function getBackupSubsFonts()
+ {
+ return [
+ 'xbriyaz',
+ 'taameydavidclm',
+ ];
+ }
+}
diff --git a/packages/Middle-East-Scripts-Bundle/composer.json b/packages/Middle-East-Scripts-Bundle/composer.json
new file mode 100644
index 000000000..1ab185d71
--- /dev/null
+++ b/packages/Middle-East-Scripts-Bundle/composer.json
@@ -0,0 +1,21 @@
+{
+ "name": "mpdf/font-middle-east-scripts-bundle",
+ "version": "0.1",
+ "type": "library",
+ "description": "An mPDF scripts bundle designed for middle-eastern languages. Supported scripts include: Latin, Arabic, Hebrew, and Syriac.",
+ "keywords": ["mpdf", "mpdf-fonts"],
+ "license": ["MIT"],
+ "autoload": {
+ "psr-4": {
+ "Mpdf\\Fonts\\ArabicScriptsBundle\\": ""
+ }
+ },
+ "require": {
+ "mpdf/mpdf": "*"
+ },
+ "extra": {
+ "mpdf": {
+ "fonts": "\\Mpdf\\Fonts\\ArabicScriptsBundle\\Registration"
+ }
+ }
+}
\ No newline at end of file
diff --git a/ttfonts/SyrCOMEdessa.otf b/packages/Middle-East-Scripts-Bundle/fonts/Estrangelo-Edessa.otf
similarity index 100%
rename from ttfonts/SyrCOMEdessa.otf
rename to packages/Middle-East-Scripts-Bundle/fonts/Estrangelo-Edessa.otf
diff --git a/packages/Middle-East-Scripts-Bundle/fonts/LICENSE-Estrangelo-Edessa.txt b/packages/Middle-East-Scripts-Bundle/fonts/LICENSE-Estrangelo-Edessa.txt
new file mode 100644
index 000000000..ad1ebbfae
--- /dev/null
+++ b/packages/Middle-East-Scripts-Bundle/fonts/LICENSE-Estrangelo-Edessa.txt
@@ -0,0 +1,61 @@
+This license is derived from the Bigelow & Holmes Font License
+found at http://www.xfree86.org/current/LICENSE2.html
+
+The following reasonable modifications have been made to the
+Bigelow & Holmes Font License:
+
+* All references to Luxi have been replaced with Meltho
+
+* All references to Bigelow & Holmes Inc. and URW++ GmbH haven
+ been replaced with Beth Mardutho: The Syriac Institute
+
+* The registered trademark notice belonging to Bigelow & Holmes
+ Inc. has been removed
+
+* Contact information has been modified to show that the
+ contact person for these fonts is the Director of the
+ Institute, George Kiraz.
+
+-------------------------------------------------------------
+
+Meltho fonts and font code copyright © 2002 by Beth Mardutho:
+The Syriac Institute. All Right Reserved.
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of these Fonts and associated documentation
+files (the "Font Software"), to deal in the Font Software,
+including without limitation the rights to use, copy, merge,
+publish, distribute, sublicense, and/or sell copies of the
+Font Software, and to permit persons to whom the Font Software
+is furnished to do so, subject to the following conditions:
+
+The above copyright and trademark notices and this permission
+notice shall be included in all copies of one or more of the
+Font Software.
+
+The Font Software may not be modified, altered, or added to,
+and in particular the designs of glyphs or characters in the
+Fonts may not be modified nor may additional glyphs or
+characters be added to the Fonts. This License becomes null
+and void when the Fonts or Font Software have been modified.
+
+THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
+KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY
+WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
+AND NONINFRINGEMENT OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER
+RIGHT. IN NO EVENT SHALL BETH MARDUTHO: THE SYRIAC INSTITUTE BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY
+GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR
+FROM OTHER DEALINGS IN THE FONT SOFTWARE.
+
+Except as contained in this notice, the name of Beth Mardutho:
+The Syriac Institute shall not be used in advertising or otherwise
+to promote the sale, use or other dealings in this Font Software
+without prior written authorization from Beth Mardutho: The
+Syriac Institute.
+
+For further information, contact:
+George Kiraz, Director of Beth Mardutho
+gkiraz@bethmardutho.org
diff --git a/packages/Middle-East-Scripts-Bundle/fonts/LICENSE-Lateef.txt b/packages/Middle-East-Scripts-Bundle/fonts/LICENSE-Lateef.txt
new file mode 100644
index 000000000..7c2ceb9fb
--- /dev/null
+++ b/packages/Middle-East-Scripts-Bundle/fonts/LICENSE-Lateef.txt
@@ -0,0 +1,96 @@
+Copyright (c) 1994-2025, SIL Global (https://www.sil.org/), with
+Reserved Font Names "Lateef" and "SIL".
+Latin glyphs copyright (c) 2018 The Crimson Pro Project Authors
+(https://github.com/Fonthausen/CrimsonPro)
+
+This Font Software is licensed under the SIL Open Font License, Version 1.1.
+This license is copied below, and is also available with a FAQ at:
+https://openfontlicense.org
+
+
+-----------------------------------------------------------
+SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
+-----------------------------------------------------------
+
+PREAMBLE
+The goals of the Open Font License (OFL) are to stimulate worldwide
+development of collaborative font projects, to support the font creation
+efforts of academic and linguistic communities, and to provide a free and
+open framework in which fonts may be shared and improved in partnership
+with others.
+
+The OFL allows the licensed fonts to be used, studied, modified and
+redistributed freely as long as they are not sold by themselves. The
+fonts, including any derivative works, can be bundled, embedded,
+redistributed and/or sold with any software provided that any reserved
+names are not used by derivative works. The fonts and derivatives,
+however, cannot be released under any other type of license. The
+requirement for fonts to remain under this license does not apply
+to any document created using the fonts or their derivatives.
+
+DEFINITIONS
+"Font Software" refers to the set of files released by the Copyright
+Holder(s) under this license and clearly marked as such. This may
+include source files, build scripts and documentation.
+
+"Reserved Font Name" refers to any names specified as such after the
+copyright statement(s).
+
+"Original Version" refers to the collection of Font Software components as
+distributed by the Copyright Holder(s).
+
+"Modified Version" refers to any derivative made by adding to, deleting,
+or substituting -- in part or in whole -- any of the components of the
+Original Version, by changing formats or by porting the Font Software to a
+new environment.
+
+"Author" refers to any designer, engineer, programmer, technical
+writer or other person who contributed to the Font Software.
+
+PERMISSION & CONDITIONS
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of the Font Software, to use, study, copy, merge, embed, modify,
+redistribute, and sell modified and unmodified copies of the Font
+Software, subject to the following conditions:
+
+1) Neither the Font Software nor any of its individual components,
+in Original or Modified Versions, may be sold by itself.
+
+2) Original or Modified Versions of the Font Software may be bundled,
+redistributed and/or sold with any software, provided that each copy
+contains the above copyright notice and this license. These can be
+included either as stand-alone text files, human-readable headers or
+in the appropriate machine-readable metadata fields within text or
+binary files as long as those fields can be easily viewed by the user.
+
+3) No Modified Version of the Font Software may use the Reserved Font
+Name(s) unless explicit written permission is granted by the corresponding
+Copyright Holder. This restriction only applies to the primary font name as
+presented to the users.
+
+4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
+Software shall not be used to promote, endorse or advertise any
+Modified Version, except to acknowledge the contribution(s) of the
+Copyright Holder(s) and the Author(s) or with their explicit written
+permission.
+
+5) The Font Software, modified or unmodified, in part or in whole,
+must be distributed entirely under this license, and must not be
+distributed under any other license. The requirement for fonts to
+remain under this license does not apply to any document created
+using the Font Software.
+
+TERMINATION
+This license becomes null and void if any of the above conditions are
+not met.
+
+DISCLAIMER
+THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
+OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
+COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
+DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
+OTHER DEALINGS IN THE FONT SOFTWARE.
diff --git a/ttfonts/TaameyDavidCLM-LICENSE.txt b/packages/Middle-East-Scripts-Bundle/fonts/LICENSE-TaameyDavidCLM.txt
similarity index 100%
rename from ttfonts/TaameyDavidCLM-LICENSE.txt
rename to packages/Middle-East-Scripts-Bundle/fonts/LICENSE-TaameyDavidCLM.txt
diff --git a/ttfonts/XW Zar Font Info.txt b/packages/Middle-East-Scripts-Bundle/fonts/LICENSE-XB-Riyaz.txt
similarity index 99%
rename from ttfonts/XW Zar Font Info.txt
rename to packages/Middle-East-Scripts-Bundle/fonts/LICENSE-XB-Riyaz.txt
index d42e4544b..78e3f84af 100644
--- a/ttfonts/XW Zar Font Info.txt
+++ b/packages/Middle-East-Scripts-Bundle/fonts/LICENSE-XB-Riyaz.txt
@@ -17,7 +17,7 @@ with others.
The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves. The
-fonts, including any derivative works, can be bundled, embedded,
+fonts, including any derivative works, can be bundled, embedded,
redistributed and/or sold with any software provided that any reserved
names are not used by derivative works. The fonts and derivatives,
however, cannot be released under any other type of license. The
diff --git a/ttfonts/LateefRegOT.ttf b/packages/Middle-East-Scripts-Bundle/fonts/LateefRegOT.ttf
similarity index 100%
rename from ttfonts/LateefRegOT.ttf
rename to packages/Middle-East-Scripts-Bundle/fonts/LateefRegOT.ttf
diff --git a/ttfonts/TaameyDavidCLM-Medium.ttf b/packages/Middle-East-Scripts-Bundle/fonts/TaameyDavidCLM-Medium.ttf
similarity index 100%
rename from ttfonts/TaameyDavidCLM-Medium.ttf
rename to packages/Middle-East-Scripts-Bundle/fonts/TaameyDavidCLM-Medium.ttf
diff --git a/ttfonts/XB Riyaz.ttf b/packages/Middle-East-Scripts-Bundle/fonts/XB Riyaz.ttf
similarity index 100%
rename from ttfonts/XB Riyaz.ttf
rename to packages/Middle-East-Scripts-Bundle/fonts/XB Riyaz.ttf
diff --git a/ttfonts/XB RiyazBd.ttf b/packages/Middle-East-Scripts-Bundle/fonts/XB RiyazBd.ttf
similarity index 100%
rename from ttfonts/XB RiyazBd.ttf
rename to packages/Middle-East-Scripts-Bundle/fonts/XB RiyazBd.ttf
diff --git a/ttfonts/XB RiyazBdIt.ttf b/packages/Middle-East-Scripts-Bundle/fonts/XB RiyazBdIt.ttf
similarity index 100%
rename from ttfonts/XB RiyazBdIt.ttf
rename to packages/Middle-East-Scripts-Bundle/fonts/XB RiyazBdIt.ttf
diff --git a/ttfonts/XB RiyazIt.ttf b/packages/Middle-East-Scripts-Bundle/fonts/XB RiyazIt.ttf
similarity index 100%
rename from ttfonts/XB RiyazIt.ttf
rename to packages/Middle-East-Scripts-Bundle/fonts/XB RiyazIt.ttf
diff --git a/packages/Mph2bDamase/Languages.php b/packages/Mph2bDamase/Languages.php
new file mode 100644
index 000000000..94d078404
--- /dev/null
+++ b/packages/Mph2bDamase/Languages.php
@@ -0,0 +1,45 @@
+fontByScript($script);
+ }
+
+ return '';
+ }
+
+ protected function fontByScript($script)
+ {
+ switch ($script) {
+ case 'glag': // GLAGOLITIC
+ case 'shaw': // SHAVIAN
+ case 'osma': // OSMANYA
+ case 'khar': // KHAROSHTHI
+ case 'dsrt': // DESERET
+ return 'mph2bdamase';
+ }
+
+ return '';
+ }
+}
diff --git a/packages/Mph2bDamase/README.md b/packages/Mph2bDamase/README.md
new file mode 100644
index 000000000..994bccc94
--- /dev/null
+++ b/packages/Mph2bDamase/README.md
@@ -0,0 +1,79 @@
+# mPDF Font Package
+
+## Introduction
+
+MPH 2B Damase serif unicode font created by Mark Williamson. This package is used with the [mPDF library](https://github.com/mpdf/mpdf).
+
+**Supported Scripts**:
+* Latin
+* Greek
+* Cyrillic
+* Armenian
+* Hebrew
+* Arabic
+* Thaana
+* Bengali
+* Georgian
+* Cherokee
+* Hanunoo
+* Limbu
+* Tai Le
+* Buginese
+* Coptic
+* Glagolitic
+* Tifinagh
+* Nagri
+
+## Installation
+
+```bash
+composer require mpdf/font-mph-2b-damase
+```
+
+## Usage
+
+This package automatically registers the following fonts with mPDF:
+
+- `mph2bdamase`
+
+Example usage in mPDF:
+```php
+WriteHTML('
+
+
+Hello World in mph2bdamase
+');
+
+$mpdf->OutputHttpDownload('example.pdf');
+```
+
+## Advanced Installation
+
+To manually register the font package with mPDF, you can initialize the package's `Registration` class and pass it to the `FontRegistry` constructor:
+
+```php
+ $registry
+]);
+```
+
+## License
+
+This package is licensed under the MIT License. Fonts are licensed separately by their authors, and can be found in the [`/fonts/LICENSE.txt`](./fonts/LICENSE.txt) file.
\ No newline at end of file
diff --git a/packages/Mph2bDamase/Registration.php b/packages/Mph2bDamase/Registration.php
new file mode 100644
index 000000000..65d01c1d5
--- /dev/null
+++ b/packages/Mph2bDamase/Registration.php
@@ -0,0 +1,110 @@
+ 0xFF, Enable use of OTL features.
+ * ['useKashida'] => 75, Enable use of kashida for text justification in Arabic text
+ *
+ * If a .ttc TrueType collection file is referenced, the number of the font
+ * within the collection is required. Fonts in the collection are numbered
+ * starting at 1, as they appear in the .ttc file.
+ *
+ * @return array{
+ * 'R': string,
+ * 'B'?: string,
+ * 'I'?: string,
+ * 'BI'?: string,
+ * 'sip-ext'?: string,
+ * 'useOTL'?: int,
+ * 'useKashida'?: int,
+ * 'TTCfontID'?: array{
+ * 'R': int,
+ * 'B'?: int,
+ * 'I'?: int,
+ * 'BI'?: int,
+ * }
+ * }
+ */
+ public function getFonts()
+ {
+ return [
+ 'mph2bdamase' => [
+ 'R' => 'damase_v.2.ttf',
+ ],
+ ];
+ }
+
+ /**
+ * Font alias mapping
+ *
+ * @return array{string, string} [ 'aliasName' => 'fontKey' ]
+ */
+ public function getFontAliases()
+ {
+ return [
+ 'damase' => 'mph2bdamase',
+ ];
+ }
+
+ /**
+ * Get the Language Package LanguageToFont implementation
+ *
+ * @return \Mpdf\Language\LanguageToFontInterface|null
+ */
+ public function getLanguageToFont()
+ {
+ return new Languages();
+ }
+
+ /**
+ * Define fonts to be used for character substitution, when the useSubstitutions configuration option enabled
+ *
+ * @return array The list of fonts to exclude using the keys found in $this->getFontData()
+ */
+ public function getBackupSubsFonts()
+ {
+ return [
+ 'mph2bdamase',
+ ];
+ }
+
+ /**
+ * Get a list of substituted fonts used when a font is not available in mPDF
+ *
+ * @return array Multidimensional array with keys 'sans_fonts', 'serif_fonts', and 'mono_fonts'
+ */
+ public function getFontFamilySubstitution()
+ {
+ return [
+ 'sans_fonts' => [
+ 'mph2bdamase',
+ ],
+ ];
+ }
+}
diff --git a/packages/Mph2bDamase/composer.json b/packages/Mph2bDamase/composer.json
new file mode 100644
index 000000000..8e9ed5198
--- /dev/null
+++ b/packages/Mph2bDamase/composer.json
@@ -0,0 +1,21 @@
+{
+ "name": "mpdf/font-mph-2b-damase",
+ "version": "0.1",
+ "type": "library",
+ "description": "MPH 2B Damase serif unicode font created by Mark Williamson. Supported scripts include: Latin, Greek, Cyrillic, Armenian, Hebrew, Arabic, Thaana, Bengali, Georgian, Cherokee, Hanunoo, Limbu, Tai Le,Buginese, Coptic, Glagolitic, Tifinagh, and Nagri.",
+ "keywords": ["mpdf", "mpdf-fonts"],
+ "license": ["MIT"],
+ "autoload": {
+ "psr-4": {
+ "Mpdf\\Fonts\\Mph2bDamase\\": ""
+ }
+ },
+ "require": {
+ "mpdf/mpdf": "*"
+ },
+ "extra": {
+ "mpdf": {
+ "fonts": "\\Mpdf\\Fonts\\Mph2bDamase\\Registration"
+ }
+ }
+}
\ No newline at end of file
diff --git a/packages/Mph2bDamase/fonts/LICENSE.txt b/packages/Mph2bDamase/fonts/LICENSE.txt
new file mode 100644
index 000000000..6470ba4e6
--- /dev/null
+++ b/packages/Mph2bDamase/fonts/LICENSE.txt
@@ -0,0 +1 @@
+public domain 2005 - Mark Williamson
\ No newline at end of file
diff --git a/ttfonts/damase_v.2.ttf b/packages/Mph2bDamase/fonts/damase_v.2.ttf
similarity index 100%
rename from ttfonts/damase_v.2.ttf
rename to packages/Mph2bDamase/fonts/damase_v.2.ttf
diff --git a/packages/Myanmar-Bundle/Languages.php b/packages/Myanmar-Bundle/Languages.php
new file mode 100644
index 000000000..7a2f5eb75
--- /dev/null
+++ b/packages/Myanmar-Bundle/Languages.php
@@ -0,0 +1,26 @@
+WriteHTML('
+
+
+Hello World in padaukbook
+
+Some text in ayar
+');
+
+$mpdf->OutputHttpDownload('example.pdf');
+```
+
+## Advanced Installation
+
+To manually register the font package with mPDF, you can initialize the package's `Registration` class and pass it to the `FontRegistry` constructor:
+
+```php
+ $registry
+]);
+```
+
+## License
+
+This package is licensed under the MIT License. Fonts are licensed separately by their authors, and can be found in following license files:
+
+- `ayar`: [LICENSE-Ayar.txt](./fonts/LICENSE-Ayar.txt)
+- `padaukbook`: [LICENSE-Padauk.txt](./fonts/LICENSE-Padauk.txt)
+- `tharlon`: [LICENSE-Tharlon.txt](./fonts/LICENSE-Tharlon.txt)
+- `zawgyi-one`: [LICENSE-ZawgyiOne.txt](./fonts/LICENSE-ZawgyiOne.txt)
\ No newline at end of file
diff --git a/packages/Myanmar-Bundle/Registration.php b/packages/Myanmar-Bundle/Registration.php
new file mode 100644
index 000000000..88e348bd8
--- /dev/null
+++ b/packages/Myanmar-Bundle/Registration.php
@@ -0,0 +1,88 @@
+ 0xFF, Enable use of OTL features.
+ * ['useKashida'] => 75, Enable use of kashida for text justification in Arabic text
+ *
+ * If a .ttc TrueType collection file is referenced, the number of the font
+ * within the collection is required. Fonts in the collection are numbered
+ * starting at 1, as they appear in the .ttc file.
+ *
+ * @return array{
+ * 'R': string,
+ * 'B'?: string,
+ * 'I'?: string,
+ * 'BI'?: string,
+ * 'sip-ext'?: string,
+ * 'useOTL'?: int,
+ * 'useKashida'?: int,
+ * 'TTCfontID'?: array{
+ * 'R': int,
+ * 'B'?: int,
+ * 'I'?: int,
+ * 'BI'?: int,
+ * }
+ * }
+ */
+ public function getFonts()
+ {
+ return [
+ 'ayar' => [
+ 'R' => 'ayar.ttf',
+ 'useOTL' => 0xFF,
+ ],
+
+ 'padaukbook' => [
+ 'R' => 'Padauk-book.ttf',
+ 'useOTL' => 0xFF,
+ ],
+
+ 'tharlon' => [
+ 'R' => 'Tharlon-Regular.ttf',
+ 'useOTL' => 0xFF,
+ ],
+
+ 'zawgyi-one' => [
+ 'R' => 'ZawgyiOne.ttf',
+ 'useOTL' => 0xFF,
+ ],
+ ];
+ }
+
+ /**
+ * Get the Language Package LanguageToFont implementation
+ *
+ * @return \Mpdf\Language\LanguageToFontInterface|null
+ */
+ public function getLanguageToFont()
+ {
+ return new Languages();
+ }
+}
diff --git a/packages/Myanmar-Bundle/composer.json b/packages/Myanmar-Bundle/composer.json
new file mode 100644
index 000000000..d0f7489ad
--- /dev/null
+++ b/packages/Myanmar-Bundle/composer.json
@@ -0,0 +1,21 @@
+{
+ "name": "mpdf/font-myanmar-bundle",
+ "version": "0.1",
+ "type": "library",
+ "description": "A collection of fonts for the Myanmar language. Supported scripts include: Latin, Myanmar, Kayah Li, and Tai Le.",
+ "keywords": ["mpdf", "mpdf-fonts"],
+ "license": ["MIT"],
+ "autoload": {
+ "psr-4": {
+ "Mpdf\\Fonts\\MyanmarBundle\\": ""
+ }
+ },
+ "require": {
+ "mpdf/mpdf": "*"
+ },
+ "extra": {
+ "mpdf": {
+ "fonts": "\\Mpdf\\Fonts\\MyanmarBundle\\Registration"
+ }
+ }
+}
\ No newline at end of file
diff --git a/packages/Myanmar-Bundle/fonts/LICENSE-Ayar.txt b/packages/Myanmar-Bundle/fonts/LICENSE-Ayar.txt
new file mode 100644
index 000000000..de71d9b32
--- /dev/null
+++ b/packages/Myanmar-Bundle/fonts/LICENSE-Ayar.txt
@@ -0,0 +1,88 @@
+The font is licensed under the SIL Open Font License, Version 1.1:
+
+-----------------------------------------------------------
+SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
+-----------------------------------------------------------
+
+PREAMBLE
+The goals of the Open Font License (OFL) are to stimulate worldwide
+development of collaborative font projects, to support the font creation
+efforts of academic and linguistic communities, and to provide a free and
+open framework in which fonts may be shared and improved in partnership
+with others.
+
+The OFL allows the licensed fonts to be used, studied, modified and
+redistributed freely as long as they are not sold by themselves. The
+fonts, including any derivative works, can be bundled, embedded,
+redistributed and/or sold with any software provided that any reserved
+names are not used by derivative works. The fonts and derivatives,
+however, cannot be released under any other type of license. The
+requirement for fonts to remain under this license does not apply
+to any document created using the fonts or their derivatives.
+
+DEFINITIONS
+"Font Software" refers to the set of files released by the Copyright
+Holder(s) under this license and clearly marked as such. This may
+include source files, build scripts and documentation.
+
+"Reserved Font Name" refers to any names specified as such after the
+copyright statement(s).
+
+"Original Version" refers to the collection of Font Software components as
+distributed by the Copyright Holder(s).
+
+"Modified Version" refers to any derivative made by adding to, deleting,
+or substituting -- in part or in whole -- any of the components of the
+Original Version, by changing formats or by porting the Font Software to a
+new environment.
+
+"Author" refers to any designer, engineer, programmer, technical
+writer or other person who contributed to the Font Software.
+
+PERMISSION & CONDITIONS
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of the Font Software, to use, study, copy, merge, embed, modify,
+redistribute, and sell modified and unmodified copies of the Font
+Software, subject to the following conditions:
+
+1) Neither the Font Software nor any of its individual components,
+in Original or Modified Versions, may be sold by itself.
+
+2) Original or Modified Versions of the Font Software may be bundled,
+redistributed and/or sold with any software, provided that each copy
+contains the above copyright notice and this license. These can be
+included either as stand-alone text files, human-readable headers or
+in the appropriate machine-readable metadata fields within text or
+binary files as long as those fields can be easily viewed by the user.
+
+3) No Modified Version of the Font Software may use the Reserved Font
+Name(s) unless explicit written permission is granted by the corresponding
+Copyright Holder. This restriction only applies to the primary font name as
+presented to the users.
+
+4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
+Software shall not be used to promote, endorse or advertise any
+Modified Version, except to acknowledge the contribution(s) of the
+Copyright Holder(s) and the Author(s) or with their explicit written
+permission.
+
+5) The Font Software, modified or unmodified, in part or in whole,
+must be distributed entirely under this license, and must not be
+distributed under any other license. The requirement for fonts to
+remain under this license does not apply to any document created
+using the Font Software.
+
+TERMINATION
+This license becomes null and void if any of the above conditions are
+not met.
+
+DISCLAIMER
+THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
+OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
+COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
+DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
+OTHER DEALINGS IN THE FONT SOFTWARE.
diff --git a/packages/Myanmar-Bundle/fonts/LICENSE-Padauk.txt b/packages/Myanmar-Bundle/fonts/LICENSE-Padauk.txt
new file mode 100644
index 000000000..a5e7a965f
--- /dev/null
+++ b/packages/Myanmar-Bundle/fonts/LICENSE-Padauk.txt
@@ -0,0 +1,91 @@
+Copyright 2007-2022 SIL International (www.sil.org)
+with Reserved Font Names "Padauk", "Namkio" and "Deemawso".
+
+The fonts are licensed under the SIL Open Font License, Version 1.1:
+
+-----------------------------------------------------------
+SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
+-----------------------------------------------------------
+
+PREAMBLE
+The goals of the Open Font License (OFL) are to stimulate worldwide
+development of collaborative font projects, to support the font creation
+efforts of academic and linguistic communities, and to provide a free and
+open framework in which fonts may be shared and improved in partnership
+with others.
+
+The OFL allows the licensed fonts to be used, studied, modified and
+redistributed freely as long as they are not sold by themselves. The
+fonts, including any derivative works, can be bundled, embedded,
+redistributed and/or sold with any software provided that any reserved
+names are not used by derivative works. The fonts and derivatives,
+however, cannot be released under any other type of license. The
+requirement for fonts to remain under this license does not apply
+to any document created using the fonts or their derivatives.
+
+DEFINITIONS
+"Font Software" refers to the set of files released by the Copyright
+Holder(s) under this license and clearly marked as such. This may
+include source files, build scripts and documentation.
+
+"Reserved Font Name" refers to any names specified as such after the
+copyright statement(s).
+
+"Original Version" refers to the collection of Font Software components as
+distributed by the Copyright Holder(s).
+
+"Modified Version" refers to any derivative made by adding to, deleting,
+or substituting -- in part or in whole -- any of the components of the
+Original Version, by changing formats or by porting the Font Software to a
+new environment.
+
+"Author" refers to any designer, engineer, programmer, technical
+writer or other person who contributed to the Font Software.
+
+PERMISSION & CONDITIONS
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of the Font Software, to use, study, copy, merge, embed, modify,
+redistribute, and sell modified and unmodified copies of the Font
+Software, subject to the following conditions:
+
+1) Neither the Font Software nor any of its individual components,
+in Original or Modified Versions, may be sold by itself.
+
+2) Original or Modified Versions of the Font Software may be bundled,
+redistributed and/or sold with any software, provided that each copy
+contains the above copyright notice and this license. These can be
+included either as stand-alone text files, human-readable headers or
+in the appropriate machine-readable metadata fields within text or
+binary files as long as those fields can be easily viewed by the user.
+
+3) No Modified Version of the Font Software may use the Reserved Font
+Name(s) unless explicit written permission is granted by the corresponding
+Copyright Holder. This restriction only applies to the primary font name as
+presented to the users.
+
+4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
+Software shall not be used to promote, endorse or advertise any
+Modified Version, except to acknowledge the contribution(s) of the
+Copyright Holder(s) and the Author(s) or with their explicit written
+permission.
+
+5) The Font Software, modified or unmodified, in part or in whole,
+must be distributed entirely under this license, and must not be
+distributed under any other license. The requirement for fonts to
+remain under this license does not apply to any document created
+using the Font Software.
+
+TERMINATION
+This license becomes null and void if any of the above conditions are
+not met.
+
+DISCLAIMER
+THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
+OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
+COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
+DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
+OTHER DEALINGS IN THE FONT SOFTWARE.
diff --git a/ttfonts/TharlonOFL.txt b/packages/Myanmar-Bundle/fonts/LICENSE-Tharlon.txt
similarity index 96%
rename from ttfonts/TharlonOFL.txt
rename to packages/Myanmar-Bundle/fonts/LICENSE-Tharlon.txt
index 2973d5df3..e01b39270 100644
--- a/ttfonts/TharlonOFL.txt
+++ b/packages/Myanmar-Bundle/fonts/LICENSE-Tharlon.txt
@@ -1,9 +1,6 @@
Copyright (c) 2010-2012, Sai Zin Di Di Zone (www.yunghkio.com/unicode|saiddzone@gmail.com), with Reserved Font Name 'Yunghkio'. Copyright (c) 2012, Google, Inc (http://code.google.com/p/googlefontdirectory/), with Reserved Font Name 'Arimo'. Copyright (c) 2012, Sun Tun, Ngwe Tun, Solveware Solution (http://code.google.com/p/tharlon-font|info@parabaik.info), with Reserved Font Name 'TharLon'.
-This Font Software is licensed under the SIL Open Font License, Version 1.1.
-This license is copied below, and is also available with a FAQ at:
-http://scripts.sil.org/OFL
-
+The font is licensed under the SIL Open Font License, Version 1.1:
-----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
diff --git a/packages/Myanmar-Bundle/fonts/LICENSE-ZawgyiOne.txt b/packages/Myanmar-Bundle/fonts/LICENSE-ZawgyiOne.txt
new file mode 100644
index 000000000..65011ca69
--- /dev/null
+++ b/packages/Myanmar-Bundle/fonts/LICENSE-ZawgyiOne.txt
@@ -0,0 +1 @@
+Freeware
\ No newline at end of file
diff --git a/ttfonts/Padauk-book.ttf b/packages/Myanmar-Bundle/fonts/Padauk-book.ttf
similarity index 100%
rename from ttfonts/Padauk-book.ttf
rename to packages/Myanmar-Bundle/fonts/Padauk-book.ttf
diff --git a/ttfonts/Tharlon-Regular.ttf b/packages/Myanmar-Bundle/fonts/Tharlon-Regular.ttf
similarity index 100%
rename from ttfonts/Tharlon-Regular.ttf
rename to packages/Myanmar-Bundle/fonts/Tharlon-Regular.ttf
diff --git a/ttfonts/ZawgyiOne.ttf b/packages/Myanmar-Bundle/fonts/ZawgyiOne.ttf
similarity index 100%
rename from ttfonts/ZawgyiOne.ttf
rename to packages/Myanmar-Bundle/fonts/ZawgyiOne.ttf
diff --git a/ttfonts/ayar.ttf b/packages/Myanmar-Bundle/fonts/ayar.ttf
similarity index 100%
rename from ttfonts/ayar.ttf
rename to packages/Myanmar-Bundle/fonts/ayar.ttf
diff --git a/packages/OCR-Family/README.md b/packages/OCR-Family/README.md
new file mode 100644
index 000000000..314899712
--- /dev/null
+++ b/packages/OCR-Family/README.md
@@ -0,0 +1,68 @@
+# mPDF Font Package
+
+## Introduction
+
+OCR-A and OCR-B barcode fonts. OCR-A is the font used for the ISBNs on books; and OCR-B is used for the human-readable digits on UPC/EAN bar codes. This package is used with the [mPDF library](https://github.com/mpdf/mpdf).
+
+**Supported Scripts**:
+* Latin
+
+## Installation
+
+```bash
+composer require mpdf/font-ocr-family
+```
+
+## Usage
+
+This package automatically registers the following fonts with mPDF:
+
+- `ocra`
+- `ocrb`
+
+Example usage in mPDF:
+```php
+WriteHTML('
+
+
+Some text in ocra
+Some text in ocrb
+');
+
+$mpdf->OutputHttpDownload('example.pdf');
+```
+
+## Advanced Installation
+
+To manually register the font package with mPDF, you can initialize the package's `Registration` class and pass it to the `FontRegistry` constructor:
+
+```php
+ $registry
+]);
+```
+
+## License
+
+This package is licensed under the MIT License. Fonts are licensed separately by their authors, and can be found in the [`/fonts/LICENSE.txt`](./fonts/LICENSE.txt) file.
\ No newline at end of file
diff --git a/packages/OCR-Family/Registration.php b/packages/OCR-Family/Registration.php
new file mode 100644
index 000000000..302a404fe
--- /dev/null
+++ b/packages/OCR-Family/Registration.php
@@ -0,0 +1,95 @@
+ 0xFF, Enable use of OTL features.
+ * ['useKashida'] => 75, Enable use of kashida for text justification in Arabic text
+ *
+ * If a .ttc TrueType collection file is referenced, the number of the font
+ * within the collection is required. Fonts in the collection are numbered
+ * starting at 1, as they appear in the .ttc file.
+ *
+ * @return array{
+ * 'R': string,
+ * 'B'?: string,
+ * 'I'?: string,
+ * 'BI'?: string,
+ * 'sip-ext'?: string,
+ * 'useOTL'?: int,
+ * 'useKashida'?: int,
+ * 'TTCfontID'?: array{
+ * 'R': int,
+ * 'B'?: int,
+ * 'I'?: int,
+ * 'BI'?: int,
+ * }
+ * }
+ */
+ public function getFonts()
+ {
+ return [
+ 'ocra' => [
+ 'R' => 'OCRA.ttf',
+ ],
+
+ 'ocrb' => [
+ 'R' => 'OCRB.ttf',
+ ],
+ ];
+ }
+
+ /**
+ * Font alias mapping
+ *
+ * @return array{string, string} [ 'aliasName' => 'fontKey' ]
+ */
+ public function getFontAliases()
+ {
+ return [
+ 'ocr-b' => 'ocrb',
+ 'ocr-b10bt' => 'ocrb',
+ 'ocr-a' => 'ocra',
+ ];
+ }
+
+ /**
+ * Get a list of substituted fonts used when a font is not available in mPDF
+ *
+ * @return array Multidimensional array with keys 'sans_fonts', 'serif_fonts', and 'mono_fonts'
+ */
+ public function getFontFamilySubstitution()
+ {
+ return [
+ 'mono_fonts' => [
+ 'ocrb', 'ocr-b',
+ ],
+ ];
+ }
+}
diff --git a/packages/OCR-Family/composer.json b/packages/OCR-Family/composer.json
new file mode 100644
index 000000000..d0545fdb1
--- /dev/null
+++ b/packages/OCR-Family/composer.json
@@ -0,0 +1,22 @@
+{
+
+ "name": "mpdf/font-ocr-family",
+ "version": "0.1",
+ "type": "library",
+ "description": "OCR-A and OCR-B barcode fonts for mPDF. OCR-A is the font used for the ISBNs on books; and OCR-B is used for the human-readable digits on UPC/EAN bar codes. A book with a standard bar code label uses both. Supported scripts include: Latin.",
+ "keywords": ["mpdf", "mpdf-fonts"],
+ "license": ["MIT"],
+ "autoload": {
+ "psr-4": {
+ "Mpdf\\Fonts\\OcrFamily\\": ""
+ }
+ },
+ "require": {
+ "mpdf/mpdf": "*"
+ },
+ "extra": {
+ "mpdf": {
+ "fonts": "\\Mpdf\\Fonts\\OcrFamily\\Registration"
+ }
+ }
+}
\ No newline at end of file
diff --git a/packages/OCR-Family/fonts/LICENSE.txt b/packages/OCR-Family/fonts/LICENSE.txt
new file mode 100644
index 000000000..e4b53147a
--- /dev/null
+++ b/packages/OCR-Family/fonts/LICENSE.txt
@@ -0,0 +1,5 @@
+This package contains freely-usable fonts for the OCR A and OCR B typefaces. OCR-A is the font used for the ISBNs on books; and OCR-B is used for the human-readable digits on UPC/EAN bar codes. A book with a standard bar code label uses both.
+
+I translated existing [public domain] Metafont sources [by Norbert Swartz] to MetaType1 to create the enhanced TrueType, PostScript, and OpenType versions included in this package. They are available for free use, including in commercial applications; my own contributions are public domain, and others have licensed their copyright claims.
+
+– Matthew Skala, https://tsukurimashou.org/ocr.php.en
\ No newline at end of file
diff --git a/packages/OCR-Family/fonts/OCRA.ttf b/packages/OCR-Family/fonts/OCRA.ttf
new file mode 100644
index 000000000..6a64901c9
Binary files /dev/null and b/packages/OCR-Family/fonts/OCRA.ttf differ
diff --git a/packages/OCR-Family/fonts/OCRB.ttf b/packages/OCR-Family/fonts/OCRB.ttf
new file mode 100644
index 000000000..eb9d4577c
Binary files /dev/null and b/packages/OCR-Family/fonts/OCRB.ttf differ
diff --git a/packages/Pothana2000/Languages.php b/packages/Pothana2000/Languages.php
new file mode 100644
index 000000000..b02c85d6b
--- /dev/null
+++ b/packages/Pothana2000/Languages.php
@@ -0,0 +1,23 @@
+WriteHTML('
+
+
+Hello World in pothana2000
+');
+
+$mpdf->OutputHttpDownload('example.pdf');
+```
+
+## Advanced Installation
+
+To manually register the font package with mPDF, you can initialize the package's `Registration` class and pass it to the `FontRegistry` constructor:
+
+```php
+ $registry
+]);
+```
+
+## License
+
+This package is licensed under the MIT License. Fonts are licensed separately by their authors, and can be found in the [`/fonts/LICENSE.txt`](./fonts/LICENSE.txt) file.
\ No newline at end of file
diff --git a/packages/Pothana2000/Registration.php b/packages/Pothana2000/Registration.php
new file mode 100644
index 000000000..5729900ff
--- /dev/null
+++ b/packages/Pothana2000/Registration.php
@@ -0,0 +1,73 @@
+ 0xFF, Enable use of OTL features.
+ * ['useKashida'] => 75, Enable use of kashida for text justification in Arabic text
+ *
+ * If a .ttc TrueType collection file is referenced, the number of the font
+ * within the collection is required. Fonts in the collection are numbered
+ * starting at 1, as they appear in the .ttc file.
+ *
+ * @return array{
+ * 'R': string,
+ * 'B'?: string,
+ * 'I'?: string,
+ * 'BI'?: string,
+ * 'sip-ext'?: string,
+ * 'useOTL'?: int,
+ * 'useKashida'?: int,
+ * 'TTCfontID'?: array{
+ * 'R': int,
+ * 'B'?: int,
+ * 'I'?: int,
+ * 'BI'?: int,
+ * }
+ * }
+ */
+ public function getFonts()
+ {
+ return [
+ 'pothana2000' => [
+ 'R' => 'Pothana2000.ttf',
+ 'useOTL' => 0xFF,
+ ],
+ ];
+ }
+
+ /**
+ * Get the Language Package LanguageToFont implementation
+ *
+ * @return \Mpdf\Language\LanguageToFontInterface|null
+ */
+ public function getLanguageToFont()
+ {
+ return new Languages();
+ }
+}
diff --git a/packages/Pothana2000/composer.json b/packages/Pothana2000/composer.json
new file mode 100644
index 000000000..de26d2256
--- /dev/null
+++ b/packages/Pothana2000/composer.json
@@ -0,0 +1,21 @@
+{
+ "name": "mpdf/font-pothana-2000",
+ "version": "0.1",
+ "type": "library",
+ "description": "Pothana2000 is a Unicode compliant OpenType font for Telugu and was created by Dr. Tirumala Krishna Desikacharyulu. Supported scripts include: Telugu.",
+ "keywords": ["mpdf", "mpdf-fonts"],
+ "license": ["MIT"],
+ "autoload": {
+ "psr-4": {
+ "Mpdf\\Fonts\\Pothana2000\\": ""
+ }
+ },
+ "require": {
+ "mpdf/mpdf": "*"
+ },
+ "extra": {
+ "mpdf": {
+ "fonts": "\\Mpdf\\Fonts\\Pothana2000\\Registration"
+ }
+ }
+}
\ No newline at end of file
diff --git a/packages/Pothana2000/fonts/LICENSE.txt b/packages/Pothana2000/fonts/LICENSE.txt
new file mode 100644
index 000000000..5b752a0a2
--- /dev/null
+++ b/packages/Pothana2000/fonts/LICENSE.txt
@@ -0,0 +1,14 @@
+ Copyright (C) 2000,2005 Tirumala Krishna Desikacharylu
+
+ Licensed under the GNU General Public License, version 2
+ or later along with the following exception:
+
+ As a special exception, if you create a document which uses this
+ font, and embed this font or unaltered portions of this font into the
+ document, this font does not by itself cause the resulting document
+ to be covered by the GNU General Public License. This exception does
+ not however invalidate any other reasons why the document might be
+ covered by the GNU General Public License. If you modify this font,
+ you may extend this exception to your version of the font, but you
+ are not obligated to do so. If you do not wish to do so, delete this
+ exception statement from your version.
diff --git a/ttfonts/Pothana2000.ttf b/packages/Pothana2000/fonts/Pothana2000.ttf
similarity index 100%
rename from ttfonts/Pothana2000.ttf
rename to packages/Pothana2000/fonts/Pothana2000.ttf
diff --git a/packages/Quivira/Languages.php b/packages/Quivira/Languages.php
new file mode 100644
index 000000000..6469ae4ef
--- /dev/null
+++ b/packages/Quivira/Languages.php
@@ -0,0 +1,62 @@
+fontByScript($script);
+ }
+
+ return '';
+ }
+
+ protected function fontByScript($script)
+ {
+ switch ($script) {
+ case 'latn': // LATIN
+ case 'cyrl': // CYRILLIC
+ case 'tfng': // TIFINAGH
+ case 'brai': // BRAILLE
+ case 'ogam': // OGHAM
+ case 'runr': // RUNIC
+ case 'glag': // GLAGOLITIC
+ return 'quivira';
+ }
+
+ return '';
+ }
+}
diff --git a/packages/Quivira/README.md b/packages/Quivira/README.md
new file mode 100644
index 000000000..3e0502824
--- /dev/null
+++ b/packages/Quivira/README.md
@@ -0,0 +1,83 @@
+# mPDF Font Package
+
+## Introduction
+
+Quivira is a serif font with a wide variety of unicode characters. This package is used with the [mPDF library](https://github.com/mpdf/mpdf).
+
+**Supported Scripts**:
+* Latin
+* Greek
+* Cyrillic
+* Armenian
+* Hebrew
+* Thai
+* Georgian
+* Cherokee
+* Canadian Aboriginal
+* Ogham
+* Runic
+* Tagalog
+* Hanunoo
+* Buhid
+* Tagbanwa
+* Braille
+* Coptic
+* Glagolitic
+* Tifinagh
+* Vai
+* Samaritan
+* Lisu
+
+## Installation
+
+```bash
+composer require mpdf/font-quivira
+```
+
+## Usage
+
+This package automatically registers the following fonts with mPDF:
+
+- `quivira`
+
+Example usage in mPDF:
+```php
+WriteHTML('
+
+
+Hello World in quivira
+');
+
+$mpdf->OutputHttpDownload('example.pdf');
+```
+
+## Advanced Installation
+
+To manually register the font package with mPDF, you can initialize the package's `Registration` class and pass it to the `FontRegistry` constructor:
+
+```php
+ $registry
+]);
+```
+
+## License
+
+This package is licensed under the MIT License. Fonts are licensed separately by their authors, and can be found in the [`/fonts/LICENSE.txt`](./fonts/LICENSE.txt) file.
\ No newline at end of file
diff --git a/packages/Quivira/Registration.php b/packages/Quivira/Registration.php
new file mode 100644
index 000000000..703c624d4
--- /dev/null
+++ b/packages/Quivira/Registration.php
@@ -0,0 +1,99 @@
+ 0xFF, Enable use of OTL features.
+ * ['useKashida'] => 75, Enable use of kashida for text justification in Arabic text
+ *
+ * If a .ttc TrueType collection file is referenced, the number of the font
+ * within the collection is required. Fonts in the collection are numbered
+ * starting at 1, as they appear in the .ttc file.
+ *
+ * @return array{
+ * 'R': string,
+ * 'B'?: string,
+ * 'I'?: string,
+ * 'BI'?: string,
+ * 'sip-ext'?: string,
+ * 'useOTL'?: int,
+ * 'useKashida'?: int,
+ * 'TTCfontID'?: array{
+ * 'R': int,
+ * 'B'?: int,
+ * 'I'?: int,
+ * 'BI'?: int,
+ * }
+ * }
+ */
+ public function getFonts()
+ {
+ return [
+ 'quivira' => [
+ 'R' => 'Quivira.otf',
+ 'useOTL' => 0xFF,
+ ],
+ ];
+ }
+
+ /**
+ * Get the Language Package LanguageToFont implementation
+ *
+ * @return \Mpdf\Language\LanguageToFontInterface|null
+ */
+ public function getLanguageToFont()
+ {
+ return new Languages();
+ }
+
+ /**
+ * Define fonts to be used for character substitution, when the useSubstitutions configuration option enabled
+ *
+ * @return array The list of fonts to exclude using the keys found in $this->getFontData()
+ */
+ public function getBackupSubsFonts()
+ {
+ return [
+ 'quivira',
+ ];
+ }
+
+ /**
+ * Get a list of substituted fonts used when a font is not available in mPDF
+ *
+ * @return array Multidimensional array with keys 'sans_fonts', 'serif_fonts', and 'mono_fonts'
+ */
+ public function getFontFamilySubstitution()
+ {
+ return [
+ 'serif_fonts' => [
+ 'quivira',
+ ],
+ ];
+ }
+}
diff --git a/packages/Quivira/composer.json b/packages/Quivira/composer.json
new file mode 100644
index 000000000..19d6e9849
--- /dev/null
+++ b/packages/Quivira/composer.json
@@ -0,0 +1,21 @@
+{
+ "name": "mpdf/font-quivira",
+ "version": "0.1",
+ "type": "library",
+ "description": "Quivira is a serif font with a wide variety of unicode characters. Supported scripts include: Latin, Greek, Cyrillic, Armenian, Hebrew, Thai, Georgian, Cherokee, Candian Aboriginal, Ogham, Runic, Tagalog, Hanunoo, Buhid, Tagbanwa, Braille, Coptic, Glagolitic, Tifinagh, Vai, Samaritan, and Lisu.",
+ "keywords": ["mpdf", "mpdf-fonts"],
+ "license": ["MIT"],
+ "autoload": {
+ "psr-4": {
+ "Mpdf\\Fonts\\Quivira\\": ""
+ }
+ },
+ "require": {
+ "mpdf/mpdf": "*"
+ },
+ "extra": {
+ "mpdf": {
+ "fonts": "\\Mpdf\\Fonts\\Quivira\\Registration"
+ }
+ }
+}
\ No newline at end of file
diff --git a/packages/Quivira/fonts/LICENSE.txt b/packages/Quivira/fonts/LICENSE.txt
new file mode 100644
index 000000000..aec4a9b08
--- /dev/null
+++ b/packages/Quivira/fonts/LICENSE.txt
@@ -0,0 +1,3 @@
+Quivira is in the Public Domain. For legislations where this is not possible, I hereby explicitly grant the right to use, redistribute, remix or adapt Quivira for any purpose, including commercial usage, without attribution or any other restrictions unless required by law.
+
+http://www.quivira-font.com/notes.php
\ No newline at end of file
diff --git a/ttfonts/Quivira.otf b/packages/Quivira/fonts/Quivira.otf
similarity index 79%
rename from ttfonts/Quivira.otf
rename to packages/Quivira/fonts/Quivira.otf
index 531edf16c..8064cae27 100644
Binary files a/ttfonts/Quivira.otf and b/packages/Quivira/fonts/Quivira.otf differ
diff --git a/packages/SunExt/Languages.php b/packages/SunExt/Languages.php
new file mode 100644
index 000000000..1988d27ca
--- /dev/null
+++ b/packages/SunExt/Languages.php
@@ -0,0 +1,69 @@
+fontByScript($script);
+ }
+
+ return '';
+ }
+
+ protected function fontByScript($script)
+ {
+ switch ($script) {
+ // RUNIC
+ case 'runr':
+
+ // HAN (SIMPLIFIED)
+ case 'hans':
+
+ // BOPOMOFO
+ case 'bopo':
+
+ // YI
+ case 'yiii':
+ return 'sun-exta';
+ }
+
+ return '';
+ }
+
+}
diff --git a/packages/SunExt/README.md b/packages/SunExt/README.md
new file mode 100644
index 000000000..0a7a260f1
--- /dev/null
+++ b/packages/SunExt/README.md
@@ -0,0 +1,100 @@
+# mPDF Font Package
+
+## Introduction
+
+Sun-Ext is a serif unicode font that includes extensive CJK (Chinese/Japanise/Korean) characters. This package is used with the [mPDF library](https://github.com/mpdf/mpdf).
+
+**Supported Scripts**:
+* Latin
+* Greek
+* Cyrillic
+* Armenian
+* Hebrew
+* Arabic
+* Syriac
+* Thaana
+* Devanagari
+* Bengali
+* Gurmukhi
+* Gujarati
+* Oriya
+* Tamil
+* Telugu
+* Kannada
+* Malayalam
+* Thai
+* Leo
+* Tibetan
+* Myanmar
+* Georgian
+* Hangul
+* Ethiopic
+* Cherokee
+* Canadian Aboriginal
+* Ogham
+* Runic
+* Khmer
+* Mongolian
+* Hiragana
+* Katakana
+* Bopomofo
+* Han
+* Yi
+* Buhid
+* Limbu
+* Braille
+* Coptic
+
+## Installation
+
+```bash
+composer require mpdf/font-sunext
+```
+
+## Usage
+
+This package automatically registers the following fonts with mPDF:
+
+- `sun-exta`
+
+Example usage in mPDF:
+```php
+WriteHTML('
+
+
+Hello World in sun-exta
+');
+
+$mpdf->OutputHttpDownload('example.pdf');
+```
+
+## Advanced Installation
+
+To manually register the font package with mPDF, you can initialize the package's `Registration` class and pass it to the `FontRegistry` constructor:
+
+```php
+ $registry
+]);
+```
+
+## License
+
+This package is licensed under the MIT License. Fonts are licensed separately by their authors, and can be found in the [`/fonts/LICENSE.txt`](./fonts/LICENSE.txt) file.
\ No newline at end of file
diff --git a/packages/SunExt/Registration.php b/packages/SunExt/Registration.php
new file mode 100644
index 000000000..980bb3c8c
--- /dev/null
+++ b/packages/SunExt/Registration.php
@@ -0,0 +1,89 @@
+ 0xFF, Enable use of OTL features.
+ * ['useKashida'] => 75, Enable use of kashida for text justification in Arabic text
+ *
+ * If a .ttc TrueType collection file is referenced, the number of the font
+ * within the collection is required. Fonts in the collection are numbered
+ * starting at 1, as they appear in the .ttc file.
+ *
+ * @return array{
+ * 'R': string,
+ * 'B'?: string,
+ * 'I'?: string,
+ * 'BI'?: string,
+ * 'sip-ext'?: string,
+ * 'useOTL'?: int,
+ * 'useKashida'?: int,
+ * 'TTCfontID'?: array{
+ * 'R': int,
+ * 'B'?: int,
+ * 'I'?: int,
+ * 'BI'?: int,
+ * }
+ * }
+ */
+ public function getFonts()
+ {
+ return [
+ "sun-exta" => [
+ 'R' => "Sun-ExtA.ttf",
+ 'sip-ext' => 'sun-extb', /* SIP=Plane2 Unicode (extension B) */
+ ],
+ "sun-extb" => [
+ 'R' => "Sun-ExtB.ttf",
+ ],
+ ];
+ }
+
+ /**
+ * Get the Language Package LanguageToFont implementation
+ *
+ * @return \Mpdf\Language\LanguageToFontInterface|null
+ */
+ public function getLanguageToFont()
+ {
+ return new Languages();
+ }
+
+ /**
+ * Define fonts to be used for character substitution, when the useSubstitutions configuration option enabled
+ *
+ * @return array The list of fonts to exclude using the keys found in $this->getFontData()
+ */
+ public function getBackupSubsFonts()
+ {
+ return [
+ 'sun-exta',
+ ];
+ }
+}
diff --git a/packages/SunExt/composer.json b/packages/SunExt/composer.json
new file mode 100644
index 000000000..5711c3ec1
--- /dev/null
+++ b/packages/SunExt/composer.json
@@ -0,0 +1,23 @@
+{
+
+ "name": "mpdf/font-sunext",
+ "version": "0.1",
+ "type": "library",
+ "description": "Sun-Ext is a serif unicode font that includes extensive CJK (Chinese/Japanise/Korean) characters. Supported scripts include: Latin, Greek, Cyrillic, Armenian, Hebrew, Arabic, Syriac, Thaana, Devanagari, Bengali, Gurmukhi, Gujarati, Oriya, Tamil, Telugu, Kannada, Malayalam, Thai, Leo, Tibetan, Myanmar, Georgian, Hangul, Ethiopic, Cherokee, Canadian Aboriginal, Ogham, Runic, Khmer, Mongolian, Hiragana, Katakana, Bopomofo, Han, Yi, Buhid, Limbu, Braille, and Coptic.",
+ "keywords": ["mpdf", "mpdf-fonts"],
+ "license": ["MIT"],
+ "autoload": {
+ "psr-4": {
+ "Mpdf\\Fonts\\SunExt\\": ""
+ }
+ },
+ "require": {
+ "mpdf/mpdf": "*"
+ },
+ "extra": {
+ "mpdf": {
+ "fonts": "\\Mpdf\\Fonts\\SunExt\\Registration",
+ "fontOrder": 10
+ }
+ }
+}
\ No newline at end of file
diff --git a/packages/SunExt/fonts/LICENSE.txt b/packages/SunExt/fonts/LICENSE.txt
new file mode 100644
index 000000000..26b7d0927
--- /dev/null
+++ b/packages/SunExt/fonts/LICENSE.txt
@@ -0,0 +1 @@
+Freeware (Beijing ZhongYi Electronics Co)
\ No newline at end of file
diff --git a/ttfonts/Sun-ExtA.ttf b/packages/SunExt/fonts/Sun-ExtA.ttf
similarity index 100%
rename from ttfonts/Sun-ExtA.ttf
rename to packages/SunExt/fonts/Sun-ExtA.ttf
diff --git a/ttfonts/Sun-ExtB.ttf b/packages/SunExt/fonts/Sun-ExtB.ttf
similarity index 100%
rename from ttfonts/Sun-ExtB.ttf
rename to packages/SunExt/fonts/Sun-ExtB.ttf
diff --git a/packages/Sundanese-Unicode/Languages.php b/packages/Sundanese-Unicode/Languages.php
new file mode 100644
index 000000000..da1a6c3e1
--- /dev/null
+++ b/packages/Sundanese-Unicode/Languages.php
@@ -0,0 +1,22 @@
+WriteHTML('
+
+
+Hello World in sundaneseunicode
+');
+
+$mpdf->OutputHttpDownload('example.pdf');
+```
+
+## Advanced Installation
+
+To manually register the font package with mPDF, you can initialize the package's `Registration` class and pass it to the `FontRegistry` constructor:
+
+```php
+ $registry
+]);
+```
+
+## License
+
+This package is licensed under the MIT License. Fonts are licensed separately by their authors, and can be found in the [`/fonts/LICENSE.txt`](./fonts/LICENSE.txt) file.
\ No newline at end of file
diff --git a/packages/Sundanese-Unicode/Registration.php b/packages/Sundanese-Unicode/Registration.php
new file mode 100644
index 000000000..c6f66b2c3
--- /dev/null
+++ b/packages/Sundanese-Unicode/Registration.php
@@ -0,0 +1,73 @@
+ 0xFF, Enable use of OTL features.
+ * ['useKashida'] => 75, Enable use of kashida for text justification in Arabic text
+ *
+ * If a .ttc TrueType collection file is referenced, the number of the font
+ * within the collection is required. Fonts in the collection are numbered
+ * starting at 1, as they appear in the .ttc file.
+ *
+ * @return array{
+ * 'R': string,
+ * 'B'?: string,
+ * 'I'?: string,
+ * 'BI'?: string,
+ * 'sip-ext'?: string,
+ * 'useOTL'?: int,
+ * 'useKashida'?: int,
+ * 'TTCfontID'?: array{
+ * 'R': int,
+ * 'B'?: int,
+ * 'I'?: int,
+ * 'BI'?: int,
+ * }
+ * }
+ */
+ public function getFonts()
+ {
+ return [
+ 'sundaneseunicode' => [/* Sundanese */
+ 'R' => 'SundaneseUnicode-1.0.5.ttf',
+ 'useOTL' => 0xFF,
+ ],
+ ];
+ }
+
+ /**
+ * Get the Language Package LanguageToFont implementation
+ *
+ * @return \Mpdf\Language\LanguageToFontInterface|null
+ */
+ public function getLanguageToFont()
+ {
+ return new Languages();
+ }
+}
diff --git a/packages/Sundanese-Unicode/composer.json b/packages/Sundanese-Unicode/composer.json
new file mode 100644
index 000000000..4f3d12e11
--- /dev/null
+++ b/packages/Sundanese-Unicode/composer.json
@@ -0,0 +1,21 @@
+{
+ "name": "mpdf/font-sundanese-unicode",
+ "version": "0.1",
+ "type": "library",
+ "description": "Sundanese Unicode is a font with traditional script used by the Sundanese people of West Java, Indonesia. Supported scripts include: Sundanese.",
+ "keywords": ["mpdf", "mpdf-fonts"],
+ "license": ["MIT"],
+ "autoload": {
+ "psr-4": {
+ "Mpdf\\Fonts\\SundaneseUnicode\\": ""
+ }
+ },
+ "require": {
+ "mpdf/mpdf": "*"
+ },
+ "extra": {
+ "mpdf": {
+ "fonts": "\\Mpdf\\Fonts\\SundaneseUnicode\\Registration"
+ }
+ }
+}
\ No newline at end of file
diff --git a/packages/Sundanese-Unicode/fonts/LICENSE.txt b/packages/Sundanese-Unicode/fonts/LICENSE.txt
new file mode 100644
index 000000000..be9b199e6
--- /dev/null
+++ b/packages/Sundanese-Unicode/fonts/LICENSE.txt
@@ -0,0 +1,623 @@
+GNU GPL - https://web.archive.org/web/20090125215101/http://sabilulungan.org/aksara/
+
+----
+
+ GNU GENERAL PUBLIC LICENSE
+ Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc.
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The GNU General Public License is a free, copyleft license for
+software and other kinds of works.
+
+ The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works. By contrast,
+the GNU General Public License is intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users. We, the Free Software Foundation, use the
+GNU General Public License for most of our software; it applies also to
+any other work released this way by its authors. You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
+
+ To protect your rights, we need to prevent others from denying you
+these rights or asking you to surrender the rights. Therefore, you have
+certain responsibilities if you distribute copies of the software, or if
+you modify it: responsibilities to respect the freedom of others.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must pass on to the recipients the same
+freedoms that you received. You must make sure that they, too, receive
+or can get the source code. And you must show them these terms so they
+know their rights.
+
+ Developers that use the GNU GPL protect your rights with two steps:
+(1) assert copyright on the software, and (2) offer you this License
+giving you legal permission to copy, distribute and/or modify it.
+
+ For the developers' and authors' protection, the GPL clearly explains
+that there is no warranty for this free software. For both users' and
+authors' sake, the GPL requires that modified versions be marked as
+changed, so that their problems will not be attributed erroneously to
+authors of previous versions.
+
+ Some devices are designed to deny users access to install or run
+modified versions of the software inside them, although the manufacturer
+can do so. This is fundamentally incompatible with the aim of
+protecting users' freedom to change the software. The systematic
+pattern of such abuse occurs in the area of products for individuals to
+use, which is precisely where it is most unacceptable. Therefore, we
+have designed this version of the GPL to prohibit the practice for those
+products. If such problems arise substantially in other domains, we
+stand ready to extend this provision to those domains in future versions
+of the GPL, as needed to protect the freedom of users.
+
+ Finally, every program is threatened constantly by software patents.
+States should not allow patents to restrict development and use of
+software on general-purpose computers, but in those that do, we wish to
+avoid the special danger that patents applied to a free program could
+make it effectively proprietary. To prevent this, the GPL assures that
+patents cannot be used to render the program non-free.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ TERMS AND CONDITIONS
+
+ 0. Definitions.
+
+ "This License" refers to version 3 of the GNU General Public License.
+
+ "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+ "The Program" refers to any copyrightable work licensed under this
+License. Each licensee is addressed as "you". "Licensees" and
+"recipients" may be individuals or organizations.
+
+ To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of an
+exact copy. The resulting work is called a "modified version" of the
+earlier work or a work "based on" the earlier work.
+
+ A "covered work" means either the unmodified Program or a work based
+on the Program.
+
+ To "propagate" a work means to do anything with it that, without
+permission, would make you directly or secondarily liable for
+infringement under applicable copyright law, except executing it on a
+computer or modifying a private copy. Propagation includes copying,
+distribution (with or without modification), making available to the
+public, and in some countries other activities as well.
+
+ To "convey" a work means any kind of propagation that enables other
+parties to make or receive copies. Mere interaction with a user through
+a computer network, with no transfer of a copy, is not conveying.
+
+ An interactive user interface displays "Appropriate Legal Notices"
+to the extent that it includes a convenient and prominently visible
+feature that (1) displays an appropriate copyright notice, and (2)
+tells the user that there is no warranty for the work (except to the
+extent that warranties are provided), that licensees may convey the
+work under this License, and how to view a copy of this License. If
+the interface presents a list of user commands or options, such as a
+menu, a prominent item in the list meets this criterion.
+
+ 1. Source Code.
+
+ The "source code" for a work means the preferred form of the work
+for making modifications to it. "Object code" means any non-source
+form of a work.
+
+ A "Standard Interface" means an interface that either is an official
+standard defined by a recognized standards body, or, in the case of
+interfaces specified for a particular programming language, one that
+is widely used among developers working in that language.
+
+ The "System Libraries" of an executable work include anything, other
+than the work as a whole, that (a) is included in the normal form of
+packaging a Major Component, but which is not part of that Major
+Component, and (b) serves only to enable use of the work with that
+Major Component, or to implement a Standard Interface for which an
+implementation is available to the public in source code form. A
+"Major Component", in this context, means a major essential component
+(kernel, window system, and so on) of the specific operating system
+(if any) on which the executable work runs, or a compiler used to
+produce the work, or an object code interpreter used to run it.
+
+ The "Corresponding Source" for a work in object code form means all
+the source code needed to generate, install, and (for an executable
+work) run the object code and to modify the work, including scripts to
+control those activities. However, it does not include the work's
+System Libraries, or general-purpose tools or generally available free
+programs which are used unmodified in performing those activities but
+which are not part of the work. For example, Corresponding Source
+includes interface definition files associated with source files for
+the work, and the source code for shared libraries and dynamically
+linked subprograms that the work is specifically designed to require,
+such as by intimate data communication or control flow between those
+subprograms and other parts of the work.
+
+ The Corresponding Source need not include anything that users
+can regenerate automatically from other parts of the Corresponding
+Source.
+
+ The Corresponding Source for a work in source code form is that
+same work.
+
+ 2. Basic Permissions.
+
+ All rights granted under this License are granted for the term of
+copyright on the Program, and are irrevocable provided the stated
+conditions are met. This License explicitly affirms your unlimited
+permission to run the unmodified Program. The output from running a
+covered work is covered by this License only if the output, given its
+content, constitutes a covered work. This License acknowledges your
+rights of fair use or other equivalent, as provided by copyright law.
+
+ You may make, run and propagate covered works that you do not
+convey, without conditions so long as your license otherwise remains
+in force. You may convey covered works to others for the sole purpose
+of having them make modifications exclusively for you, or provide you
+with facilities for running those works, provided that you comply with
+the terms of this License in conveying all material for which you do
+not control copyright. Those thus making or running the covered works
+for you must do so exclusively on your behalf, under your direction
+and control, on terms that prohibit them from making any copies of
+your copyrighted material outside their relationship with you.
+
+ Conveying under any other circumstances is permitted solely under
+the conditions stated below. Sublicensing is not allowed; section 10
+makes it unnecessary.
+
+ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+
+ No covered work shall be deemed part of an effective technological
+measure under any applicable law fulfilling obligations under article
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
+similar laws prohibiting or restricting circumvention of such
+measures.
+
+ When you convey a covered work, you waive any legal power to forbid
+circumvention of technological measures to the extent such circumvention
+is effected by exercising rights under this License with respect to
+the covered work, and you disclaim any intention to limit operation or
+modification of the work as a means of enforcing, against the work's
+users, your or third parties' legal rights to forbid circumvention of
+technological measures.
+
+ 4. Conveying Verbatim Copies.
+
+ You may convey verbatim copies of the Program's source code as you
+receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice;
+keep intact all notices stating that this License and any
+non-permissive terms added in accord with section 7 apply to the code;
+keep intact all notices of the absence of any warranty; and give all
+recipients a copy of this License along with the Program.
+
+ You may charge any price or no price for each copy that you convey,
+and you may offer support or warranty protection for a fee.
+
+ 5. Conveying Modified Source Versions.
+
+ You may convey a work based on the Program, or the modifications to
+produce it from the Program, in the form of source code under the
+terms of section 4, provided that you also meet all of these conditions:
+
+ a) The work must carry prominent notices stating that you modified
+ it, and giving a relevant date.
+
+ b) The work must carry prominent notices stating that it is
+ released under this License and any conditions added under section
+ 7. This requirement modifies the requirement in section 4 to
+ "keep intact all notices".
+
+ c) You must license the entire work, as a whole, under this
+ License to anyone who comes into possession of a copy. This
+ License will therefore apply, along with any applicable section 7
+ additional terms, to the whole of the work, and all its parts,
+ regardless of how they are packaged. This License gives no
+ permission to license the work in any other way, but it does not
+ invalidate such permission if you have separately received it.
+
+ d) If the work has interactive user interfaces, each must display
+ Appropriate Legal Notices; however, if the Program has interactive
+ interfaces that do not display Appropriate Legal Notices, your
+ work need not make them do so.
+
+ A compilation of a covered work with other separate and independent
+works, which are not by their nature extensions of the covered work,
+and which are not combined with it such as to form a larger program,
+in or on a volume of a storage or distribution medium, is called an
+"aggregate" if the compilation and its resulting copyright are not
+used to limit the access or legal rights of the compilation's users
+beyond what the individual works permit. Inclusion of a covered work
+in an aggregate does not cause this License to apply to the other
+parts of the aggregate.
+
+ 6. Conveying Non-Source Forms.
+
+ You may convey a covered work in object code form under the terms
+of sections 4 and 5, provided that you also convey the
+machine-readable Corresponding Source under the terms of this License,
+in one of these ways:
+
+ a) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by the
+ Corresponding Source fixed on a durable physical medium
+ customarily used for software interchange.
+
+ b) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by a
+ written offer, valid for at least three years and valid for as
+ long as you offer spare parts or customer support for that product
+ model, to give anyone who possesses the object code either (1) a
+ copy of the Corresponding Source for all the software in the
+ product that is covered by this License, on a durable physical
+ medium customarily used for software interchange, for a price no
+ more than your reasonable cost of physically performing this
+ conveying of source, or (2) access to copy the
+ Corresponding Source from a network server at no charge.
+
+ c) Convey individual copies of the object code with a copy of the
+ written offer to provide the Corresponding Source. This
+ alternative is allowed only occasionally and noncommercially, and
+ only if you received the object code with such an offer, in accord
+ with subsection 6b.
+
+ d) Convey the object code by offering access from a designated
+ place (gratis or for a charge), and offer equivalent access to the
+ Corresponding Source in the same way through the same place at no
+ further charge. You need not require recipients to copy the
+ Corresponding Source along with the object code. If the place to
+ copy the object code is a network server, the Corresponding Source
+ may be on a different server (operated by you or a third party)
+ that supports equivalent copying facilities, provided you maintain
+ clear directions next to the object code saying where to find the
+ Corresponding Source. Regardless of what server hosts the
+ Corresponding Source, you remain obligated to ensure that it is
+ available for as long as needed to satisfy these requirements.
+
+ e) Convey the object code using peer-to-peer transmission, provided
+ you inform other peers where the object code and Corresponding
+ Source of the work are being offered to the general public at no
+ charge under subsection 6d.
+
+ A separable portion of the object code, whose source code is excluded
+from the Corresponding Source as a System Library, need not be
+included in conveying the object code work.
+
+ A "User Product" is either (1) a "consumer product", which means any
+tangible personal property which is normally used for personal, family,
+or household purposes, or (2) anything designed or sold for incorporation
+into a dwelling. In determining whether a product is a consumer product,
+doubtful cases shall be resolved in favor of coverage. For a particular
+product received by a particular user, "normally used" refers to a
+typical or common use of that class of product, regardless of the status
+of the particular user or of the way in which the particular user
+actually uses, or expects or is expected to use, the product. A product
+is a consumer product regardless of whether the product has substantial
+commercial, industrial or non-consumer uses, unless such uses represent
+the only significant mode of use of the product.
+
+ "Installation Information" for a User Product means any methods,
+procedures, authorization keys, or other information required to install
+and execute modified versions of a covered work in that User Product from
+a modified version of its Corresponding Source. The information must
+suffice to ensure that the continued functioning of the modified object
+code is in no case prevented or interfered with solely because
+modification has been made.
+
+ If you convey an object code work under this section in, or with, or
+specifically for use in, a User Product, and the conveying occurs as
+part of a transaction in which the right of possession and use of the
+User Product is transferred to the recipient in perpetuity or for a
+fixed term (regardless of how the transaction is characterized), the
+Corresponding Source conveyed under this section must be accompanied
+by the Installation Information. But this requirement does not apply
+if neither you nor any third party retains the ability to install
+modified object code on the User Product (for example, the work has
+been installed in ROM).
+
+ The requirement to provide Installation Information does not include a
+requirement to continue to provide support service, warranty, or updates
+for a work that has been modified or installed by the recipient, or for
+the User Product in which it has been modified or installed. Access to a
+network may be denied when the modification itself materially and
+adversely affects the operation of the network or violates the rules and
+protocols for communication across the network.
+
+ Corresponding Source conveyed, and Installation Information provided,
+in accord with this section must be in a format that is publicly
+documented (and with an implementation available to the public in
+source code form), and must require no special password or key for
+unpacking, reading or copying.
+
+ 7. Additional Terms.
+
+ "Additional permissions" are terms that supplement the terms of this
+License by making exceptions from one or more of its conditions.
+Additional permissions that are applicable to the entire Program shall
+be treated as though they were included in this License, to the extent
+that they are valid under applicable law. If additional permissions
+apply only to part of the Program, that part may be used separately
+under those permissions, but the entire Program remains governed by
+this License without regard to the additional permissions.
+
+ When you convey a copy of a covered work, you may at your option
+remove any additional permissions from that copy, or from any part of
+it. (Additional permissions may be written to require their own
+removal in certain cases when you modify the work.) You may place
+additional permissions on material, added by you to a covered work,
+for which you have or can give appropriate copyright permission.
+
+ Notwithstanding any other provision of this License, for material you
+add to a covered work, you may (if authorized by the copyright holders of
+that material) supplement the terms of this License with terms:
+
+ a) Disclaiming warranty or limiting liability differently from the
+ terms of sections 15 and 16 of this License; or
+
+ b) Requiring preservation of specified reasonable legal notices or
+ author attributions in that material or in the Appropriate Legal
+ Notices displayed by works containing it; or
+
+ c) Prohibiting misrepresentation of the origin of that material, or
+ requiring that modified versions of such material be marked in
+ reasonable ways as different from the original version; or
+
+ d) Limiting the use for publicity purposes of names of licensors or
+ authors of the material; or
+
+ e) Declining to grant rights under trademark law for use of some
+ trade names, trademarks, or service marks; or
+
+ f) Requiring indemnification of licensors and authors of that
+ material by anyone who conveys the material (or modified versions of
+ it) with contractual assumptions of liability to the recipient, for
+ any liability that these contractual assumptions directly impose on
+ those licensors and authors.
+
+ All other non-permissive additional terms are considered "further
+restrictions" within the meaning of section 10. If the Program as you
+received it, or any part of it, contains a notice stating that it is
+governed by this License along with a term that is a further
+restriction, you may remove that term. If a license document contains
+a further restriction but permits relicensing or conveying under this
+License, you may add to a covered work material governed by the terms
+of that license document, provided that the further restriction does
+not survive such relicensing or conveying.
+
+ If you add terms to a covered work in accord with this section, you
+must place, in the relevant source files, a statement of the
+additional terms that apply to those files, or a notice indicating
+where to find the applicable terms.
+
+ Additional terms, permissive or non-permissive, may be stated in the
+form of a separately written license, or stated as exceptions;
+the above requirements apply either way.
+
+ 8. Termination.
+
+ You may not propagate or modify a covered work except as expressly
+provided under this License. Any attempt otherwise to propagate or
+modify it is void, and will automatically terminate your rights under
+this License (including any patent licenses granted under the third
+paragraph of section 11).
+
+ However, if you cease all violation of this License, then your
+license from a particular copyright holder is reinstated (a)
+provisionally, unless and until the copyright holder explicitly and
+finally terminates your license, and (b) permanently, if the copyright
+holder fails to notify you of the violation by some reasonable means
+prior to 60 days after the cessation.
+
+ Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+ Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License. If your rights have been terminated and not permanently
+reinstated, you do not qualify to receive new licenses for the same
+material under section 10.
+
+ 9. Acceptance Not Required for Having Copies.
+
+ You are not required to accept this License in order to receive or
+run a copy of the Program. Ancillary propagation of a covered work
+occurring solely as a consequence of using peer-to-peer transmission
+to receive a copy likewise does not require acceptance. However,
+nothing other than this License grants you permission to propagate or
+modify any covered work. These actions infringe copyright if you do
+not accept this License. Therefore, by modifying or propagating a
+covered work, you indicate your acceptance of this License to do so.
+
+ 10. Automatic Licensing of Downstream Recipients.
+
+ Each time you convey a covered work, the recipient automatically
+receives a license from the original licensors, to run, modify and
+propagate that work, subject to this License. You are not responsible
+for enforcing compliance by third parties with this License.
+
+ An "entity transaction" is a transaction transferring control of an
+organization, or substantially all assets of one, or subdividing an
+organization, or merging organizations. If propagation of a covered
+work results from an entity transaction, each party to that
+transaction who receives a copy of the work also receives whatever
+licenses to the work the party's predecessor in interest had or could
+give under the previous paragraph, plus a right to possession of the
+Corresponding Source of the work from the predecessor in interest, if
+the predecessor has it or can get it with reasonable efforts.
+
+ You may not impose any further restrictions on the exercise of the
+rights granted or affirmed under this License. For example, you may
+not impose a license fee, royalty, or other charge for exercise of
+rights granted under this License, and you may not initiate litigation
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+any patent claim is infringed by making, using, selling, offering for
+sale, or importing the Program or any portion of it.
+
+ 11. Patents.
+
+ A "contributor" is a copyright holder who authorizes use under this
+License of the Program or a work on which the Program is based. The
+work thus licensed is called the contributor's "contributor version".
+
+ A contributor's "essential patent claims" are all patent claims
+owned or controlled by the contributor, whether already acquired or
+hereafter acquired, that would be infringed by some manner, permitted
+by this License, of making, using, or selling its contributor version,
+but do not include claims that would be infringed only as a
+consequence of further modification of the contributor version. For
+purposes of this definition, "control" includes the right to grant
+patent sublicenses in a manner consistent with the requirements of
+this License.
+
+ Each contributor grants you a non-exclusive, worldwide, royalty-free
+patent license under the contributor's essential patent claims, to
+make, use, sell, offer for sale, import and otherwise run, modify and
+propagate the contents of its contributor version.
+
+ In the following three paragraphs, a "patent license" is any express
+agreement or commitment, however denominated, not to enforce a patent
+(such as an express permission to practice a patent or covenant not to
+sue for patent infringement). To "grant" such a patent license to a
+party means to make such an agreement or commitment not to enforce a
+patent against the party.
+
+ If you convey a covered work, knowingly relying on a patent license,
+and the Corresponding Source of the work is not available for anyone
+to copy, free of charge and under the terms of this License, through a
+publicly available network server or other readily accessible means,
+then you must either (1) cause the Corresponding Source to be so
+available, or (2) arrange to deprive yourself of the benefit of the
+patent license for this particular work, or (3) arrange, in a manner
+consistent with the requirements of this License, to extend the patent
+license to downstream recipients. "Knowingly relying" means you have
+actual knowledge that, but for the patent license, your conveying the
+covered work in a country, or your recipient's use of the covered work
+in a country, would infringe one or more identifiable patents in that
+country that you have reason to believe are valid.
+
+ If, pursuant to or in connection with a single transaction or
+arrangement, you convey, or propagate by procuring conveyance of, a
+covered work, and grant a patent license to some of the parties
+receiving the covered work authorizing them to use, propagate, modify
+or convey a specific copy of the covered work, then the patent license
+you grant is automatically extended to all recipients of the covered
+work and works based on it.
+
+ A patent license is "discriminatory" if it does not include within
+the scope of its coverage, prohibits the exercise of, or is
+conditioned on the non-exercise of one or more of the rights that are
+specifically granted under this License. You may not convey a covered
+work if you are a party to an arrangement with a third party that is
+in the business of distributing software, under which you make payment
+to the third party based on the extent of your activity of conveying
+the work, and under which the third party grants, to any of the
+parties who would receive the covered work from you, a discriminatory
+patent license (a) in connection with copies of the covered work
+conveyed by you (or copies made from those copies), or (b) primarily
+for and in connection with specific products or compilations that
+contain the covered work, unless you entered into that arrangement,
+or that patent license was granted, prior to 28 March 2007.
+
+ Nothing in this License shall be construed as excluding or limiting
+any implied license or other defenses to infringement that may
+otherwise be available to you under applicable patent law.
+
+ 12. No Surrender of Others' Freedom.
+
+ If conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot convey a
+covered work so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you may
+not convey it at all. For example, if you agree to terms that obligate you
+to collect a royalty for further conveying from those to whom you convey
+the Program, the only way you could satisfy both those terms and this
+License would be to refrain entirely from conveying the Program.
+
+ 13. Use with the GNU Affero General Public License.
+
+ Notwithstanding any other provision of this License, you have
+permission to link or combine any covered work with a work licensed
+under version 3 of the GNU Affero General Public License into a single
+combined work, and to convey the resulting work. The terms of this
+License will continue to apply to the part which is the covered work,
+but the special requirements of the GNU Affero General Public License,
+section 13, concerning interaction through a network will apply to the
+combination as such.
+
+ 14. Revised Versions of this License.
+
+ The Free Software Foundation may publish revised and/or new versions of
+the GNU General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+ Each version is given a distinguishing version number. If the
+Program specifies that a certain numbered version of the GNU General
+Public License "or any later version" applies to it, you have the
+option of following the terms and conditions either of that numbered
+version or of any later version published by the Free Software
+Foundation. If the Program does not specify a version number of the
+GNU General Public License, you may choose any version ever published
+by the Free Software Foundation.
+
+ If the Program specifies that a proxy can decide which future
+versions of the GNU General Public License can be used, that proxy's
+public statement of acceptance of a version permanently authorizes you
+to choose that version for the Program.
+
+ Later license versions may give you additional or different
+permissions. However, no additional obligations are imposed on any
+author or copyright holder as a result of your choosing to follow a
+later version.
+
+ 15. Disclaimer of Warranty.
+
+ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
+APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
+IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. Limitation of Liability.
+
+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGES.
+
+ 17. Interpretation of Sections 15 and 16.
+
+ If the disclaimer of warranty and limitation of liability provided
+above cannot be given local legal effect according to their terms,
+reviewing courts shall apply local law that most closely approximates
+an absolute waiver of all civil liability in connection with the
+Program, unless a warranty or assumption of liability accompanies a
+copy of the Program in return for a fee.
\ No newline at end of file
diff --git a/ttfonts/SundaneseUnicode-1.0.5.ttf b/packages/Sundanese-Unicode/fonts/SundaneseUnicode-1.0.5.ttf
similarity index 100%
rename from ttfonts/SundaneseUnicode-1.0.5.ttf
rename to packages/Sundanese-Unicode/fonts/SundaneseUnicode-1.0.5.ttf
diff --git a/packages/Tai-Heritage-Pro/Languages.php b/packages/Tai-Heritage-Pro/Languages.php
new file mode 100644
index 000000000..8a3aa10ac
--- /dev/null
+++ b/packages/Tai-Heritage-Pro/Languages.php
@@ -0,0 +1,22 @@
+WriteHTML('
+
+
+Hello World in taiheritagepro
+');
+
+$mpdf->OutputHttpDownload('example.pdf');
+```
+
+## Advanced Installation
+
+To manually register the font package with mPDF, you can initialize the package's `Registration` class and pass it to the `FontRegistry` constructor:
+
+```php
+ $registry
+]);
+```
+
+## License
+
+This package is licensed under the MIT License. Fonts are licensed separately by their authors, and can be found in the [`/fonts/LICENSE.txt`](./fonts/LICENSE.txt) file.
\ No newline at end of file
diff --git a/packages/Tai-Heritage-Pro/Registration.php b/packages/Tai-Heritage-Pro/Registration.php
new file mode 100644
index 000000000..171eaafa6
--- /dev/null
+++ b/packages/Tai-Heritage-Pro/Registration.php
@@ -0,0 +1,73 @@
+ 0xFF, Enable use of OTL features.
+ * ['useKashida'] => 75, Enable use of kashida for text justification in Arabic text
+ *
+ * If a .ttc TrueType collection file is referenced, the number of the font
+ * within the collection is required. Fonts in the collection are numbered
+ * starting at 1, as they appear in the .ttc file.
+ *
+ * @return array{
+ * 'R': string,
+ * 'B'?: string,
+ * 'I'?: string,
+ * 'BI'?: string,
+ * 'sip-ext'?: string,
+ * 'useOTL'?: int,
+ * 'useKashida'?: int,
+ * 'TTCfontID'?: array{
+ * 'R': int,
+ * 'B'?: int,
+ * 'I'?: int,
+ * 'BI'?: int,
+ * }
+ * }
+ */
+ public function getFonts()
+ {
+ return [
+ 'taiheritagepro' => [
+ 'R' => 'TaiHeritagePro-Regular.ttf',
+ 'B' => 'TaiHeritagePro-Bold.ttf',
+ ],
+ ];
+ }
+
+ /**
+ * Get the Language Package LanguageToFont implementation
+ *
+ * @return \Mpdf\Language\LanguageToFontInterface|null
+ */
+ public function getLanguageToFont()
+ {
+ return new Languages();
+ }
+}
diff --git a/packages/Tai-Heritage-Pro/composer.json b/packages/Tai-Heritage-Pro/composer.json
new file mode 100644
index 000000000..859ca2859
--- /dev/null
+++ b/packages/Tai-Heritage-Pro/composer.json
@@ -0,0 +1,21 @@
+{
+ "name": "mpdf/font-tai-heritage-pro",
+ "version": "0.1",
+ "type": "library",
+ "description": "Tai Heritage Pro is a Tai Viet font designed to reflect the traditional hand-written style of the script that is treasured by the Tai people of Vietnam. Supported scripts include: Latin and Tai Viet",
+ "keywords": ["mpdf", "mpdf-fonts"],
+ "license": ["MIT"],
+ "autoload": {
+ "psr-4": {
+ "Mpdf\\Fonts\\TaiHeritagePro\\": ""
+ }
+ },
+ "require": {
+ "mpdf/mpdf": "*"
+ },
+ "extra": {
+ "mpdf": {
+ "fonts": "\\Mpdf\\Fonts\\TaiHeritagePro\\Registration"
+ }
+ }
+}
\ No newline at end of file
diff --git a/ttfonts/KhmerOFL.txt b/packages/Tai-Heritage-Pro/fonts/LICENSE.txt
similarity index 97%
rename from ttfonts/KhmerOFL.txt
rename to packages/Tai-Heritage-Pro/fonts/LICENSE.txt
index bfa6ae45c..d23b1b424 100644
--- a/ttfonts/KhmerOFL.txt
+++ b/packages/Tai-Heritage-Pro/fonts/LICENSE.txt
@@ -1,5 +1,6 @@
-Copyright (c) 2010, Danh Hong (khmertype.blogspot.com),
-with Reserved Font Name Khmer.
+Copyright (c) 1995-2017, SIL International (www.sil.org)
+with Reserved Font Name "Heritage".
+
This Font Software is licensed under the SIL Open Font License, Version 1.1.
This license is copied below, and is also available with a FAQ at:
http://scripts.sil.org/OFL
diff --git a/packages/Tai-Heritage-Pro/fonts/TaiHeritagePro-Bold.ttf b/packages/Tai-Heritage-Pro/fonts/TaiHeritagePro-Bold.ttf
new file mode 100644
index 000000000..300783371
Binary files /dev/null and b/packages/Tai-Heritage-Pro/fonts/TaiHeritagePro-Bold.ttf differ
diff --git a/packages/Tai-Heritage-Pro/fonts/TaiHeritagePro-Regular.ttf b/packages/Tai-Heritage-Pro/fonts/TaiHeritagePro-Regular.ttf
new file mode 100644
index 000000000..53209539b
Binary files /dev/null and b/packages/Tai-Heritage-Pro/fonts/TaiHeritagePro-Regular.ttf differ
diff --git a/packages/UnBatang/Languages.php b/packages/UnBatang/Languages.php
new file mode 100644
index 000000000..e4da055f9
--- /dev/null
+++ b/packages/UnBatang/Languages.php
@@ -0,0 +1,28 @@
+WriteHTML('
+
+
+Hello World in unbatang
+');
+
+$mpdf->OutputHttpDownload('example.pdf');
+```
+
+## Advanced Installation
+
+To manually register the font package with mPDF, you can initialize the package's `Registration` class and pass it to the `FontRegistry` constructor:
+
+```php
+ $registry
+]);
+```
+
+## License
+
+This package is licensed under the MIT License. Fonts are licensed separately by their authors, and can be found in the [`/fonts/LICENSE.txt`](./fonts/LICENSE.txt) file.
\ No newline at end of file
diff --git a/packages/UnBatang/Registration.php b/packages/UnBatang/Registration.php
new file mode 100644
index 000000000..4ceaa0490
--- /dev/null
+++ b/packages/UnBatang/Registration.php
@@ -0,0 +1,101 @@
+ 0xFF, Enable use of OTL features.
+ * ['useKashida'] => 75, Enable use of kashida for text justification in Arabic text
+ *
+ * If a .ttc TrueType collection file is referenced, the number of the font
+ * within the collection is required. Fonts in the collection are numbered
+ * starting at 1, as they appear in the .ttc file.
+ *
+ * @return array{
+ * 'R': string,
+ * 'B'?: string,
+ * 'I'?: string,
+ * 'BI'?: string,
+ * 'sip-ext'?: string,
+ * 'useOTL'?: int,
+ * 'useKashida'?: int,
+ * 'TTCfontID'?: array{
+ * 'R': int,
+ * 'B'?: int,
+ * 'I'?: int,
+ * 'BI'?: int,
+ * }
+ * }
+ */
+ public function getFonts()
+ {
+ return [
+ 'unbatang' => [/* Korean */
+ 'R' => 'UnBatang.ttf',
+ 'B' => 'UnBatangBold.ttf',
+ ],
+ ];
+ }
+
+ /**
+ * Get the Language Package LanguageToFont implementation
+ *
+ * @return \Mpdf\Language\LanguageToFontInterface|null
+ */
+ public function getLanguageToFont()
+ {
+ return new Languages();
+ }
+
+ /**
+ * Define fonts to be used for character substitution, when the useSubstitutions configuration option enabled
+ *
+ * @return array The list of fonts to exclude using the keys found in $this->getFontData()
+ */
+ public function getBackupSubsFonts()
+ {
+ return [
+ 'unbatang',
+ ];
+ }
+
+ /**
+ * Get a list of substituted fonts used when a font is not available in mPDF. Define 'sans_fonts', 'serif_fonts', and 'mono_fonts'
+ * fallback fonts as necessary.
+ *
+ * @return array Multidimensional array with keys 'sans', 'serif', and 'mono'. Each array should use the keys found
+ * in $this->getFontData()
+ */
+ public function getFontFamilySubstitution()
+ {
+ return [
+ 'serif_fonts' => [
+ 'unbatang',
+ ],
+ ];
+ }
+}
diff --git a/packages/UnBatang/composer.json b/packages/UnBatang/composer.json
new file mode 100644
index 000000000..b2254758e
--- /dev/null
+++ b/packages/UnBatang/composer.json
@@ -0,0 +1,22 @@
+{
+
+ "name": "mpdf/font-unbatang",
+ "version": "0.1",
+ "type": "library",
+ "description": "UnBatang is a serif font. Supported scripts include: Korean and Latin.",
+ "keywords": ["mpdf", "mpdf-fonts"],
+ "license": ["MIT"],
+ "autoload": {
+ "psr-4": {
+ "Mpdf\\Fonts\\UnBatang\\": ""
+ }
+ },
+ "require": {
+ "mpdf/mpdf": "*"
+ },
+ "extra": {
+ "mpdf": {
+ "fonts": "\\Mpdf\\Fonts\\UnBatang\\Registration"
+ }
+ }
+}
\ No newline at end of file
diff --git a/packages/UnBatang/fonts/LICENSE.txt b/packages/UnBatang/fonts/LICENSE.txt
new file mode 100644
index 000000000..09a657d9c
--- /dev/null
+++ b/packages/UnBatang/fonts/LICENSE.txt
@@ -0,0 +1,277 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+ 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
diff --git a/ttfonts/UnBatang_0613.ttf b/packages/UnBatang/fonts/UnBatang.ttf
similarity index 88%
rename from ttfonts/UnBatang_0613.ttf
rename to packages/UnBatang/fonts/UnBatang.ttf
index 2e93d5f86..b84dc5dd4 100644
Binary files a/ttfonts/UnBatang_0613.ttf and b/packages/UnBatang/fonts/UnBatang.ttf differ
diff --git a/packages/UnBatang/fonts/UnBatangBold.ttf b/packages/UnBatang/fonts/UnBatangBold.ttf
new file mode 100644
index 000000000..16b081ed0
Binary files /dev/null and b/packages/UnBatang/fonts/UnBatangBold.ttf differ
diff --git a/src/Config/ConfigVariables.php b/src/Config/ConfigVariables.php
index fcbfc0558..0113ee996 100644
--- a/src/Config/ConfigVariables.php
+++ b/src/Config/ConfigVariables.php
@@ -4,6 +4,7 @@
use Mpdf\Css\DefaultCss;
use Mpdf\Language\LanguageToFont;
+use Mpdf\Language\LanguageToFontRegistry;
use Mpdf\Language\ScriptToLanguage;
use Mpdf\Ucdn;
@@ -439,7 +440,7 @@ public function __construct()
'customProperties' => [],
- 'languageToFont' => new LanguageToFont(),
+ 'languageToFont' => new LanguageToFontRegistry([new LanguageToFont()]),
'scriptToLanguage' => new ScriptToLanguage(),
//////////////////////////////////////////////////
@@ -448,9 +449,7 @@ public function __construct()
'pdf_version' => '1.4',
- 'fontDir' => [
- __DIR__ . '/../../ttfonts'
- ],
+ 'fontDir' => [],
'tempDir' => __DIR__ . '/../../tmp',
diff --git a/src/Config/FontVariables.php b/src/Config/FontVariables.php
index a36947352..d59983a4d 100644
--- a/src/Config/FontVariables.php
+++ b/src/Config/FontVariables.php
@@ -25,14 +25,14 @@ public function __construct()
// only works using subsets (otherwise would add very large file)
// More than 1 font can be specified but each will add to the processing time of the script
- 'backupSubsFont' => ['dejavusanscondensed', 'freesans', 'sun-exta'],
+ 'backupSubsFont' => [],
// Optionally set a font (name as defined below in 'fontdata') to use for CJK characters
// in Plane 2 Unicode (> U+20000) when using useSubstitutions.
// Use a font like hannomb or sun-extb if available
// only works using subsets (otherwise would add very large file)
- 'backupSIPFont' => 'sun-extb',
+ 'backupSIPFont' => '',
/*
This array defines translations from font-family in CSS or HTML
@@ -53,9 +53,6 @@ public function __construct()
'trebuchet' => 'trebuchetms',
'comic' => 'comicsansms',
'franklin' => 'franklingothicbook',
- 'ocr-b' => 'ocrb',
- 'ocr-b10bt' => 'ocrb',
- 'damase' => 'mph2bdamase',
],
/*
@@ -92,211 +89,11 @@ public function __construct()
),
*/
- 'fontdata' => [
- "dejavusanscondensed" => [
- 'R' => "DejaVuSansCondensed.ttf",
- 'B' => "DejaVuSansCondensed-Bold.ttf",
- 'I' => "DejaVuSansCondensed-Oblique.ttf",
- 'BI' => "DejaVuSansCondensed-BoldOblique.ttf",
- 'useOTL' => 0xFF,
- 'useKashida' => 75,
- ],
- "dejavusans" => [
- 'R' => "DejaVuSans.ttf",
- 'B' => "DejaVuSans-Bold.ttf",
- 'I' => "DejaVuSans-Oblique.ttf",
- 'BI' => "DejaVuSans-BoldOblique.ttf",
- 'useOTL' => 0xFF,
- 'useKashida' => 75,
- ],
- "dejavuserif" => [
- 'R' => "DejaVuSerif.ttf",
- 'B' => "DejaVuSerif-Bold.ttf",
- 'I' => "DejaVuSerif-Italic.ttf",
- 'BI' => "DejaVuSerif-BoldItalic.ttf",
- ],
- "dejavuserifcondensed" => [
- 'R' => "DejaVuSerifCondensed.ttf",
- 'B' => "DejaVuSerifCondensed-Bold.ttf",
- 'I' => "DejaVuSerifCondensed-Italic.ttf",
- 'BI' => "DejaVuSerifCondensed-BoldItalic.ttf",
- ],
- "dejavusansmono" => [
- 'R' => "DejaVuSansMono.ttf",
- 'B' => "DejaVuSansMono-Bold.ttf",
- 'I' => "DejaVuSansMono-Oblique.ttf",
- 'BI' => "DejaVuSansMono-BoldOblique.ttf",
- 'useOTL' => 0xFF,
- 'useKashida' => 75,
- ],
- "freesans" => [
- 'R' => "FreeSans.ttf",
- 'B' => "FreeSansBold.ttf",
- 'I' => "FreeSansOblique.ttf",
- 'BI' => "FreeSansBoldOblique.ttf",
- 'useOTL' => 0xFF,
- ],
- "freeserif" => [
- 'R' => "FreeSerif.ttf",
- 'B' => "FreeSerifBold.ttf",
- 'I' => "FreeSerifItalic.ttf",
- 'BI' => "FreeSerifBoldItalic.ttf",
- 'useOTL' => 0xFF,
- 'useKashida' => 75,
- ],
- "freemono" => [
- 'R' => "FreeMono.ttf",
- 'B' => "FreeMonoBold.ttf",
- 'I' => "FreeMonoOblique.ttf",
- 'BI' => "FreeMonoBoldOblique.ttf",
- ],
- /* OCR-B font for Barcodes */
- "ocrb" => [
- 'R' => "ocrb10.ttf",
- ],
- /* Miscellaneous language font(s) */
- "estrangeloedessa" => [/* Syriac */
- 'R' => "SyrCOMEdessa.otf",
- 'useOTL' => 0xFF,
- ],
- "kaputaunicode" => [/* Sinhala */
- 'R' => "kaputaunicode.ttf",
- 'useOTL' => 0xFF,
- ],
- "abyssinicasil" => [/* Ethiopic */
- 'R' => "Abyssinica_SIL.ttf",
- 'useOTL' => 0xFF,
- ],
- "aboriginalsans" => [/* Cherokee and Canadian */
- 'R' => "AboriginalSansREGULAR.ttf",
- ],
- "jomolhari" => [/* Tibetan */
- 'R' => "Jomolhari.ttf",
- 'useOTL' => 0xFF,
- ],
- "sundaneseunicode" => [/* Sundanese */
- 'R' => "SundaneseUnicode-1.0.5.ttf",
- 'useOTL' => 0xFF,
- ],
- "taiheritagepro" => [/* Tai Viet */
- 'R' => "TaiHeritagePro.ttf",
- ],
- "aegean" => [
- 'R' => "Aegean.otf",
- 'useOTL' => 0xFF,
- ],
- "aegyptus" => [
- 'R' => "Aegyptus.otf",
- 'useOTL' => 0xFF,
- ],
- "akkadian" => [/* Cuneiform */
- 'R' => "Akkadian.otf",
- 'useOTL' => 0xFF,
- ],
- "quivira" => [
- 'R' => "Quivira.otf",
- 'useOTL' => 0xFF,
- ],
- "eeyekunicode" => [/* Meetei Mayek */
- 'R' => "Eeyek-Regular.ttf",
- ],
- "lannaalif" => [/* Tai Tham */
- 'R' => "lannaalif-v1-03.ttf",
- 'useOTL' => 0xFF,
- ],
- "daibannasilbook" => [/* New Tai Lue */
- 'R' => "DBSILBR.ttf",
- ],
- "garuda" => [/* Thai */
- 'R' => "Garuda.ttf",
- 'B' => "Garuda-Bold.ttf",
- 'I' => "Garuda-Oblique.ttf",
- 'BI' => "Garuda-BoldOblique.ttf",
- 'useOTL' => 0xFF,
- ],
- "khmeros" => [/* Khmer */
- 'R' => "KhmerOS.ttf",
- 'useOTL' => 0xFF,
- ],
- "dhyana" => [/* Lao fonts */
- 'R' => "Dhyana-Regular.ttf",
- 'B' => "Dhyana-Bold.ttf",
- 'useOTL' => 0xFF,
- ],
- "tharlon" => [/* Myanmar / Burmese */
- 'R' => "Tharlon-Regular.ttf",
- 'useOTL' => 0xFF,
- ],
- "padaukbook" => [/* Myanmar / Burmese */
- 'R' => "Padauk-book.ttf",
- 'useOTL' => 0xFF,
- ],
- "zawgyi-one" => [/* Myanmar / Burmese */
- 'R' => "ZawgyiOne.ttf",
- 'useOTL' => 0xFF,
- ],
- "ayar" => [/* Myanmar / Burmese */
- 'R' => "ayar.ttf",
- 'useOTL' => 0xFF,
- ],
- "taameydavidclm" => [/* Hebrew with full Niqud and Cantillation */
- 'R' => "TaameyDavidCLM-Medium.ttf",
- 'useOTL' => 0xFF,
- ],
- /* SMP */
- "mph2bdamase" => [
- 'R' => "damase_v.2.ttf",
- ],
- /* Indic */
- "lohitkannada" => [
- 'R' => "Lohit-Kannada.ttf",
- 'useOTL' => 0xFF,
- ],
- "pothana2000" => [
- 'R' => "Pothana2000.ttf",
- 'useOTL' => 0xFF,
- ],
- /* Arabic fonts */
- "xbriyaz" => [
- 'R' => "XB Riyaz.ttf",
- 'B' => "XB RiyazBd.ttf",
- 'I' => "XB RiyazIt.ttf",
- 'BI' => "XB RiyazBdIt.ttf",
- 'useOTL' => 0xFF,
- 'useKashida' => 75,
- ],
- "lateef" => [/* Sindhi, Pashto and Urdu */
- 'R' => "LateefRegOT.ttf",
- 'useOTL' => 0xFF,
- 'useKashida' => 75,
- ],
- "kfgqpcuthmantahanaskh" => [/* KFGQPC Uthman Taha Naskh - Koranic */
- 'R' => "Uthman.otf",
- 'useOTL' => 0xFF,
- 'useKashida' => 75,
- ],
- /* CJK fonts */
- "sun-exta" => [
- 'R' => "Sun-ExtA.ttf",
- 'sip-ext' => 'sun-extb', /* SIP=Plane2 Unicode (extension B) */
- ],
- "sun-extb" => [
- 'R' => "Sun-ExtB.ttf",
- ],
- "unbatang" => [/* Korean */
- 'R' => "UnBatang_0613.ttf",
- ],
- ],
+ 'fontdata' => [],
// Add fonts to this array if they contain characters in the SIP or SMP Unicode planes
// but you do not require them. This allows a more efficient form of subsetting to be used.
- 'BMPonly' => [
- "dejavusanscondensed",
- "dejavusans",
- "dejavuserifcondensed",
- "dejavuserif",
- "dejavusansmono",
- ],
+ 'BMPonly' => [],
// These next 3 arrays do two things:
// 1. If a font referred to in HTML/CSS is not available to mPDF, these arrays will determine whether
@@ -305,20 +102,20 @@ public function __construct()
// (Otherwise the order is irrelevant)
// Use the mPDF font-family names i.e. lowercase and no spaces (after any translations in $fonttrans)
// Always include "sans-serif", "serif" and "monospace" etc.
- 'sans_fonts' => ['dejavusanscondensed', 'sans', 'sans-serif', 'cursive', 'fantasy', 'dejavusans', 'freesans', 'liberationsans',
+ 'sans_fonts' => ['sans', 'sans-serif', 'cursive', 'fantasy', 'liberationsans',
'arial', 'helvetica', 'verdana', 'geneva', 'lucida', 'arialnarrow', 'arialblack',
- 'franklin', 'franklingothicbook', 'tahoma', 'garuda', 'calibri', 'trebuchet', 'lucidagrande', 'microsoftsansserif',
- 'trebuchetms', 'lucidasansunicode', 'franklingothicmedium', 'albertusmedium', 'xbriyaz', 'albasuper', 'quillscript',
+ 'franklin', 'franklingothicbook', 'tahoma', 'calibri', 'trebuchet', 'lucidagrande', 'microsoftsansserif',
+ 'trebuchetms', 'lucidasansunicode', 'franklingothicmedium', 'albertusmedium', 'albasuper', 'quillscript',
'humanist777', 'humanist777black', 'humanist777light', 'futura', 'hobo', 'segoeprint'
],
- 'serif_fonts' => ['dejavuserifcondensed', 'serif', 'dejavuserif', 'freeserif', 'liberationserif',
+ 'serif_fonts' => ['serif', 'liberationserif',
'timesnewroman', 'times', 'centuryschoolbookl', 'palatinolinotype', 'centurygothic',
'bookmanoldstyle', 'bookantiqua', 'cyberbit', 'cambria',
'norasi', 'charis', 'palatino', 'constantia', 'georgia', 'albertus', 'xbzar', 'algerian', 'garamond',
],
- 'mono_fonts' => ['dejavusansmono', 'mono', 'monospace', 'freemono', 'liberationmono', 'courier', 'ocrb', 'ocr-b', 'lucidaconsole',
+ 'mono_fonts' => ['mono', 'monospace', 'liberationmono', 'courier', 'lucidaconsole',
'couriernew', 'monotypecorsiva'
],
];
diff --git a/src/Fonts/FontRegistration.php b/src/Fonts/FontRegistration.php
new file mode 100644
index 000000000..89f78ca3e
--- /dev/null
+++ b/src/Fonts/FontRegistration.php
@@ -0,0 +1,133 @@
+ 0xFF, Enable use of OTL features.
+ * ['useKashida'] => 75, Enable use of kashida for text justification in Arabic text
+ *
+ * If a .ttc TrueType collection file is referenced, the number of the font
+ * within the collection is required. Fonts in the collection are numbered
+ * starting at 1, as they appear in the .ttc file.
+ *
+ * @return array{
+ * 'R': string,
+ * 'B'?: string,
+ * 'I'?: string,
+ * 'BI'?: string,
+ * 'sip-ext'?: string,
+ * 'useOTL'?: int,
+ * 'useKashida'?: int,
+ * 'TTCfontID'?: array{
+ * 'R': int,
+ * 'B'?: int,
+ * 'I'?: int,
+ * 'BI'?: int,
+ * }
+ * }
+ */
+ abstract public function getFonts();
+
+ /**
+ * Font alias mapping
+ *
+ * @return array{string, string} [ 'aliasName' => 'fontKey' ]
+ */
+ public function getFontAliases()
+ {
+ return [];
+ }
+
+ /**
+ * Get the Language Package LanguageToFont implementation
+ *
+ * @return \Mpdf\Language\LanguageToFontInterface|null
+ */
+ public function getLanguageToFont()
+ {
+ return null;
+ }
+
+ /**
+ * Define fonts to be used for character substitution, when the useSubstitutions configuration option enabled
+ *
+ * @return array The list of fonts to exclude using the keys found in $this->getFontData()
+ */
+ public function getBackupSubsFonts()
+ {
+ return [];
+ }
+
+ /**
+ * Get a list of fonts which contain characters in the SIP or SMP Unicode planes but is not required.
+ * This allows a more efficient form of subsetting to be used.
+ *
+ * @return array The list of fonts to exclude using the keys found in $this->getFontData()
+ */
+ public function getBmpFonts()
+ {
+ return [];
+ }
+
+ /**
+ * Get a list of substituted fonts used when a font is not available in mPDF
+ *
+ * @return array Multidimensional array with keys 'sans_fonts', 'serif_fonts', and 'mono_fonts'
+ */
+ public function getFontFamilySubstitution()
+ {
+ return [
+ 'sans_fonts' => [],
+ 'serif_fonts' => [],
+ 'mono_fonts' => [],
+ ];
+ }
+
+ /**
+ * Get the line-breaking dictionaries the package provides
+ *
+ * Thai, Khmer and Lao have no inter-word spaces, so mPDF finds word boundaries with a
+ * pre-built dictionary. Packages carrying a font for one of those scripts ship the
+ * matching dictionary alongside it.
+ *
+ * @return array mPDF shaper letter ('T' Thai, 'K' Khmer, 'L' Lao) => absolute .dat path
+ */
+ public function getLineBreakDictionaries()
+ {
+ return [];
+ }
+
+}
diff --git a/src/Fonts/FontRegistrationInterface.php b/src/Fonts/FontRegistrationInterface.php
new file mode 100644
index 000000000..744ee7e6d
--- /dev/null
+++ b/src/Fonts/FontRegistrationInterface.php
@@ -0,0 +1,110 @@
+ 0xFF, Enable use of OTL features.
+ * ['useKashida'] => 75, Enable use of kashida for text justification in Arabic text
+ *
+ * If a .ttc TrueType collection file is referenced, the number of the font
+ * within the collection is required. Fonts in the collection are numbered
+ * starting at 1, as they appear in the .ttc file.
+ *
+ * @return array{
+ * 'R': string,
+ * 'B'?: string,
+ * 'I'?: string,
+ * 'BI'?: string,
+ * 'sip-ext'?: string,
+ * 'useOTL'?: int,
+ * 'useKashida'?: int,
+ * 'TTCfontID'?: array{
+ * 'R': int,
+ * 'B'?: int,
+ * 'I'?: int,
+ * 'BI'?: int,
+ * }
+ * }
+ */
+ public function getFonts();
+
+ /**
+ * Font alias mapping
+ *
+ * @return array{string, string} [ 'aliasName' => 'fontKey' ]
+ */
+ public function getFontAliases();
+
+ /**
+ * Get the Language Package LanguageToFont implementation
+ *
+ * @return LanguageToFontInterface|null
+ */
+ public function getLanguageToFont();
+
+ /**
+ * Define fonts to be used for character substitution, when the useSubstitutions configuration option enabled
+ *
+ * @return array The list of fonts to exclude using the keys found in $this->getFontData()
+ */
+ public function getBackupSubsFonts();
+
+ /**
+ * Get a list of fonts which contain characters in the SIP or SMP Unicode planes but is not required.
+ * This allows a more efficient form of subsetting to be used.
+ *
+ * @return array The list of fonts to exclude using the keys found in $this->getFontData()
+ */
+ public function getBmpFonts();
+
+ /**
+ * Get a list of substituted fonts used when a font is not available in mPDF
+ *
+ * @return array Multidimensional array with keys 'sans_fonts', 'serif_fonts', and 'mono_fonts'
+ */
+ public function getFontFamilySubstitution();
+
+ /**
+ * Get the line-breaking dictionaries the package provides
+ *
+ * Thai, Khmer and Lao have no inter-word spaces, so mPDF finds word boundaries with a
+ * pre-built dictionary. Packages carrying a font for one of those scripts ship the
+ * matching dictionary alongside it.
+ *
+ * @return array mPDF shaper letter ('T' Thai, 'K' Khmer, 'L' Lao) => absolute .dat path
+ */
+ public function getLineBreakDictionaries();
+
+}
diff --git a/src/Fonts/FontRegistry.php b/src/Fonts/FontRegistry.php
new file mode 100644
index 000000000..8692aa9d4
--- /dev/null
+++ b/src/Fonts/FontRegistry.php
@@ -0,0 +1,169 @@
+logger = $logger ?: new NullLogger();
+
+ /* Manually load the font packages */
+ if (!is_null($classes)) {
+ $classes = is_array($classes) ? $classes : [$classes];
+ foreach ($classes as $class) {
+ $this->add($class);
+ }
+
+ return;
+ }
+
+ /* Automatically load the font packages from composer */
+ if (is_null($composerLockPath)) {
+ /* step up a directory until the lock file is found */
+ $targetParent = dirname(__DIR__);
+ while ($targetParent !== '.' && !is_file($targetParent . '/composer.lock')) {
+ $targetParent = dirname($targetParent);
+ }
+
+ $composerLockPath = $targetParent . '/composer.lock';
+ }
+
+ if (!is_file($composerLockPath) || !is_readable($composerLockPath)) {
+ /* Distributions that strip composer.lock get an empty registry, not a fatal */
+ $this->logger->warning(sprintf('Composer lock file "%s" not found/readable; no font packages registered', $composerLockPath));
+
+ return;
+ }
+
+ $this->autoloadFonts($composerLockPath);
+ }
+
+ /**
+ * Parse the composer.lock file and autoload mPDF font packages
+ *
+ * @param string $composerLockPath
+ * @return void
+ * @throws MpdfException
+ */
+ protected function autoloadFonts($composerLockPath)
+ {
+ $jsonData = @file_get_contents($composerLockPath);
+
+ if (false === $jsonData) {
+ throw new MpdfException($composerLockPath);
+ }
+
+ $data = json_decode($jsonData, true);
+ $jsonError = json_last_error();
+ if (JSON_ERROR_NONE !== $jsonError) {
+ throw new MpdfException($composerLockPath, $jsonError);
+ }
+
+ $fontPackages = [];
+ foreach (['packages', 'packages-dev'] as $composerKeys) {
+ if (!isset($data[$composerKeys]) || !is_array($data[$composerKeys])) {
+ continue;
+ }
+
+ foreach ($data[$composerKeys] as $packageData) {
+ if (!isset($packageData['extra']['mpdf']['fonts']) || !class_exists($packageData['extra']['mpdf']['fonts'])) {
+ continue;
+ }
+
+ $order = isset($packageData['extra']['mpdf']['fontOrder']) ? (int) $packageData['extra']['mpdf']['fontOrder'] : 0;
+
+ $fontPackages[$order][] = $packageData['extra']['mpdf']['fonts'];
+ }
+ }
+
+ ksort($fontPackages);
+ foreach ($fontPackages as $packages) {
+ foreach ($packages as $package) {
+ $this->add(new $package());
+ }
+ }
+ }
+
+ /**
+ * Add a Font Package
+ *
+ * Packages are read back most-recently-added first, and one already registered under the same
+ * id is replaced rather than duplicated.
+ *
+ * @param FontRegistrationInterface $class
+ */
+ public function add(FontRegistrationInterface $class)
+ {
+ $this->register = [$class->getId() => $class] + $this->register;
+ }
+
+ /**
+ * Remove a Font Package by its id
+ *
+ * @param string $name
+ *
+ * @throws MpdfException
+ */
+ public function remove($name)
+ {
+ if (!isset($this->register[$name])) {
+ throw new MpdfException('Could not find font package in registry');
+ }
+
+ unset($this->register[$name]);
+ }
+
+ /**
+ * Get all registered Font Packages
+ *
+ * @return FontRegistrationInterface[]
+ */
+ public function getAll()
+ {
+ return $this->register;
+ }
+
+ /**
+ * @param bool $autoloadConfig
+ * @return void
+ */
+ public function setAutoloadConfigSetting($autoloadConfig)
+ {
+ $this->autoloadConfig = (bool) $autoloadConfig;
+ }
+
+ /**
+ * @return bool
+ */
+ public function getAutoloadConfigSetting()
+ {
+ return $this->autoloadConfig;
+ }
+}
diff --git a/src/Language/LanguageToFont.php b/src/Language/LanguageToFont.php
index 58a66d29d..641cf936a 100644
--- a/src/Language/LanguageToFont.php
+++ b/src/Language/LanguageToFont.php
@@ -5,9 +5,9 @@
class LanguageToFont implements \Mpdf\Language\LanguageToFontInterface
{
- public function getLanguageOptions($llcc, $adobeCJK)
+ public function getLanguageOptions($mode, $adobeCJK)
{
- $tags = explode('-', $llcc);
+ $tags = explode('-', $mode);
$lang = strtolower($tags[0]);
$country = '';
$script = '';
@@ -28,7 +28,7 @@ public function getLanguageOptions($llcc, $adobeCJK)
switch ($lang) {
/* European */
case 'en':
- case 'eng': // English // LATIN
+ case 'eng': // English
case 'eu':
case 'eus': // Basque
case 'br':
@@ -144,261 +144,154 @@ public function getLanguageOptions($llcc, $adobeCJK)
case 'tuk': // Turkmen
case 'uk':
case 'ukr': // Ukrainian
- $unifont = 'dejavusanscondensed'; /* freeserif best coverage for supplements etc. */
- break;
-
case 'hy':
case 'hye': // ARMENIAN
- $unifont = 'dejavusans';
- break;
case 'ka':
case 'kat': // GEORGIAN
- $unifont = 'dejavusans';
- break;
-
case 'el':
case 'ell': // GREEK
- $unifont = 'dejavusanscondensed';
- break;
- case 'cop': // COPTIC
- $unifont = 'quivira';
- break;
-
- case 'got': // GOTHIC
- $unifont = 'freeserif';
- break;
+ case 'cop': // COPTIC
+ case 'got': // GOTHIC
/* African */
- case 'nqo': // NKO
- $unifont = 'dejavusans';
- break;
- //CASE 'bax': // BAMUM
- //CASE 'ha': CASE 'hau': // Hausa
- case 'vai': // VAI
- $unifont = 'freesans';
- break;
+ case 'nqo': // NKO
+ case 'bax': // BAMUM
+ case 'ha':
+ case 'hau': // Hausa
+ case 'vai': // VAI
case 'am':
case 'amh': // Amharic ETHIOPIC
case 'ti':
case 'tir': // Tigrinya ETHIOPIC
- $unifont = 'abyssinicasil';
- break;
/* Middle Eastern */
case 'ar':
case 'ara': // Arabic NB Arabic text identified by Autofont will be marked as und-Arab
- $unifont = 'xbriyaz';
- break;
case 'fa':
case 'fas': // Persian (Farsi)
- $unifont = 'xbriyaz';
- break;
case 'ps':
case 'pus': // Pashto
- $unifont = 'xbriyaz';
- break;
case 'ku':
case 'kur': // Kurdish
- $unifont = 'xbriyaz';
- break;
case 'ur':
case 'urd': // Urdu
- $unifont = 'xbriyaz';
- break;
case 'he':
case 'heb': // HEBREW
case 'yi':
case 'yid': // Yiddish
- $unifont = 'taameydavidclm'; // dejavusans,dejavusanscondensed,freeserif are fine if you do not need cantillation marks
- break;
-
- case 'syr': // SYRIAC
- $unifont = 'estrangeloedessa';
- break;
-
- //CASE 'arc': // IMPERIAL_ARAMAIC
- //CASE ''ae: // AVESTAN
- case 'xcr': // CARIAN
- $unifont = 'aegean';
- break;
- case 'xlc': // LYCIAN
- $unifont = 'aegean';
- break;
- case 'xld': // LYDIAN
- $unifont = 'aegean';
- break;
- //CASE 'mid': // MANDAIC
- //CASE 'peo': // OLD_PERSIAN
- case 'phn': // PHOENICIAN
- $unifont = 'aegean';
- break;
- //CASE 'smp': // SAMARITAN
- case 'uga': // UGARITIC
- $unifont = 'aegean';
- break;
+ case 'syr': // SYRIAC
+ case 'arc': // IMPERIAL_ARAMAIC
+ case 'ae': // AVESTAN
+ case 'xcr': // CARIAN
+ case 'xlc': // LYCIAN
+ case 'xld': // LYDIAN
+ case 'mid': // MANDAIC
+ case 'peo': // OLD_PERSIAN
+ case 'phn': // PHOENICIAN
+ case 'smp': // SAMARITAN
+ case 'uga': // UGARITIC
/* Central Asian */
case 'bo':
case 'bod': // TIBETAN
case 'dz':
case 'dzo': // Dzongkha
- $unifont = 'jomolhari';
- break;
-
- //CASE 'mn': CASE 'mon': // MONGOLIAN (Vertical script)
- //CASE 'ug': CASE 'uig': // Uyghur
- //CASE 'uz': CASE 'uzb': // Uzbek
- //CASE 'az': CASE 'azb': // South Azerbaijani
+ case 'mn':
+ case 'mon': // MONGOLIAN (Vertical script)
+ case 'ug':
+ case 'uig': // Uyghur
+ case 'uz':
+ case 'uzb': // Uzbek
+ case 'az':
+ case 'azb': // South Azerbaijani
/* South Asian */
case 'as':
case 'asm': // Assamese
- $unifont = 'freeserif';
- break;
case 'bn':
case 'ben': // BENGALI; Bangla
- $unifont = 'freeserif';
- break;
case 'ks':
case 'kas': // Kashmiri
- $unifont = 'freeserif';
- break;
case 'hi':
case 'hin': // Hindi DEVANAGARI
case 'bh':
case 'bih': // Bihari (Bhojpuri, Magahi, and Maithili)
case 'sa':
case 'san': // Sanskrit
- $unifont = 'freeserif';
- break;
case 'gu':
case 'guj': // Gujarati
- $unifont = 'freeserif';
- break;
case 'pa':
case 'pan': // Panjabi, Punjabi GURMUKHI
- $unifont = 'freeserif';
- break;
case 'kn':
case 'kan': // Kannada
- $unifont = 'lohitkannada';
- break;
case 'mr':
case 'mar': // Marathi
- $unifont = 'freeserif';
- break;
case 'ml':
case 'mal': // MALAYALAM
- $unifont = 'freeserif';
- break;
case 'ne':
case 'nep': // Nepali
- $unifont = 'freeserif';
- break;
case 'or':
case 'ori': // ORIYA
- $unifont = 'freeserif';
- break;
case 'si':
case 'sin': // SINHALA
- $unifont = 'kaputaunicode';
- break;
case 'ta':
case 'tam': // TAMIL
- $unifont = 'freeserif';
- break;
case 'te':
case 'tel': // TELUGU
- $unifont = 'pothana2000';
+ // Do nothing
break;
// Sindhi (Arabic or Devanagari)
case 'sd':
case 'snd': // Sindhi
- $unifont = 'lateef';
if ($country === 'in') {
$unifont = 'freeserif';
}
break;
- //CASE 'ccp': // CHAKMA
- //CASE 'lep': // LEPCHA
- case 'lif': // LIMBU
- $unifont = 'sun-exta';
- break;
- //CASE 'sat': // OL_CHIKI
- //CASE 'saz': // SAURASHTRA
- case 'syl': // SYLOTI_NAGRI
- $unifont = 'mph2bdamase';
- break;
- //CASE 'dgo': // TAKRI
+ case 'ccp': // CHAKMA
+ case 'lep': // LEPCHA
+ case 'lif': // LIMBU
+ case 'sat': // OL_CHIKI
+ case 'saz': // SAURASHTRA
+ case 'syl': // SYLOTI_NAGRI
+ case 'dgo': // TAKRI
case 'dv':
case 'div': // Divehi; Maldivian THAANA
- $unifont = 'freeserif';
- break;
/* South East Asian */
case 'km':
case 'khm': // KHMER
- $unifont = 'khmeros';
- break;
case 'lo':
case 'lao': // LAO
- $unifont = 'dhyana';
- break;
case 'my':
case 'mya': // MYANMAR Burmese
- $unifont = 'tharlon'; // zawgyi-one is non-unicode compliant but in wide usage
- // ayar is also not strictly compliant
- // padaukbook is unicode compliant
- break;
case 'th':
case 'tha': // THAI
- $unifont = 'garuda';
- break;
-
- // VIETNAMESE
case 'vi':
case 'vie': // Vietnamese
- $unifont = 'dejavusanscondensed';
- break;
-
- //CASE 'ms': CASE 'msa': // Malay
- //CASE 'ban': // BALINESE
- //CASE 'bya': // BATAK
- case 'bug': // BUGINESE
- $unifont = 'freeserif';
- break;
- //CASE 'cjm': // CHAM
- //CASE 'jv': // JAVANESE
- case 'su': // SUNDANESE
- $unifont = 'sundaneseunicode';
- break;
- case 'tdd': // TAI_LE
- $unifont = 'tharlon';
- break;
- case 'blt': // TAI_VIET
- $unifont = 'taiheritagepro';
- break;
+ case 'ms':
+ case 'msa': // Malay
+ case 'ban': // BALINESE
+ case 'bya': // BATAK
+ case 'bug': // BUGINESE
+ case 'cjm': // CHAM
+ case 'jv': // JAVANESE
+ case 'su': // SUNDANESE
+ case 'tdd': // TAI_LE
+ case 'blt': // TAI_VIET
/* Phillipine */
- case 'bku': // BUHID
- $unifont = 'quivira';
- break;
- case 'hnn': // HANUNOO
- $unifont = 'quivira';
- break;
- case 'tl': // TAGALOG
- $unifont = 'quivira';
- break;
- case 'tbw': // TAGBANWA
- $unifont = 'quivira';
+ case 'bku': // BUHID
+ case 'hnn': // HANUNOO
+ case 'tl': // TAGALOG
+ case 'tbw': // TAGBANWA
+ // Do nothing
break;
/* East Asian */
case 'zh':
case 'zho': // Chinese
- $unifont = 'sun-exta';
if ($adobeCJK) {
$unifont = 'gb';
if ($country === 'hk' || $country === 'tw') {
@@ -406,40 +299,39 @@ public function getLanguageOptions($llcc, $adobeCJK)
}
}
break;
+
case 'ko':
case 'kor': // HANGUL Korean
- $unifont = 'unbatang';
if ($adobeCJK) {
$unifont = 'uhc';
}
break;
+
case 'ja':
case 'jpn': // Japanese HIRAGANA KATAKANA
- $unifont = 'sun-exta';
if ($adobeCJK) {
$unifont = 'sjis';
}
break;
+
case 'ii':
case 'iii': // Nuosu; Yi
- $unifont = 'sun-exta';
if ($adobeCJK) {
$unifont = 'gb';
}
break;
- case 'lis': // LISU
- $unifont = 'quivira';
- break;
+
+ case 'lis': // LISU
/* American */
- case 'chr': // CHEROKEE
+ case 'chr': // CHEROKEE
case 'oj':
case 'oji': // Ojibwe; Chippewa
case 'cr':
case 'cre': // Cree CANADIAN_ABORIGINAL
case 'iu':
case 'iku': // Inuktitut
- $unifont = 'aboriginalsans';
+ // Do nothing
break;
/* Undetermined language - script used */
@@ -456,91 +348,69 @@ protected function fontByScript($script, $adobeCJK)
switch ($script) {
/* European */
case 'latn': // LATIN
- return 'dejavusanscondensed';
case 'cyrl': // CYRILLIC
- return 'dejavusanscondensed'; /* freeserif best coverage for supplements etc. */
case 'cprt': // CYPRIOT
- return 'aegean';
- case 'glag': // GLAGOLITIC
- return 'mph2bdamase';
+ case 'glag': // GLAGOLITIC;
case 'linb': // LINEAR_B
- return 'aegean';
case 'ogam': // OGHAM
- return 'dejavusans';
case 'ital': // OLD_ITALIC
- return 'aegean';
case 'runr': // RUNIC
- return 'sun-exta';
case 'shaw': // SHAVIAN
- return 'mph2bdamase';
/* African */
case 'egyp': // EGYPTIAN_HIEROGLYPHS
- return 'aegyptus';
case 'ethi': // ETHIOPIC
- return 'abyssinicasil';
- //CASE 'merc': // MEROITIC_CURSIVE
- //CASE 'mero': // MEROITIC_HIEROGLYPHS
+ case 'merc': // MEROITIC_CURSIVE
+ case 'mero': // MEROITIC_HIEROGLYPHS
case 'osma': // OSMANYA
- return 'mph2bdamase';
case 'tfng': // TIFINAGH
- return 'dejavusans';
/* Middle Eastern */
- case 'arab': // ARABIC
- return 'xbriyaz';
+ case 'arab': // ARABIC
case 'xsux': // CUNEIFORM
- return 'akkadian';
- //CASE 'sarb': // OLD_SOUTH_ARABIAN
- //CASE 'prti': // INSCRIPTIONAL_PARTHIAN
- //CASE 'phli': // INSCRIPTIONAL_PAHLAVI
-
+ case 'sarb': // OLD_SOUTH_ARABIAN
+ case 'prti': // INSCRIPTIONAL_PARTHIAN
+ case 'phli': // INSCRIPTIONAL_PAHLAVI
/* Central Asian */
- //CASE 'orkh': // OLD_TURKIC
- //CASE 'phag': // PHAGS_PA (Vertical script)
+ case 'orkh': // OLD_TURKIC
+ case 'phag': // PHAGS_PA (Vertical script)
/* South Asian */
- //CASE 'brah': // BRAHMI
- //CASE 'kthi': // KAITHI
+ case 'brah': // BRAHMI
+ case 'kthi': // KAITHI
case 'khar': // KHAROSHTHI
- return 'mph2bdamase';
case 'mtei': // MEETEI_MAYEK
- return 'eeyekunicode';
- //CASE 'shrd': // SHARADA
- //CASE 'sora': // SORA_SOMPENG
+ case 'shrd': // SHARADA
+ case 'sora': // SORA_SOMPENG
/* South East Asian */
case 'kali': // KAYAH_LI
- return 'freemono';
- //CASE 'rjng': // REJANG
+ case 'rjng': // REJANG
case 'lana': // TAI_THAM
- return 'lannaalif';
case 'talu': // NEW_TAI_LUE
- return 'daibannasilbook';
+ // Do nothing
+ break;
/* East Asian */
case 'hans': // HAN (SIMPLIFIED)
if ($adobeCJK) {
return 'gb';
}
- return 'sun-exta';
+ break;
+
case 'bopo': // BOPOMOFO
- return 'sun-exta';
- //CASE 'plrd': // MIAO
+ case 'plrd': // MIAO
case 'yiii': // YI
- return 'sun-exta';
/* American */
case 'dsrt': // DESERET
- return 'mph2bdamase';
/* Other */
case 'brai': // BRAILLE
- return 'dejavusans';
}
- return null;
+ return '';
}
}
diff --git a/src/Language/LanguageToFontInterface.php b/src/Language/LanguageToFontInterface.php
index 956c5163d..60a556507 100644
--- a/src/Language/LanguageToFontInterface.php
+++ b/src/Language/LanguageToFontInterface.php
@@ -24,6 +24,6 @@
interface LanguageToFontInterface
{
- public function getLanguageOptions($llcc, $adobeCJK);
+ public function getLanguageOptions($mode, $adobeCJK);
}
diff --git a/src/Language/LanguageToFontRegistry.php b/src/Language/LanguageToFontRegistry.php
new file mode 100644
index 000000000..e14ba5f4d
--- /dev/null
+++ b/src/Language/LanguageToFontRegistry.php
@@ -0,0 +1,57 @@
+add($languageClass);
+ }
+ }
+
+ public function add(LanguageToFontInterface $class)
+ {
+ $this->register = [get_class($class) => $class] + $this->register;
+ }
+
+ public function remove($key)
+ {
+ if (!isset($this->register[$key])) {
+ throw new MpdfException('Could not find language package in registry');
+ }
+
+ unset($this->register[$key]);
+ }
+
+ public function getAll()
+ {
+ return $this->register;
+ }
+
+ public function getLanguageOptions($mode, $adobeCJK)
+ {
+ foreach ($this->getAll() as $languageClass) {
+ $font = $languageClass->getLanguageOptions($mode, $adobeCJK);
+ if (!empty($font)) {
+ return is_array($font) ? $font : [false, $font];
+ }
+ }
+
+ return [false, ''];
+ }
+}
diff --git a/src/Mpdf.php b/src/Mpdf.php
index ba43ec64b..60f209e25 100644
--- a/src/Mpdf.php
+++ b/src/Mpdf.php
@@ -7,6 +7,7 @@
use Mpdf\Conversion;
use Mpdf\Css\Border;
use Mpdf\Css\TextVars;
+use Mpdf\Fonts\FontRegistry;
use Mpdf\Log\Context as LogContext;
use Mpdf\Fonts\MetricsGenerator;
use Mpdf\Output\Destination;
@@ -88,6 +89,9 @@ class Mpdf implements \Psr\Log\LoggerAwareInterface
var $backupSubsFont;
var $backupSIPFont;
+
+ /** @var array Shaper letter => absolute path of a line-breaking dictionary */
+ var $lineBreakDictionaries = [];
var $fonttrans;
var $debugfonts;
var $useAdobeCJK;
@@ -963,7 +967,7 @@ class Mpdf implements \Psr\Log\LoggerAwareInterface
private $imageProcessor;
/**
- * @var \Mpdf\Language\LanguageToFontInterface
+ * @var \Mpdf\Language\LanguageToFontRegistry
*/
private $languageToFont;
@@ -1348,6 +1352,7 @@ public function __construct(array $config = [], $container = null)
$this->SetDisplayPreferences('');
$this->initFontConfig($originalConfig);
+ $this->initFontRegistry($originalConfig);
// Available fonts
$this->available_unifonts = [];
@@ -1411,6 +1416,12 @@ public function __construct(array $config = [], $container = null)
$this->default_lang = $mode;
}
+ /* No fonts registered. Force Core mode */
+ if (count($this->available_unifonts) === 0) {
+ $onlyCoreFonts = true;
+ $this->useAdobeCJK = true;
+ }
+
$this->onlyCoreFonts = $onlyCoreFonts;
if ($this->onlyCoreFonts) {
@@ -1627,6 +1638,89 @@ private function initFontConfig(array $config)
return $config;
}
+ /**
+ * Load Font Packages
+ *
+ * @param array $config
+ * @return void
+ * @throws MpdfException
+ */
+ protected function initFontRegistry(array $config)
+ {
+ /* Init font package config arrays for the font registry */
+ $fontPackageConfigKeys = ['fonttrans', 'backupSubsFont', 'BMPonly', 'sans_fonts', 'serif_fonts', 'mono_fonts'];
+ foreach ($fontPackageConfigKeys as $fontPackageConfig) {
+ $$fontPackageConfig = [];
+ }
+
+ $fontRegistry = isset($config['fontRegistry']) ? $config['fontRegistry'] : new FontRegistry();
+ $autoloadFontConfig = $fontRegistry->getAutoloadConfigSetting();
+
+ foreach ($fontRegistry->getAll() as $fontPackage) {
+ $this->AddFontDirectory($fontPackage->getDirectory());
+ foreach ($fontPackage->getFonts() as $fontName => $fontData) {
+ if (isset($this->fontdata[$fontName])) {
+ if ($this->debug) {
+ throw new MpdfException(sprintf('Font "%s" already registered', $fontName));
+ }
+
+ continue;
+ }
+
+ if (!empty($fontData['sip-ext'])) {
+ if (!empty($this->backupSIPFont) && $this->debug) {
+ throw new MpdfException(sprintf('Mpdf::backupSIPFont already set to "%s" and font "%s" would override it.', $this->backupSIPFont, $fontName));
+ }
+
+ $this->backupSIPFont = $fontData['sip-ext'];
+ }
+
+ $this->fontdata[$fontName] = $fontData;
+ }
+
+ /* First package to claim a shaper letter wins, like fontdata above */
+ foreach ($fontPackage->getLineBreakDictionaries() as $shaper => $dictionary) {
+ if (!isset($this->lineBreakDictionaries[$shaper])) {
+ $this->lineBreakDictionaries[$shaper] = $dictionary;
+ }
+ }
+
+ if (!$autoloadFontConfig) {
+ continue;
+ }
+
+ /* If package includes it, add to the languageToFont registry */
+ $languageToFont = $fontPackage->getLanguageToFont();
+ if ($languageToFont) {
+ $this->languageToFont->add($languageToFont);
+ }
+
+ /* Save data to font package config */
+ $fonttrans[] = $fontPackage->getFontAliases();
+ $backupSubsFont[] = $fontPackage->getBackupSubsFonts();
+ $BMPonly[] = $fontPackage->getBmpFonts();
+ $fontFamilySubstitution = $fontPackage->getFontFamilySubstitution();
+ $sans_fonts[] = isset($fontFamilySubstitution['sans_fonts']) ? $fontFamilySubstitution['sans_fonts'] : [];
+ $serif_fonts[] = isset($fontFamilySubstitution['serif_fonts']) ? $fontFamilySubstitution['serif_fonts'] : [];
+ $mono_fonts[] = isset($fontFamilySubstitution['mono_fonts']) ? $fontFamilySubstitution['mono_fonts'] : [];
+ }
+
+ /*
+ * Sort the default font first so it heads available_unifonts, and an unresolvable
+ * font-family falls back to it rather than to whichever font registered first.
+ */
+ $defaultFont = isset($config['default_font']) ? $config['default_font'] : '';
+ if ($defaultFont !== '' && isset($this->fontdata[$defaultFont])) {
+ $this->fontdata = [$defaultFont => $this->fontdata[$defaultFont]] + $this->fontdata;
+ }
+
+ /* Combine and save font package config to associated Mpdf properties */
+ foreach ($fontPackageConfigKeys as $fontPackageConfig) {
+ $$fontPackageConfig = array_merge([], ...$$fontPackageConfig); // flatten array
+ $this->$fontPackageConfig = array_unique(array_merge($$fontPackageConfig, $this->$fontPackageConfig)); // push config to start of existing array
+ }
+ }
+
function _setPageSize($format, &$orientation)
{
if (is_string($format)) {
@@ -1682,14 +1776,12 @@ function _setPageSize($format, &$orientation)
function RestrictUnicodeFonts($res)
{
// $res = array of (Unicode) fonts to restrict to: e.g. norasi|norasiB - language specific
- if (count($res)) { // Leave full list of available fonts if passed blank array
- $this->available_unifonts = $res;
- } else {
- $this->available_unifonts = $this->default_available_fonts;
- }
- if (count($this->available_unifonts) == 0) {
+ $this->available_unifonts = count($res) ? $res : $this->default_available_fonts;
+
+ if (count($this->available_unifonts) === 0 && count($this->default_available_fonts) > 0) {
$this->available_unifonts[] = $this->default_available_fonts[0];
}
+
$this->available_unifonts = array_values($this->available_unifonts);
}
@@ -13498,7 +13590,7 @@ function WriteHTML($html, $mode = HTMLParserMode::DEFAULT_MODE, $init = true, $c
$e = mb_convert_case($e, MB_CASE_TITLE, "UTF-8");
} // mPDF 5.7.1
} else {
- if ($this->checkSIP && $this->CurrentFont['sipext'] && $this->subPos < $i && (!$this->specialcontent || !$this->useActiveForms)) {
+ if ($this->checkSIP && (isset($this->CurrentFont['sipext']) && $this->CurrentFont['sipext']) && $this->subPos < $i && (!$this->specialcontent || !$this->useActiveForms)) {
$cnt += $this->SubstituteCharsSIP($a, $i, $e);
}
diff --git a/src/Otl.php b/src/Otl.php
index a89fd92ab..a20da2c24 100644
--- a/src/Otl.php
+++ b/src/Otl.php
@@ -3019,9 +3019,14 @@ private function tibetanLineBreaking()
*/
private function seaLineBreaking()
{
- // Load Line-breaking dictionary
- if (!isset($this->lbdicts[$this->shaper]) && file_exists(__DIR__ . '/../data/linebrdict' . $this->shaper . '.dat')) {
- $this->lbdicts[$this->shaper] = file_get_contents(__DIR__ . '/../data/linebrdict' . $this->shaper . '.dat');
+ // Load the line-breaking dictionary the registered font packages provide for this shaper
+ if (!isset($this->lbdicts[$this->shaper])) {
+ if (empty($this->mpdf->lineBreakDictionaries[$this->shaper])
+ || !file_exists($this->mpdf->lineBreakDictionaries[$this->shaper])) {
+ return; // No dictionary available: fall back to mPDF's ordinary line breaking
+ }
+
+ $this->lbdicts[$this->shaper] = file_get_contents($this->mpdf->lineBreakDictionaries[$this->shaper]);
}
$dict = &$this->lbdicts[$this->shaper];
diff --git a/src/ServiceFactory.php b/src/ServiceFactory.php
index 2483c72d1..e3240f905 100644
--- a/src/ServiceFactory.php
+++ b/src/ServiceFactory.php
@@ -75,7 +75,9 @@ public function getServices(
$cache = new Cache($cacheBasePath, $config['cacheCleanupInterval']);
$fontCache = new FontCache(new Cache($cacheBasePath . '/ttfontdata', $config['cacheCleanupInterval']));
- $fontFileFinder = new FontFileFinder($config['fontDir']);
+ $fontFileFinder = $this->container && $this->container->has('fontFileFinder')
+ ? $this->container->get('fontFileFinder')
+ : new FontFileFinder($config['fontDir']);
if ($this->container && $this->container->has('httpClient')) {
$httpClient = $this->container->get('httpClient');
diff --git a/tests/Issues/Issue890Test.php b/tests/Issues/Issue890Test.php
index bab0ed869..f4126e938 100644
--- a/tests/Issues/Issue890Test.php
+++ b/tests/Issues/Issue890Test.php
@@ -33,7 +33,7 @@ public function testCharacterSubstitutionOnEmptyCache()
{
$this->mpdf->WriteHTML('✔');
- $this->assertEquals('dejavusanscondensed', $this->mpdf->flowingBlockAttr['font'][0]['family']);
+ $this->assertEquals('emoji', $this->mpdf->flowingBlockAttr['font'][0]['family']);
}
}
diff --git a/tests/Mpdf/AddFontTest.php b/tests/Mpdf/AddFontTest.php
index 56ef62978..2600cf117 100644
--- a/tests/Mpdf/AddFontTest.php
+++ b/tests/Mpdf/AddFontTest.php
@@ -17,11 +17,6 @@ protected function set_up()
$this->mpdf = new Mpdf();
}
- public function testAddFont()
- {
- $this->mpdf->AddFont('sun-exta');
- }
-
public function testAddUnsupportedFont()
{
$this->expectException(\Mpdf\MpdfException::class);
diff --git a/tests/Mpdf/Fonts/Fixtures/TestFontRegistrationA.php b/tests/Mpdf/Fonts/Fixtures/TestFontRegistrationA.php
new file mode 100644
index 000000000..da1bba667
--- /dev/null
+++ b/tests/Mpdf/Fonts/Fixtures/TestFontRegistrationA.php
@@ -0,0 +1,29 @@
+ [
+ 'R' => 'fontA.ttf',
+ ]
+ ];
+ }
+
+ public function getLineBreakDictionaries()
+ {
+ return [
+ 'T' => '/tmp/a/linebrdictT.dat',
+ ];
+ }
+}
diff --git a/tests/Mpdf/Fonts/Fixtures/TestFontRegistrationB.php b/tests/Mpdf/Fonts/Fixtures/TestFontRegistrationB.php
new file mode 100644
index 000000000..9934d2787
--- /dev/null
+++ b/tests/Mpdf/Fonts/Fixtures/TestFontRegistrationB.php
@@ -0,0 +1,30 @@
+ [
+ 'R' => 'fontB.ttf',
+ ]
+ ];
+ }
+
+ public function getLineBreakDictionaries()
+ {
+ return [
+ 'T' => '/tmp/b/linebrdictT.dat',
+ 'K' => '/tmp/b/linebrdictK.dat',
+ ];
+ }
+}
diff --git a/tests/Mpdf/Fonts/Fixtures/TestFontRegistrationWithId.php b/tests/Mpdf/Fonts/Fixtures/TestFontRegistrationWithId.php
new file mode 100644
index 000000000..536226f2c
--- /dev/null
+++ b/tests/Mpdf/Fonts/Fixtures/TestFontRegistrationWithId.php
@@ -0,0 +1,37 @@
+id = $id;
+ $this->font = $font;
+ }
+
+ public function getId()
+ {
+ return $this->id;
+ }
+
+ public function getDirectory()
+ {
+ return '/tmp/' . $this->id;
+ }
+
+ public function getFonts()
+ {
+ return [
+ $this->font => [
+ 'R' => $this->font . '.ttf',
+ ]
+ ];
+ }
+}
diff --git a/tests/Mpdf/Fonts/FontRegistryTest.php b/tests/Mpdf/Fonts/FontRegistryTest.php
new file mode 100644
index 000000000..55597f5bb
--- /dev/null
+++ b/tests/Mpdf/Fonts/FontRegistryTest.php
@@ -0,0 +1,147 @@
+add($class);
+ $this->assertArrayHasKey(TestFontRegistrationA::class, $registry->getAll());
+ }
+
+ public function testAddRepeated()
+ {
+ $registry = new FontRegistry([]);
+ $class = new TestFontRegistrationA();
+
+ $registry->add($class);
+ $this->assertCount(1, $registry->getAll());
+
+ $registry->add($class);
+ $this->assertCount(1, $registry->getAll());
+ }
+
+ public function testRemove()
+ {
+ $registry = new FontRegistry(new TestFontRegistrationA());
+ $this->assertCount(1, $registry->getAll());
+
+ $registry->remove(TestFontRegistrationA::class);
+ $this->assertEmpty($registry->getAll());
+ }
+
+ public function testRemoveException()
+ {
+ $this->expectException(MpdfException::class);
+
+ $registry = new FontRegistry([]);
+ $registry->remove('foobar');
+ }
+
+ public function testAutoloadValues()
+ {
+ $registry = new FontRegistry([]);
+ $this->assertTrue($registry->getAutoloadConfigSetting());
+
+ $registry->setAutoloadConfigSetting(false);
+ $this->assertFalse($registry->getAutoloadConfigSetting());
+ }
+
+ public function testAddWithConstructor()
+ {
+ $registry = new FontRegistry([
+ new TestFontRegistrationA(),
+ new TestFontRegistrationB(),
+ ]);
+
+ $this->assertArrayHasKey(TestFontRegistrationA::class, $registry->getAll());
+ $this->assertArrayHasKey(TestFontRegistrationB::class, $registry->getAll());
+ }
+
+ public function testAutoloadFonts()
+ {
+ $lockFile = tempnam(sys_get_temp_dir(), 'composer.lock');
+ $json = json_encode([
+ 'packages' => [
+ [
+ 'extra' => [
+ 'mpdf' => [
+ 'fonts' => TestFontRegistrationA::class,
+ 'fontOrder' => 20,
+ ]
+ ]
+ ],
+ [
+ 'extra' => [
+ 'mpdf' => [
+ 'fonts' => TestFontRegistrationB::class,
+ ]
+ ]
+ ]
+ ]
+ ]);
+
+ file_put_contents($lockFile, $json);
+
+ $registry = new FontRegistry(null, $lockFile);
+ $fonts = $registry->getAll();
+ $fontKeys = array_keys($fonts);
+
+ $this->assertCount(2, $fonts);
+ $this->assertSame(TestFontRegistrationA::class, $fontKeys[0]);
+ $this->assertSame(TestFontRegistrationB::class, $fontKeys[1]);
+
+ unlink($lockFile);
+ }
+
+ public function testAutoloadFontsWithoutLockFile()
+ {
+ $registry = new FontRegistry(null, sys_get_temp_dir() . '/no-such-composer.lock');
+
+ $this->assertEmpty($registry->getAll());
+ }
+
+ public function testIdDefaultsToTheClassName()
+ {
+ $this->assertSame(TestFontRegistrationA::class, (new TestFontRegistrationA())->getId());
+ }
+
+ public function testOneClassCanBackSeveralPackages()
+ {
+ $registry = new FontRegistry([
+ new TestFontRegistrationWithId('bundled', 'fontA'),
+ new TestFontRegistrationWithId('installed', 'fontB'),
+ ]);
+
+ $this->assertCount(2, $registry->getAll());
+ $this->assertSame(['installed', 'bundled'], array_keys($registry->getAll()));
+ }
+
+ public function testAddReplacesAPackageWithTheSameId()
+ {
+ $registry = new FontRegistry([
+ new TestFontRegistrationWithId('installed', 'fontA'),
+ new TestFontRegistrationWithId('installed', 'fontB'),
+ ]);
+
+ $this->assertCount(1, $registry->getAll());
+ $this->assertArrayHasKey('fontB', $registry->getAll()['installed']->getFonts());
+ }
+
+ public function testRemoveById()
+ {
+ $registry = new FontRegistry(new TestFontRegistrationWithId('bundled', 'fontA'));
+
+ $registry->remove('bundled');
+ $this->assertEmpty($registry->getAll());
+ }
+}
diff --git a/tests/Mpdf/Fonts/InitFontRegistryTest.php b/tests/Mpdf/Fonts/InitFontRegistryTest.php
new file mode 100644
index 000000000..418400957
--- /dev/null
+++ b/tests/Mpdf/Fonts/InitFontRegistryTest.php
@@ -0,0 +1,87 @@
+ 'c', /* the fixtures name no real files; only the merged config is under test */
+ 'fontDir' => [],
+ 'fontdata' => [],
+ 'fontRegistry' => new FontRegistry($packages),
+ 'languageToFont' => new LanguageToFontRegistry(),
+ ]);
+ }
+
+ public function testFontDirComesFromThePackages()
+ {
+ $mpdf = $this->makeMpdf([new TestFontRegistrationA(), new TestFontRegistrationB()]);
+
+ $fontDir = new \ReflectionProperty(Mpdf::class, 'fontDir');
+ $fontDir->setAccessible(true);
+
+ // add() prepends, so the last package added is read first
+ $this->assertSame(['/tmp/b', '/tmp/a'], $fontDir->getValue($mpdf));
+ }
+
+ public function testFontdataMergesEveryPackage()
+ {
+ $mpdf = $this->makeMpdf([new TestFontRegistrationA(), new TestFontRegistrationB()]);
+
+ $this->assertArrayHasKey('fontA', $mpdf->fontdata);
+ $this->assertArrayHasKey('fontB', $mpdf->fontdata);
+ }
+
+ public function testConfigFontdataBeatsThePackages()
+ {
+ $mpdf = $this->makeMpdf(
+ [new TestFontRegistrationA()],
+ ['fontdata' => ['fontA' => ['R' => 'override.ttf']]]
+ );
+
+ $this->assertSame('override.ttf', $mpdf->fontdata['fontA']['R']);
+ }
+
+ public function testLineBreakDictionariesMergeFromThePackages()
+ {
+ $mpdf = $this->makeMpdf([new TestFontRegistrationA(), new TestFontRegistrationB()]);
+
+ // B is read first, so it wins the shaper letter both packages declare
+ $this->assertSame(
+ ['T' => '/tmp/b/linebrdictT.dat', 'K' => '/tmp/b/linebrdictK.dat'],
+ $mpdf->lineBreakDictionaries
+ );
+ }
+
+ public function testLineBreakDictionariesAreEmptyWithoutAPackage()
+ {
+ $mpdf = $this->makeMpdf([]);
+
+ $this->assertSame([], $mpdf->lineBreakDictionaries);
+ }
+
+ public function testDefaultFontSortsFirstInFontdata()
+ {
+ // fontB is added last, so without the re-key it would head the map
+ $mpdf = $this->makeMpdf(
+ [new TestFontRegistrationA(), new TestFontRegistrationB()],
+ ['default_font' => 'fontA']
+ );
+
+ $this->assertSame('fontA', key($mpdf->fontdata));
+ $this->assertSame('fontA', $mpdf->available_unifonts[0]);
+ }
+}
diff --git a/tests/Mpdf/Language/Fixtures/TestLanguageToFontA.php b/tests/Mpdf/Language/Fixtures/TestLanguageToFontA.php
new file mode 100644
index 000000000..3506fdccc
--- /dev/null
+++ b/tests/Mpdf/Language/Fixtures/TestLanguageToFontA.php
@@ -0,0 +1,17 @@
+add($class);
+ $this->assertArrayHasKey(TestLanguageToFontA::class, $registry->getAll());
+ }
+
+ public function testConstructor()
+ {
+ $registry = new LanguageToFontRegistry([
+ new TestLanguageToFontA(),
+ new TestLanguageToFontB(),
+ ]);
+
+ $this->assertArrayHasKey(TestLanguageToFontA::class, $registry->getAll());
+ $this->assertArrayHasKey(TestLanguageToFontB::class, $registry->getAll());
+ }
+
+ public function testConstructorException()
+ {
+ $this->expectException(MpdfException::class);
+ new LanguageToFontRegistry(new \stdClass());
+ }
+
+ public function testRemove()
+ {
+ $registry = new LanguageToFontRegistry(new TestLanguageToFontA());
+ $this->assertCount(1, $registry->getAll());
+
+ $registry->remove(TestLanguageToFontA::class);
+ $this->assertEmpty($registry->getAll());
+ }
+
+ public function testRemoveException()
+ {
+ $this->expectException(MpdfException::class);
+
+ $registry = new LanguageToFontRegistry();
+ $registry->remove('foobar');
+ }
+
+ public function testGetLanguageOptions()
+ {
+ // Test A only
+ $registry = new LanguageToFontRegistry(new TestLanguageToFontA());
+ $this->assertEquals([false, 'font_a'], $registry->getLanguageOptions('core_a', false));
+ $this->assertEquals([false, ''], $registry->getLanguageOptions('core_b', false));
+
+ // Test B only
+ $registry = new LanguageToFontRegistry(new TestLanguageToFontB());
+ $this->assertEquals([false, 'font_b'], $registry->getLanguageOptions('core_b', false));
+ $this->assertEquals([false, 'font_b_override'], $registry->getLanguageOptions('core_a', false)); // B overrides core_a too
+
+ // Test both together
+ $registry = new LanguageToFontRegistry();
+ $registry->add(new TestLanguageToFontA());
+ $registry->add(new TestLanguageToFontB());
+
+ $this->assertEquals([false, 'font_b'], $registry->getLanguageOptions('core_b', false));
+ $this->assertEquals([false, 'font_b_override'], $registry->getLanguageOptions('core_a', false));
+
+ // Test both together, but reverse the order
+ $registry = new LanguageToFontRegistry();
+ $registry->add(new TestLanguageToFontB());
+ $registry->add(new TestLanguageToFontA());
+
+ $this->assertEquals([false, 'font_a'], $registry->getLanguageOptions('core_a', false));
+ $this->assertEquals([false, 'font_b'], $registry->getLanguageOptions('core_b', false));
+ }
+}
diff --git a/tests/Mpdf/Language/LanguageToFontTestImplimentation.php b/tests/Mpdf/Language/LanguageToFontTestImplimentation.php
index e3cf43329..defb72cc5 100644
--- a/tests/Mpdf/Language/LanguageToFontTestImplimentation.php
+++ b/tests/Mpdf/Language/LanguageToFontTestImplimentation.php
@@ -10,6 +10,10 @@ public function getLanguageOptions($llcc, $adobeCJK)
return [false, 'fake-font'];
}
+ if ($llcc === 'zh' && !$adobeCJK) {
+ return [false, 'sun-exta'];
+ }
+
return parent::getLanguageOptions($llcc, $adobeCJK);
}
@@ -19,6 +23,14 @@ protected function fontByScript($script, $adobeCJK)
return 'fake-font-script';
}
+ if ($script === 'latn') {
+ return 'dejavusanscondensed';
+ }
+
+ if ($script === 'kali') {
+ return 'freemono';
+ }
+
return parent::fontByScript($script, $adobeCJK);
}
}
diff --git a/ttfonts/AboriginalSansREGULAR.ttf b/ttfonts/AboriginalSansREGULAR.ttf
deleted file mode 100644
index 3f88df0bd..000000000
Binary files a/ttfonts/AboriginalSansREGULAR.ttf and /dev/null differ
diff --git a/ttfonts/DBSILBR.ttf b/ttfonts/DBSILBR.ttf
deleted file mode 100644
index 658fc362f..000000000
Binary files a/ttfonts/DBSILBR.ttf and /dev/null differ
diff --git a/ttfonts/GNUFreeFontinfo.txt b/ttfonts/GNUFreeFontinfo.txt
deleted file mode 100644
index c9511a6a3..000000000
--- a/ttfonts/GNUFreeFontinfo.txt
+++ /dev/null
@@ -1,108 +0,0 @@
--*-text-*-
- GNU FreeFont
-
-The GNU FreeFont project aims to provide a useful set of free scalable
-(i.e., OpenType) fonts covering as much as possible of the ISO 10646/Unicode
-UCS (Universal Character Set).
-
-Statement of Purpose
---------------------
-
-The practical reason for putting glyphs together in a single font face is
-to conveniently mix symbols and characters from different writing systems,
-without having to switch fonts.
-
-Coverage
---------
-
-FreeFont covers the following character sets
-
-* ISO 8859 parts 1-15
-* CEN MES-3 European Unicode Subset
- http://www.evertype.com/standards/iso10646/pdf/cwa13873.pdf
-* IBM/Microsoft code pages 437, 850, 852, 1250, 1252 and more
-* Microsoft/Adobe Windows Glyph List 4 (WGL4)
- http://www.microsoft.com/typography/otspec/WGL4.htm
-* KOI8-R and KOI8-RU
-* DEC VT100 graphics symbols
-* International Phonetic Alphabet
-* Arabic, Hebrew, Armenian, Georgian, Ethiopian and Thai alphabets,
- including Arabic presentation forms A/B
-* mathematical symbols, including the whole TeX repertoire of symbols
-* APL symbols
- etc.
-
-Editing
--------
-
-The free outline font editor, George Williams's FontForge
- is used for editing the fonts.
-
-Design Issues
--------------
-
-Which font shapes should be made? Historical style terms like Renaissance
-or Baroque letterforms cannot be applied beyond Latin/Cyrillic/Greek
-scripts to any greater extent than Kufi or Nashki can be applied beyond
-Arabic script; "italic" is really only meaningful for Latin letters.
-
-However, most modern writing systems have typographic formulations for
-contrasting uniform and modulated character stroke widths, and have some
-history with "oblique", faces. Since the advent of the typewriter, most
-have developed a typographic style with uniform-width characters.
-
-Accordingly, the FreeFont family has one monospaced - FreeMono - and two
-proportional faces (one with uniform stroke - FreeSans - and one with
-modulated stroke - FreeSerif).
-
-To make text from different writing systems look good side-by-side, each
-FreeFont face is meant to contain characters of similar style and weight.
-
-Licensing
----------
-
-Free UCS scalable fonts is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License as published
-by the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-The fonts are distributed in the hope that they will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
-or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-for more details.
-
-You should have received a copy of the GNU General Public License along
-with this program; if not, write to the Free Software Foundation, Inc.,
-51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-
-As a special exception, if you create a document which uses this font, and
-embed this font or unaltered portions of this font into the document, this
-font does not by itself cause the resulting document to be covered by the
-GNU General Public License. This exception does not however invalidate any
-other reasons why the document might be covered by the GNU General Public
-License. If you modify this font, you may extend this exception to your
-version of the font, but you are not obligated to do so. If you do not
-wish to do so, delete this exception statement from your version.
-
-
-Files and their suffixes
-------------------------
-
-The files with .sfd (Spline Font Database) are in FontForge's native format.
-Please use these if you plan to modify the font files.
-
-TrueType fonts for immediate consumption are the files with the .ttf
-(TrueType Font) suffix. These are ready to use in Xwindows based
-systems using FreeType, on Mac OS, and on older Windows systems.
-
-OpenType fonts (with suffix .otf) are for use in Windows Vista.
-Note that although they can be installed on Linux, but many applications
-in Linux still don't support them.
-
-
---------------------------------------------------------------------------
-Primoz Peterlin,
-Steve White
-
-Free UCS scalable fonts: http://savannah.gnu.org/projects/freefont/
-$Id: README,v 1.6 2008/12/25 12:51:41 Stevan_White Exp $
diff --git a/ttfonts/Jomolhari-OFL.txt b/ttfonts/Jomolhari-OFL.txt
deleted file mode 100644
index b723c35f6..000000000
--- a/ttfonts/Jomolhari-OFL.txt
+++ /dev/null
@@ -1,98 +0,0 @@
-This Font Software is Copyright (c) 2006, Christopher J Fynn
-All Rights Reserved.
-
-"Jomolhari" is a Reserved Font Name for this Font Software.
-
-This Font Software is licensed under the SIL Open Font License, Version 1.0.
-No modification of the license is permitted, only verbatim copy is allowed.
-This license is copied below, and is also available with a FAQ at:
-http://scripts.sil.org/OFL
-
-
------------------------------------------------------------
-SIL OPEN FONT LICENSE Version 1.0 - 22 November 2005
------------------------------------------------------------
-
-PREAMBLE
-The goals of the Open Font License (OFL) are to stimulate worldwide
-development of cooperative font projects, to support the font creation
-efforts of academic and linguistic communities, and to provide an open
-framework in which fonts may be shared and improved in partnership with
-others.
-
-The OFL allows the licensed fonts to be used, studied, modified and
-redistributed freely as long as they are not sold by themselves. The
-fonts, including any derivative works, can be bundled, embedded,
-redistributed and sold with any software provided that the font
-names of derivative works are changed. The fonts and derivatives,
-however, cannot be released under any other type of license.
-
-DEFINITIONS
-"Font Software" refers to any and all of the following:
- - font files
- - data files
- - source code
- - build scripts
- - documentation
-
-"Reserved Font Name" refers to the Font Software name as seen by
-users and any other names as specified after the copyright statement.
-
-"Standard Version" refers to the collection of Font Software
-components as distributed by the Copyright Holder.
-
-"Modified Version" refers to any derivative font software made by
-adding to, deleting, or substituting -- in part or in whole --
-any of the components of the Standard Version, by changing formats
-or by porting the Font Software to a new environment.
-
-"Author" refers to any designer, engineer, programmer, technical
-writer or other person who contributed to the Font Software.
-
-PERMISSION & CONDITIONS
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of the Font Software, to use, study, copy, merge, embed, modify,
-redistribute, and sell modified and unmodified copies of the Font
-Software, subject to the following conditions:
-
-1) Neither the Font Software nor any of its individual components,
-in Standard or Modified Versions, may be sold by itself.
-
-2) Standard or Modified Versions of the Font Software may be bundled,
-redistributed and sold with any software, provided that each copy
-contains the above copyright notice and this license. These can be
-included either as stand-alone text files, human-readable headers or
-in the appropriate machine-readable metadata fields within text or
-binary files as long as those fields can be easily viewed by the user.
-
-3) No Modified Version of the Font Software may use the Reserved Font
-Name(s), in part or in whole, unless explicit written permission is
-granted by the Copyright Holder. This restriction applies to all
-references stored in the Font Software, such as the font menu name and
-other font description fields, which are used to differentiate the
-font from others.
-
-4) The name(s) of the Copyright Holder or the Author(s) of the Font
-Software shall not be used to promote, endorse or advertise any
-Modified Version, except to acknowledge the contribution(s) of the
-Copyright Holder and the Author(s) or with their explicit written
-permission.
-
-5) The Font Software, modified or unmodified, in part or in whole,
-must be distributed using this license, and may not be distributed
-under any other license.
-
-TERMINATION
-This license becomes null and void if any of the above conditions are
-not met.
-
-DISCLAIMER
-THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
-OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
-COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
-DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
-OTHER DEALINGS IN THE FONT SOFTWARE.
diff --git a/ttfonts/SyrCOMEdessa_license.txt b/ttfonts/SyrCOMEdessa_license.txt
deleted file mode 100644
index 35c74dddc..000000000
--- a/ttfonts/SyrCOMEdessa_license.txt
+++ /dev/null
@@ -1,61 +0,0 @@
-This license is derived from the Bigelow & Holmes Font License
-found at http://www.xfree86.org/current/LICENSE2.html
-
-The following reasonable modifications have been made to the
-Bigelow & Holmes Font License:
-
-* All references to Luxi have been replaced with Meltho
-
-* All references to Bigelow & Holmes Inc. and URW++ GmbH haven
- been replaced with Beth Mardutho: The Syriac Institute
-
-* The registered trademark notice belonging to Bigelow & Holmes
- Inc. has been removed
-
-* Contact information has been modified to show that the
- contact person for these fonts is the Director of the
- Institute, George Kiraz.
-
--------------------------------------------------------------
-
-Meltho fonts and font code copyright © 2002 by Beth Mardutho:
-The Syriac Institute. All Right Reserved.
-
-Permission is hereby granted, free of charge, to any person
-obtaining a copy of these Fonts and associated documentation
-files (the "Font Software"), to deal in the Font Software,
-including without limitation the rights to use, copy, merge,
-publish, distribute, sublicense, and/or sell copies of the
-Font Software, and to permit persons to whom the Font Software
-is furnished to do so, subject to the following conditions:
-
-The above copyright and trademark notices and this permission
-notice shall be included in all copies of one or more of the
-Font Software.
-
-The Font Software may not be modified, altered, or added to,
-and in particular the designs of glyphs or characters in the
-Fonts may not be modified nor may additional glyphs or
-characters be added to the Fonts. This License becomes null
-and void when the Fonts or Font Software have been modified.
-
-THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
-KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY
-WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
-AND NONINFRINGEMENT OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER
-RIGHT. IN NO EVENT SHALL BETH MARDUTHO: THE SYRIAC INSTITUTE BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY
-GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES,
-WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR
-FROM OTHER DEALINGS IN THE FONT SOFTWARE.
-
-Except as contained in this notice, the name of Beth Mardutho:
-The Syriac Institute shall not be used in advertising or otherwise
-to promote the sale, use or other dealings in this Font Software
-without prior written authorization from Beth Mardutho: The
-Syriac Institute.
-
-For further information, contact:
-George Kiraz, Director of Beth Mardutho
-gkiraz@bethmardutho.org
diff --git a/ttfonts/TaiHeritagePro.ttf b/ttfonts/TaiHeritagePro.ttf
deleted file mode 100644
index d4ed9538b..000000000
Binary files a/ttfonts/TaiHeritagePro.ttf and /dev/null differ
diff --git a/ttfonts/Uthman.otf b/ttfonts/Uthman.otf
deleted file mode 100644
index bb650a24e..000000000
Binary files a/ttfonts/Uthman.otf and /dev/null differ
diff --git a/ttfonts/ocrb10.ttf b/ttfonts/ocrb10.ttf
deleted file mode 100644
index 34980b80c..000000000
Binary files a/ttfonts/ocrb10.ttf and /dev/null differ
diff --git a/ttfonts/ocrbinfo.txt b/ttfonts/ocrbinfo.txt
deleted file mode 100644
index c2dd9954c..000000000
--- a/ttfonts/ocrbinfo.txt
+++ /dev/null
@@ -1,60 +0,0 @@
-Mostly-free OCR B
-
-This font is used in UPC bar code symbols, including the ISBN symbols on
-most published books.
-
-A freely distributable version seems to be sorely needed. Until now, it's
-been very difficult to find the font in computer-usable format except by
-paying a high fee to a commercial font vendor. Even many serious commercial
-publishers have so much trouble getting it right that they just go ahead and
-use Helvetica instead, or even (shudder) Arial. Since the OCR B font is
-required by an international standard, it seems like it ought to be free.
-So here it is. The font in this package is not a "ripped", pirated, or
-shadily reverse engineered version; every effort has been made to ensure
-that it genuinely derives from free sources and all the creators involved
-have actually intended it for free public use.
-
-Converted by Matthew Skala from Metafont format to Postscript and TrueType
-formats, July 28, 2006, using mftrace 1.2.4 by Paul Vojta, which is
-available from
- http://www.xs4all.nl/~hanwen/mftrace/
-and Autotrace 0.31.1 available from
- http://autotrace.sourceforge.net/
-
-The Metafont files (not included - see notes below) were coded by Norbert
-Schwarz in the 1980s, based on German standards documents. He has attached
-a notice, notably not actually claiming any copyright - see the file
-"ocrbinfo" - saying that the fonts are "given to free non commercial use",
-but commenting that he is only free to grant rights to his own work on the
-digitization, because he did not design the original letter forms. He
-suggests that there may be other copyright claims attached to the letter
-forms themselves, which Schwarz credits as being originally designed by
-"Adam Frutiger" [sic], almost certainly a mistake for Adrian Frutiger. My
-(Matthew Skala's) understanding of copyright law, at least in the USA and
-Canada, is that in fact typefaces per se cannot be subject to copyright
-claims, so the software embodiment is the only thing subject to copyright
-and Schwarz's release makes it available for whatever "non commercial use"
-means.
-
-To avoid muddying the waters further, any copyright claims by Matthew Skala
-on these files are hereby released to the public domain. I'd like for these
-fonts to be freely usable even in marginally commercial applications, such
-as to generate UPC labels for books that will be sold for profit, but it may
-not be within my power to grant that myself because I didn't write the
-Metafont files although I did do considerable, and probably copyrightable,
-work on the translation to Postscript and TrueType. It was *not* a purely
-automated process; try using the tools I used and see how far you get
-without human editing! I'd also like for these fonts (the fonts themselves
-as opposed to documents made with them) not to be sold, not even indirectly
-by those Web sites that advertise "free downloads" but make it difficult to
-actually download fonts without paying a fee.
-
-NOTE: This ZIP archive is a stripped-down version containing just the
-essential files for using the main OCR B font on most systems. If you want
-the much larger complete package, which contains Metafont sources and several
-variant fonts (reverse-video, outline, and slanted), look for a ZIP archive
-called ocrb-complete.zip wherever you found this one.
-
-Matthew Skala
-mskala@ansuz.sooke.bc.ca
-http://ansuz.sooke.bc.ca/