Skip to content

The 6.19 font cleanup removes Sun-ExtB from sites that use Sun-ExtA #2025

Closed as not planned

Description

@gravitypdf-bot

Problem

The 6.19 core font cleanup deletes Sun-ExtB.ttf from a site that uses Sun-ExtA, and nothing downloads it again. On a 6.18 site with the old installer's fonts, Sun-ExtA supplies CJK text and Sun-ExtB supplies the CJK Extension B characters (for example 𠀀), so those characters are likely to stop rendering after the upgrade.

Steps to reproduce

  1. Put the mpdf-core-fonts v1.0.0 Sun-ExtA.ttf and Sun-ExtB.ttf in wp-content/uploads/PDF_EXTENDED_TEMPLATES/fonts/
  2. Set the default font to Sun-ExtA
  3. Set the gfpdf_current_version option to 6.18.0 and load any admin page
  4. Run wp cron event run gfpdf_core_font_cleanup_run, then wp cron event run gfpdf_core_font_sync

Sun-ExtA.ttf is back at the current build, and Sun-ExtB.ttf is gone. Reproduced on the #2011 branch. The missing characters were read from the code rather than rendered.

Cause

Model_Required_Fonts::get_font_files() reads only a family's R, B, I and BI files, so sun-exta's sip-ext link to sun-extb isn't counted. Sun-ExtB is never in the required list, so prune() deletes the unmodified v1.0.0 copy and sync() doesn't fetch it. Model_Font_Sources then removes the sip-ext link and doesn't use Sun-ExtB as backupSIPFont, as the file isn't on disk.

This comes from #1998's "keep only what's needed" rule. #2011 doesn't change it: Sun-ExtB is deleted because it isn't needed, not because it's outdated.

Relationship to #2014

With #2014 merged, a CJK Extension B character queues Sun-ExtB for the background sync, so the site recovers. That PR's first render of such a character still comes out degraded, and until it merges the file doesn't come back at all.

Proposal

Count a family's sip-ext font as part of the family in get_font_files(), so a site that needs Sun-ExtA keeps Sun-ExtB. With #2011 that file is then replaced with the repaired build like Sun-ExtA.

The cost is another 17.5 MB download for sites that need Sun-ExtA, including ones that never use Extension B characters. The alternative is to keep only an existing v1.0.0 Sun-ExtB through the cleanup when Sun-ExtA is needed, and leave new installs to #2014's on-demand path.

Activity

  1. gravitypdf-bot commented on Nov 12, 2026

    @gravitypdf-bot
    ContributorAuthor

    Sun-ExtB being removed by the 6.19 cleanup is intended: nearly all sites don't need it. A PDF that needs it (a CJK Extension B character, through Sun-ExtA's sip-ext link or backupSIPFont) queues it for the background sync through #2014's on-demand font finder. That render falls back and is marked degraded, and later renders use Sun-ExtB once the sync has fetched it. Nothing in Gravity PDF removes the sip-ext link when the file is missing. See #2040 for the alternative that was dropped.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions