Skip to content

Custom font upload not working #72265

Open

Description

@Robertght

Description

When trying to install this font it wouldn't complete and instead we are seeing a browser console error.

Step-by-step reproduction instructions

  1. Go to Appearance > Editor
  2. Styles > Fonts
  3. Try uploading this font:

AaDaoShuRi-LangManHeiTi-2.ttf.zip

Screenshots, screen recording, code snippet

The console renders:

Uncaught (in promise) SyntaxError: Invalid font data in ArrayBuffer

Th workaround is to convert it to a .woff2. I've used https://transfonter.org/

Environment info

WordPress 6.9 and the current stable version

Please confirm that you have searched existing issues in the repo.

  • Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

  • Yes

Please confirm which theme type you used for testing.

  • Block
  • Classic
  • Hybrid (e.g. classic with theme.json)
  • Not sure

Activity

  1. added
    [Type] BugAn existing feature does not function as intended
    on Oct 11, 2025
  2. changed the title [-]Custom font upload not working:[/-] [+]Custom font upload not working[/+] on Oct 11, 2025
  3. sidharthpandita1 commented on Oct 11, 2025

    @sidharthpandita1
    Contributor
  4. Robertght commented on Oct 12, 2025

    @Robertght
    Author

    👋 @sidharthpandita1 I'm still able to replicate this with WordPress 6.9 and Gutenberg 21.8.0 using Studio. I wonder if there's an environment situation here. Could you share what environment you are using?

  5. t-hamano commented on Oct 13, 2025

    @t-hamano
    Contributor

    @Robertght If you're using Studio, your WordPress environment runs directly on the host OS, so the OS may be relevant to your issue. It would be helpful for the testers if you could tell us whether you're using Windows or Mac.

  6. Robertght commented on Oct 13, 2025

    @Robertght
    Author

    I'm using macOS Tahoe here

  7. t-hamano commented on Oct 14, 2025

    @t-hamano
    Contributor

    Th workaround is to convert it to a .woff2

    The zip file attached to this issue contains a woff2 file. Is it this woff2 file that is causing the problem? Or is the problem with the font before converting it to woff2?

  8. Robertght commented on Oct 14, 2025

    @Robertght
    Author

    @t-hamano Sorry about that! I uploaded the ttf now. The .woff2 is the one that works.

  9. sidharthpandita1 commented on Oct 20, 2025

    @sidharthpandita1
    Contributor
    Image

    yes, facing same issue

  10. github-actions commented on Nov 20, 2025

    @github-actions

    Hi,
    This issue has gone 30 days without any activity. This means it is time for a check-in to make sure it is still relevant. If you are still experiencing this issue with the latest versions, you can help the project by responding to confirm the problem and by providing any updated reproduction steps.
    Thanks for helping out.

  11. added
    [Status] StaleGives the original author opportunity to update before closing. Can be reopened as needed.
    on Nov 20, 2025
  12. FakhriAz commented on Nov 20, 2025

    @FakhriAz

    Reproduction Report

    Description

    Uploaded the .tff file and no upload was possible in the typography > fonts.

    Converted the .tff file to .woff2 as using the site you provided above: https://transfonter.org/, the font was uploaded successfully.

    Actual Results

    ✅ 2. Solved when using a .woff2

    ❌ 1. Error condition occurs with .tff

    Environment

    • WordPress: 6.9-RC2-61266
    • PHP: 8.4.14-dev
    • Server: PHP.wasm
    • Database: WP_SQLite_Driver (Server: 8.0.38 / Client: 3.40.1)
    • Browser: Chrome 142.0.0.0
    • OS: Linux
    • Theme: Twenty Twenty-Five 1.3
    • MU Plugins: None activated
    • Plugins:
      • Gutenberg 22.1.0
      • Test Reports 1.2.1

    Supplemental Artifacts

    ❌ Video of the test uploading the .ttf file.

    Screenshot of the console log after performing the .ttf file upload

    Image

    ✅ Video of the test uploading the .woff2 file.

  13. removed
    [Status] StaleGives the original author opportunity to update before closing. Can be reopened as needed.
    on Nov 21, 2025
  14. added
    Good First IssueAn issue that's suitable for someone looking to contribute for the first time
    and removed
    Needs TestingNeeds further testing to be confirmed.
    on Nov 27, 2025
  15. Mustafabharmal commented on Mar 6, 2026

    @Mustafabharmal
    Contributor

    I’m not able to reproduce this on the current trunk branch. Is the issue still present, or has it been resolved since the original report?

    TTF.Fond.Upload.mov
  16. t-hamano commented on Mar 7, 2026

    @t-hamano
    Contributor

    @Mustafabharmal What font file did you test with? In my case the problem is still not resolved.

  17. Mustafabharmal commented on Mar 7, 2026

    @Mustafabharmal
    Contributor

    @t-hamano I have tested it with the .ttf file mentioned here.

    Try uploading this font:
    AaDaoShuRi-LangManHeiTi-2.ttf.zip

  18. Mustafabharmal commented on Mar 8, 2026

    @Mustafabharmal
    Contributor

    I've been investigating this and can confirm the root cause. The issue is not reproducible in Safari but it consistently fails in Chrome.

    The error is Chrome-specific, Chrome's built-in OpenType Sanitizer (OTS) rejects fonts that contain non-standard or unsupported OpenType tables (in this case vhea with an unrecognised version 0x10001). Safari is more permissive and loads the same font without issue.

    The failure happens inside loadFontFaceInBrowser() when FontFace.load() throws a SyntaxError. Since this function is only responsible for loading the font into the browser for preview purposes, the error propagates as an unhandled rejection and blocks the entire upload, even though the server-side installation would otherwise succeed.

    The fix I'm working on wraps FontFace.load() in a try-catch directly inside loadFontFaceInBrowser: if Chrome's OTS rejects the font, the function returns silently and the install proceeds normally. The font won't preview in the editor canvas on Chrome, but it installs and is usable in the theme. Compliant fonts are unaffected.

    Will be raising the PR soon.

  19. t-hamano commented on Mar 9, 2026

    @t-hamano
    Contributor

    The fix I'm working on wraps FontFace.load() in a try-catch directly inside loadFontFaceInBrowser: if Chrome's OTS rejects the font, the function returns silently and the install proceeds normally.

    Instead of masking the error, should we inform the user about the error and encourage them to fix the invalid data in the font itself?

  20. Ayushinag commented on Apr 15, 2026

    @Ayushinag

    Hi, I tried another font-family TTF file, and it worked properly—the font was uploaded successfully. It seems that only this particular TTF file is not uploading as a font family.

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

Metadata

Metadata

Labels

Good First IssueAn issue that's suitable for someone looking to contribute for the first time[Feature] Font Library[Status] In ProgressTracking issues with work in progress[Type] BugAn existing feature does not function as intended

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions