Repository navigation
Replace a 6.18 site's outdated Garuda and Sun-Ext fonts on the upgrade to 6.19 - #2011
Merged
Merged
Conversation
Contributor
|
Coverage report for commit: 3aa0b16 Summary - Lines: 93.99% | Methods: 90.96% | Branches: 85.58%
🤖 Jest coverage report |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Contributor
|
Coverage report for commit: 3aa0b16 Summary - Lines: 90.19% | Methods: 95.91%
🤖 PHPUnit coverage report |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
4 of 6 tasks
gravitypdf-bot
force-pushed
the
fix/replace-installer-garuda
branch
from
November 6, 2026 00:34
854eed7 to
95666e7
Compare
gravitypdf-bot
changed the base branch from
feature/core-font-upgrade-prune
to
feature/font-file-conflict-rename
November 6, 2026 00:35
jakejackson1
force-pushed
the
feature/font-file-conflict-rename
branch
from
November 6, 2026 03:07
f7acf3e to
74c3b06
Compare
gravitypdf-bot
force-pushed
the
feature/font-file-conflict-rename
branch
3 times, most recently
from
November 9, 2026 06:09
62cbe50 to
38e02af
Compare
Base automatically changed from
feature/font-file-conflict-rename
to
development
November 9, 2026 06:12
gravitypdf-bot
force-pushed
the
fix/replace-installer-garuda
branch
from
November 10, 2026 01:10
95666e7 to
a8d1824
Compare
gravitypdf-bot
force-pushed
the
fix/replace-installer-garuda
branch
from
November 10, 2026 01:16
a8d1824 to
432d688
Compare
…e to 6.19 mpdf-core-fonts v1.0.0, which the Core Font installer downloaded, holds mPDF's pre-8.1.0 Garuda.ttf, whose "k" carries broken TrueType hinting (mpdf/mpdf#1440), and Sun-ExtA and Sun-ExtB files browsers reject as web fonts (GravityPDF/mpdf#881). prune() keeps a font the site needs, and the downloader skips a file that's present, so those copies would stay for good. The manifest moves to v1.1.2, which repairs Sun-ExtA and Sun-ExtB, and the Sun-ExtA preview opt-out goes with the fault it worked around. prune() now treats Model_Font_Downloader::OUTDATED (the four Garuda files and the two Sun-Ext files) as never kept: an unmodified v1.0.0 copy is deleted whether or not the site needs it, under the same size, hash and downloads-off checks as any other file. When a needed one goes, it queues a sync so the current file comes back in the background (the render-time finder fetches it too). The version change already queues a sync, but #2004 moves this cleanup into cron batches that can run after it. A modified copy, a current one, and one whose download is turned off stay. The other 43 dehinted fonts differ only in hinting and are left alone when kept, though the fork's character ranges files record v1.1.1 sizes, so mPDF ignores the ranges file (and logs a warning) for a kept v1.0.0 regular face. Bumps the mPDF fork to 725098a for GravityPDF/mpdf#883, whose ranges files record the repaired sizes and whose TTFontFile reads Sun-ExtA with OTL on. The fork no longer uses myclabs/deep-copy, so the plugin requires it directly to keep GFPDF_Vendor\DeepCopy available to add-ons and custom templates, and a scoper patcher deprecates its constructor ahead of its removal in 7.0. Adds the v1.0.0 (blob b9fcdfd) and v1.1.1 (blob fc4379b) Garuda.ttf as test fixtures, and moves the reset of the installer manifest stand-in into CopiesFontFixtures::use_shipped_installer_manifest(). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
gravitypdf-bot
force-pushed
the
fix/replace-installer-garuda
branch
from
November 10, 2026 01:23
432d688 to
3aa0b16
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Sites upgrading from 6.18 hold the Core Font installer's mpdf-core-fonts v1.0.0 files: a Garuda whose "k" has broken TrueType hinting (mpdf/mpdf#1440), and Sun-ExtA and Sun-ExtB files that browsers reject as web fonts (GravityPDF/mpdf#881). #1998's cleanup keeps a font the site needs, and the downloader skips a file that's already present, so those copies would never be replaced. This moves the core fonts to v1.1.2, and the 6.19 cleanup now also removes an unmodified v1.0.0 copy of those fonts that the site needs and queues a background sync to download the current file.
preview => falseopt-out and its "Browsers can't display this font file" message are removed, as the repaired file loads725098afor Repair the Sun-Ext fonts so browsers can load them as web fonts (v6) mpdf#883, which records the repaired fonts' sizes in its ranges files, and brings the fork's other fixes since0c6322cmyclabs/deep-copyis now required directly, as that mPDF no longer uses it, soGFPDF_Vendor\DeepCopystays available. A scoper patcher adds a deprecation notice to its constructor, and it will be removed in 7.0Model_Font_Downloader::OUTDATEDlists the four Garuda files and the two Sun-Ext files;prune()never keeps them, so their v1.0.0 copies go under the same size, hash and downloads-off checks as any other fileprune()callsschedule_sync(); the render-time finder also fetches it on demandGaruda.ttftest fixtures (57 KB and 39 KB)Try it
Garuda.ttfintowp-content/uploads/PDF_EXTENDED_TEMPLATES/fonts/)Garuda.ttfis removed and agfpdf_core_font_synccron event is queuedwp cron event run gfpdf_core_font_sync):Garuda.ttfcomes back at 39,092 bytes (the v1.1.1 file, unchanged in v1.1.2)Test plan
Test_Model_Font_Downloader: a needed v1.0.0 Garuda or Sun-Ext file is deleted and a sync queued, and a kept v1.0.0 DejaVu Serif Condensed stays; an unneeded one is deleted without a sync; a modified (same size) or current Garuda stays; a Garuda whose download is turned off staysTest_Model_Font_Downloader: the replacement lands under the plain name, not a hashed one, once the v1.0.0 file is prunedTest_Controller_Upgrade_Routines: the 6.18 → 6.19 upgrade, run through the queued cleanup, removes a v1.0.0 Garuda that is the default fontTest_Vendor_Prefixing: constructingGFPDF_Vendor\DeepCopy\DeepCopyraises the deprecation noticemyclabs/deep-copywas restored (the prefixing, rendering andHelper_PDFclasses were re-run after): single site 2,654 tests, multisite 2,616. The only failures are environment-only:test_an_unwritable_folder_fails_without_a_requestx2 andtest_an_unreadable_file_has_no_hash(the container runs as root), andtest_the_kill_switch_constant_turns_downloads_off(the parallel-harness shim warning).useOTLoff and onMore info
developmentnow that List custom, core and bundled fonts together in the Font Manager #2015, Keep font state in one place for every site, and keep every site's fonts in the 6.19 cleanup #2004 and Save a core font under a hashed name when another font's file holds its name #2016 have merged.prune( $keep, $since )is unchanged apart fromOUTDATED: a file written after$sinceis still kept, and the v1.0.0 file is only ever the one at the plain name. A v1.0.0 copy is a known build to Save a core font under a hashed name when another font's file holds its name #2016's conflict rule, so before it is pruneddownload()treats it as the font's own, even when verifying. Once it is removed the current file is saved under the plain name, and no hashed copy is made (a test covers both steps with Garuda). A modified copy of the same size is still not touched byprune(); a verifying sync then saves the current file beside it under its hashed name, as Save a core font under a hashed name when another font's file holds its name #2016 does for any other font.Garuda.ttfhas the glyph fix; the other three were dehinted along with it. The four are replaced together so the family stays consistent. v1.1.2 differs from v1.1.1 only in the two Sun-Ext files, whose v1.0.0 and v1.1.1 copies are byte-identical.is_on_disk()leaves Sun-ExtA and Sun-ExtB out of the substitution fonts unless a PDF using the font fetches it first.0c6322c→725098ais 21 commits. 881 Add Code Sniff Support #883 is the one this PR needs: its ranges files record the repaired Sun-Ext sizes, soshippedRanges()keeps using them, and itsTTFontFilefix stops aTypeErrorreading Sun-ExtA withuseOTLon. The others are the fork's table of contents and index fixes, look-ahead side effects, custom asset fetchers and the annotation file allow list, invalid UTF-8 handling, and a U+FEFF drawing fix. One of them removesmyclabs/deep-copyfrom mPDF. Nothing in the plugin or mPDF uses it now, but add-ons or custom templates could use the scoped class, socomposer.jsonrequires it directly (^1.7, mPDF's old constraint) and it stays scoped until 7.0._deprecated_class()fires only when something constructs it, anddeep_copy()goes through that constructor too.data/character-ranges/*.ranges.phprecord the v1.1.1 size of each regular face.FontSubstitution::shippedRanges()ignores a ranges file whose size doesn't match the font on disk and logs a warning (Character ranges file … is ignored). It then falls back to the ranges cached from reading the font, so output is still correct, just slower and with log noise. Fourteen kept v1.0.0 regular faces besides Garuda hit this: AboriginalSansREGULAR, DejaVuSans, DejaVuSansCondensed (the 6.18 default, so most upgraded sites), DejaVuSansMono, DejaVuSerif, DejaVuSerifCondensed, FreeMono, FreeSans, FreeSerif, KhmerOS, Lohit-Kannada, Pothana2000, UnBatang_0613 and XB Riyaz. If that matters, the sameOUTDATEDlist could take those regular faces too.b9fcdfd9(57,324 bytes) and v1.1.1fc4379b5(39,092 bytes), both matching their manifests.