Repository navigation
Keep Sun-ExtB on sites that need Sun-ExtA - #2040
Closed
gravitypdf-bot wants to merge 1 commit into
Closed
gravitypdf-bot wants to merge 1 commit into
gravitypdf-bot wants to merge 1 commit into
Conversation
mPDF loads a family's sip-ext font with it for the CJK Extension B characters, but get_font_files() only read the R/B/I/BI files, so the 6.19 cleanup pruned Sun-ExtB from sites using Sun-ExtA and the sync never fetched it back. get_font_files() now counts the sip-ext font's files as the family's (one level, as mPDF does), so prune keeps it, sync downloads or replaces it, and the health counts include it. is_font_in_use() also treats a sip-ext font as in use while a font linking it is, so the Font Manager can't delete a file the next sync would download again. Fixes #2025 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
|
Coverage report for commit: 9be1ced Summary - Lines: 93.99% | Methods: 90.78% | Branches: 85.75%
🤖 Jest coverage report |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Contributor
|
Coverage report for commit: 9be1ced Summary - Lines: 90.48% | Methods: 96.03%
🤖 PHPUnit coverage report |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Contributor
Author
|
Closing without merging. Nearly all sites don't need Sun-ExtB, so the 6.19 cleanup should keep deleting it. A PDF that needs it (a CJK Extension B character, through Sun-ExtA's sip-ext link or backupSIPFont) already queues it for the background sync through #2014's on-demand font finder, which |
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
The 6.19 core font cleanup deleted
Sun-ExtB.ttffrom sites that use Sun-ExtA, and nothing downloaded it again, because the required-fonts list only read a family's regular, bold, italic and bold-italic files. Sun-ExtA'ssip-extlink to Sun-ExtB, which mPDF uses for CJK Extension B characters, was never counted. Fixes #2025.Model_Required_Fonts::get_font_files()counts a family'ssip-extfont as part of the family (one level, as mPDF does)is_font_in_use()treats asip-extfont as in use while a font linking to it is, so the Font Manager refuses to delete itTry it
Sun-ExtA.ttfandSun-ExtB.ttfinwp-content/uploads/PDF_EXTENDED_TEMPLATES/fonts/gfpdf_current_versionto6.18.0and load any admin pageBoth
Sun-ExtA.ttfandSun-ExtB.ttfare now at the current build.Test plan
𠀀More info
Sites that need Sun-ExtA now also download Sun-ExtB (about 17.5 MB), even if they never use Extension B characters. This is the issue's main proposal. The alternative it lists, keeping only an existing v1.0.0 copy and leaving new installs to #2014's on-demand path, wasn't taken.
Callers checked:
get_required_font_files()/get_install_font_files()(viaget_key_files()),prune(),sync(),needs_download()/pdf_needs_download(),get_installed_counts()andget_missing_files()(core totals go up by one on Sun-ExtA sites),add_other_site_reasons(), and #2014's on-demand queue, which works per file and doesn't callget_font_files(), so nothing loops or double-counts.Known gap: the Font Manager's usage reasons (
get_font_reasons()) don't follow the link, so Sun-ExtB shows no "in use" reason and a delete button that returns the 409 "in use" error. Showing it as locked would need a new "Needed by Sun-ExtA" string; left for a follow-up.New tests:
get_font_files()followssip-extone level (with a two-font cycle, an unknown target and a non-string value), a Sun-ExtA default font requires Sun-ExtB,is_font_in_use()via settings, a PDF and another site's record, and prune scheduling the sync to replace an installer-era Sun-ExtB.