[PDF Ink Signatures] Fix skia font serialization [chromium/src : main]

0 views
Skip to first unread message

April Kallmeyer (Gerrit)

unread,
Jun 25, 2026, 6:01:19 PM (yesterday) Jun 25
to chromium...@chromium.org, chromium-a...@chromium.org, pdf-r...@chromium.org, extension...@chromium.org

April Kallmeyer has uploaded the change for review

Commit message

[PDF Ink Signatures] Fix skia font serialization

System fonts like PengFeng on MacOS were sometimes failing skia
deserialization and this makes it succeed.

It's theoretically possible that there are some fonts that previously
were successfully loaded by FPDFText_LoadFont() with kDoIncludeData but
will not load with kIncludeDataIfLocal. However I don't know of any such
fonts and after this change we will be able to put the font name in a
CrashKey for later debugging.
Bug: 503013380
Change-Id: I84bd66fdb3d61152f1a50daeb1c845edde9354a8

Change diff

diff --git a/chrome/renderer/extensions/api/pdf_viewer_private_custom_bindings.cc b/chrome/renderer/extensions/api/pdf_viewer_private_custom_bindings.cc
index a476dae..3017a4dc 100644
--- a/chrome/renderer/extensions/api/pdf_viewer_private_custom_bindings.cc
+++ b/chrome/renderer/extensions/api/pdf_viewer_private_custom_bindings.cc
@@ -46,7 +46,7 @@
sk_sp<SkTypeface> font) {
CHECK(font);
sk_sp<SkData> serialized_font =
- font->serialize(SkTypeface::SerializeBehavior::kDoIncludeData);
+ font->serialize(SkTypeface::SerializeBehavior::kIncludeDataIfLocal);
if (!serialized_font) {
return {};
}

Change information

Files:
  • M chrome/renderer/extensions/api/pdf_viewer_private_custom_bindings.cc
Change size: XS
Delta: 1 file changed, 1 insertion(+), 1 deletion(-)
Open in Gerrit

Related details

Attention set is empty
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: newchange
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I84bd66fdb3d61152f1a50daeb1c845edde9354a8
Gerrit-Change-Number: 8007936
Gerrit-PatchSet: 1
Gerrit-Owner: April Kallmeyer <a...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

April Kallmeyer (Gerrit)

unread,
Jun 25, 2026, 6:02:14 PM (yesterday) Jun 25
to Lei Zhang, chromium...@chromium.org, chromium-a...@chromium.org, extension...@chromium.org, pdf-r...@chromium.org
Attention needed from Lei Zhang

April Kallmeyer voted Commit-Queue+1

Commit-Queue+1
Open in Gerrit

Related details

Attention is currently required from:
  • Lei Zhang
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I84bd66fdb3d61152f1a50daeb1c845edde9354a8
Gerrit-Change-Number: 8007936
Gerrit-PatchSet: 1
Gerrit-Owner: April Kallmeyer <a...@chromium.org>
Gerrit-Reviewer: April Kallmeyer <a...@chromium.org>
Gerrit-Reviewer: Lei Zhang <the...@chromium.org>
Gerrit-Attention: Lei Zhang <the...@chromium.org>
Gerrit-Comment-Date: Thu, 25 Jun 2026 22:01:59 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

April Kallmeyer (Gerrit)

unread,
1:11 PM (7 hours ago) 1:11 PM
to Chromium LUCI CQ, Lei Zhang, chromium...@chromium.org, chromium-a...@chromium.org, extension...@chromium.org, pdf-r...@chromium.org
Attention needed from Lei Zhang

April Kallmeyer added 1 comment

Patchset-level comments
File-level comment, Patchset 1 (Latest):
April Kallmeyer . resolved

I manually tested this on Windows and Linux (in addition to the mac machine I developed this on) with a multi-font string and didn't have any problems loading fonts. I also checked with and without OOPIF and it all worked.

Open in Gerrit

Related details

Attention is currently required from:
  • Lei Zhang
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I84bd66fdb3d61152f1a50daeb1c845edde9354a8
Gerrit-Change-Number: 8007936
Gerrit-PatchSet: 1
Gerrit-Owner: April Kallmeyer <a...@chromium.org>
Gerrit-Reviewer: April Kallmeyer <a...@chromium.org>
Gerrit-Reviewer: Lei Zhang <the...@chromium.org>
Gerrit-Attention: Lei Zhang <the...@chromium.org>
Gerrit-Comment-Date: Fri, 26 Jun 2026 17:10:59 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Lei Zhang (Gerrit)

unread,
1:32 PM (7 hours ago) 1:32 PM
to April Kallmeyer, Chromium LUCI CQ, Lei Zhang, chromium...@chromium.org, chromium-a...@chromium.org, extension...@chromium.org, pdf-r...@chromium.org
Attention needed from April Kallmeyer

Lei Zhang added 1 comment

Commit Message
Line 9, Patchset 1 (Latest):System fonts like PengFeng on MacOS were sometimes failing skia
Lei Zhang . unresolved

Same question as crrev.com/c/8007770 - what actually happens underneath?

Open in Gerrit

Related details

Attention is currently required from:
  • April Kallmeyer
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I84bd66fdb3d61152f1a50daeb1c845edde9354a8
    Gerrit-Change-Number: 8007936
    Gerrit-PatchSet: 1
    Gerrit-Owner: April Kallmeyer <a...@chromium.org>
    Gerrit-Reviewer: April Kallmeyer <a...@chromium.org>
    Gerrit-Reviewer: Lei Zhang <the...@chromium.org>
    Gerrit-Attention: April Kallmeyer <a...@chromium.org>
    Gerrit-Comment-Date: Fri, 26 Jun 2026 17:32:36 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Lei Zhang (Gerrit)

    unread,
    1:34 PM (7 hours ago) 1:34 PM
    to April Kallmeyer, Chromium LUCI CQ, Lei Zhang, chromium...@chromium.org, chromium-a...@chromium.org, extension...@chromium.org, pdf-r...@chromium.org
    Attention needed from April Kallmeyer

    Lei Zhang added 1 comment

    Commit Message
    Line 14, Patchset 1 (Latest):will not load with kIncludeDataIfLocal. However I don't know of any such

    fonts and after this change we will be able to put the font name in a
    Lei Zhang . resolved
    Open in Gerrit

    Related details

    Attention is currently required from:
    • April Kallmeyer
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I84bd66fdb3d61152f1a50daeb1c845edde9354a8
    Gerrit-Change-Number: 8007936
    Gerrit-PatchSet: 1
    Gerrit-Owner: April Kallmeyer <a...@chromium.org>
    Gerrit-Reviewer: April Kallmeyer <a...@chromium.org>
    Gerrit-Reviewer: Lei Zhang <the...@chromium.org>
    Gerrit-Attention: April Kallmeyer <a...@chromium.org>
    Gerrit-Comment-Date: Fri, 26 Jun 2026 17:34:05 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    April Kallmeyer (Gerrit)

    unread,
    1:55 PM (7 hours ago) 1:55 PM
    to Chromium LUCI CQ, Lei Zhang, chromium...@chromium.org, chromium-a...@chromium.org, extension...@chromium.org, pdf-r...@chromium.org
    Attention needed from Lei Zhang

    April Kallmeyer added 1 comment

    Commit Message
    Line 14, Patchset 1 (Latest):will not load with kIncludeDataIfLocal. However I don't know of any such
    fonts and after this change we will be able to put the font name in a
    Lei Zhang . resolved

    crbug.com/502468286 ?

    April Kallmeyer

    I believe nothing changes for emoji. It crashed at CHECK(font) before and it crashes at CHECK(font) after. So Noto Color Emoji was never successfully loaded by FPDFText_LoadFont() before.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Lei Zhang
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I84bd66fdb3d61152f1a50daeb1c845edde9354a8
    Gerrit-Change-Number: 8007936
    Gerrit-PatchSet: 1
    Gerrit-Owner: April Kallmeyer <a...@chromium.org>
    Gerrit-Reviewer: April Kallmeyer <a...@chromium.org>
    Gerrit-Reviewer: Lei Zhang <the...@chromium.org>
    Gerrit-Attention: Lei Zhang <the...@chromium.org>
    Gerrit-Comment-Date: Fri, 26 Jun 2026 17:55:18 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Lei Zhang <the...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Lei Zhang (Gerrit)

    unread,
    3:05 PM (6 hours ago) 3:05 PM
    to April Kallmeyer, Chromium LUCI CQ, Lei Zhang, chromium...@chromium.org, chromium-a...@chromium.org, extension...@chromium.org, pdf-r...@chromium.org
    Attention needed from April Kallmeyer

    Lei Zhang added 1 comment

    Commit Message
    Line 14, Patchset 1 (Latest):will not load with kIncludeDataIfLocal. However I don't know of any such
    fonts and after this change we will be able to put the font name in a
    Lei Zhang . resolved

    crbug.com/502468286 ?

    April Kallmeyer

    I believe nothing changes for emoji. It crashed at CHECK(font) before and it crashes at CHECK(font) after. So Noto Color Emoji was never successfully loaded by FPDFText_LoadFont() before.

    Lei Zhang

    OK. I was just thinking of other fonts that cause a crash in general.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • April Kallmeyer
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I84bd66fdb3d61152f1a50daeb1c845edde9354a8
    Gerrit-Change-Number: 8007936
    Gerrit-PatchSet: 1
    Gerrit-Owner: April Kallmeyer <a...@chromium.org>
    Gerrit-Reviewer: April Kallmeyer <a...@chromium.org>
    Gerrit-Reviewer: Lei Zhang <the...@chromium.org>
    Gerrit-Attention: April Kallmeyer <a...@chromium.org>
    Gerrit-Comment-Date: Fri, 26 Jun 2026 19:05:09 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Lei Zhang <the...@chromium.org>
    Comment-In-Reply-To: April Kallmeyer <a...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy
    Reply all
    Reply to author
    Forward
    0 new messages