Refactor FPDFSaveWithFontSubsetEmbedderTest helper methods [pdfium : main]

0 views
Skip to first unread message

Lei Zhang (Gerrit)

unread,
Feb 19, 2026, 8:13:55 PM (3 days ago) Feb 19
to Andy Phan, Lei Zhang, Pdfium LUCI CQ, pdfium-...@googlegroups.com
Attention needed from Andy Phan

Lei Zhang voted and added 1 comment

Votes added by Lei Zhang

Code-Review+1

1 comment

File fpdfsdk/fpdf_save_embeddertest.cpp
Line 394, Patchset 1 (Latest): // font.
Lei Zhang . unresolved

"font, since `text` only contains a subset of the characters in the test font."

Carry over pre-existing line 340, which got lost.

Open in Gerrit

Related details

Attention is currently required from:
  • Andy Phan
Submit Requirements:
  • requirement satisfiedCode-Owners
  • requirement satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: pdfium
Gerrit-Branch: main
Gerrit-Change-Id: Ib158923c027cbc1b35573eb3ecd33b601cf636c5
Gerrit-Change-Number: 143410
Gerrit-PatchSet: 1
Gerrit-Owner: Andy Phan <andy...@chromium.org>
Gerrit-Reviewer: Andy Phan <andy...@chromium.org>
Gerrit-Reviewer: Lei Zhang <the...@chromium.org>
Gerrit-Attention: Andy Phan <andy...@chromium.org>
Gerrit-Comment-Date: Fri, 20 Feb 2026 01:13:52 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

Andy Phan (Gerrit)

unread,
Feb 20, 2026, 3:10:34 PM (2 days ago) Feb 20
to Lei Zhang, Pdfium LUCI CQ, pdfium-...@googlegroups.com

Andy Phan added 1 comment

File fpdfsdk/fpdf_save_embeddertest.cpp
Line 394, Patchset 1: // font.
Lei Zhang . resolved

"font, since `text` only contains a subset of the characters in the test font."

Carry over pre-existing line 340, which got lost.

Andy Phan

Done

Open in Gerrit

Related details

Attention set is empty
Submit Requirements:
    • requirement satisfiedCode-Owners
    • requirement satisfiedCode-Review
    • requirement satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: pdfium
    Gerrit-Branch: main
    Gerrit-Change-Id: Ib158923c027cbc1b35573eb3ecd33b601cf636c5
    Gerrit-Change-Number: 143410
    Gerrit-PatchSet: 2
    Gerrit-Owner: Andy Phan <andy...@chromium.org>
    Gerrit-Reviewer: Andy Phan <andy...@chromium.org>
    Gerrit-Reviewer: Lei Zhang <the...@chromium.org>
    Gerrit-Comment-Date: Fri, 20 Feb 2026 20:10:31 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Lei Zhang <the...@chromium.org>
    satisfied_requirement
    open
    diffy

    Pdfium LUCI CQ (Gerrit)

    unread,
    Feb 20, 2026, 4:39:32 PM (2 days ago) Feb 20
    to Andy Phan, Lei Zhang, pdfium-...@googlegroups.com

    Pdfium LUCI CQ submitted the change with unreviewed changes

    Unreviewed changes

    1 is the latest approved patch-set.
    The change was submitted with unreviewed changes in the following files:

    ```
    The name of the file: fpdfsdk/fpdf_save_embeddertest.cpp
    Insertions: 1, Deletions: 1.

    @@ -391,7 +391,7 @@
    CompareBitmapWithExpectationSuffix(bitmap.get(), kSaveNewTextFilename);

    // Verify the file size increase is smaller when subsetting the new text's
    - // font.
    + // font, since text only contains a subset of the characters in the test font.
    EXPECT_TRUE(FPDF_SaveAsCopy(document(), this, FPDF_SUBSET_NEW_FONTS));
    EXPECT_THAT(GetString(), StartsWith("%PDF-1.7\r\n"));
    // TODO(crbug.com/476127152): File size increase should be smaller.
    ```

    Change information

    Commit message:
    Refactor FPDFSaveWithFontSubsetEmbedderTest helper methods

    Refactor FPDFSaveWithFontSubsetEmbedderTest::LoadTestFont() to make the
    caller pass the font file path. This will allow callers to choose any
    font file they need, rather than the same hardcoded font file.

    Refactor FPDFSaveWithFontSubsetEmbedderTest::InsertNewTextObject() by
    making the caller pass in the font, text, and position of text. Then,
    callers can use various fonts and texts, and choose different positions
    so text does not overlap in the rendering.

    This refactoring is needed for new tests added in
    https://pdfium-review.googlesource.com/c/pdfium/+/141854.
    Bug: 476127152
    Change-Id: Ib158923c027cbc1b35573eb3ecd33b601cf636c5
    Commit-Queue: Andy Phan <andy...@chromium.org>
    Reviewed-by: Lei Zhang <the...@chromium.org>
    Files:
    • M fpdfsdk/fpdf_save_embeddertest.cpp
    Change size: S
    Delta: 1 file changed, 24 insertions(+), 19 deletions(-)
    Branch: refs/heads/main
    Submit Requirements:
    • requirement satisfiedCode-Review: +1 by Lei Zhang
    Open in Gerrit
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: merged
    Gerrit-Project: pdfium
    Gerrit-Branch: main
    Gerrit-Change-Id: Ib158923c027cbc1b35573eb3ecd33b601cf636c5
    Gerrit-Change-Number: 143410
    Gerrit-PatchSet: 3
    Gerrit-Owner: Andy Phan <andy...@chromium.org>
    Gerrit-Reviewer: Andy Phan <andy...@chromium.org>
    Gerrit-Reviewer: Lei Zhang <the...@chromium.org>
    open
    diffy
    satisfied_requirement
    Reply all
    Reply to author
    Forward
    0 new messages