Pass CFX_FontMapper to SystemFontInfoIface::MapFont [pdfium : main]

0 views
Skip to first unread message

Tom Sepez (Gerrit)

unread,
Jun 23, 2026, 6:55:02 PM (2 days ago) Jun 23
to Lei Zhang, pdfium...@luci-project-accounts.iam.gserviceaccount.com, pdfium-...@googlegroups.com
Attention needed from Lei Zhang

Tom Sepez voted Commit-Queue+1

Commit-Queue+1
Open in Gerrit

Related details

Attention is currently required from:
  • Lei Zhang
Submit Requirements:
  • requirement 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: pdfium
Gerrit-Branch: main
Gerrit-Change-Id: Ib5a79bd4ef31360ea5cab496d706eecf59b35381
Gerrit-Change-Number: 150610
Gerrit-PatchSet: 3
Gerrit-Owner: Tom Sepez <tse...@chromium.org>
Gerrit-Reviewer: Lei Zhang <the...@chromium.org>
Gerrit-Reviewer: Tom Sepez <tse...@chromium.org>
Gerrit-Attention: Lei Zhang <the...@chromium.org>
Gerrit-Comment-Date: Tue, 23 Jun 2026 22:54:59 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

Lei Zhang (Gerrit)

unread,
Jun 23, 2026, 7:07:35 PM (2 days ago) Jun 23
to Tom Sepez, Lei Zhang, pdfium...@luci-project-accounts.iam.gserviceaccount.com, pdfium-...@googlegroups.com
Attention needed from Tom Sepez

Lei Zhang voted and added 1 comment

Votes added by Lei Zhang

Code-Review+1

1 comment

File core/fxge/win32/cwin32_platform.cpp
Line 131, Patchset 3 (Latest): ByteString* last_family,
Lei Zhang . unresolved

Should this be a reference? Is it ever nullptr?

Open in Gerrit

Related details

Attention is currently required from:
  • Tom Sepez
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: Ib5a79bd4ef31360ea5cab496d706eecf59b35381
Gerrit-Change-Number: 150610
Gerrit-PatchSet: 3
Gerrit-Owner: Tom Sepez <tse...@chromium.org>
Gerrit-Reviewer: Lei Zhang <the...@chromium.org>
Gerrit-Reviewer: Tom Sepez <tse...@chromium.org>
Gerrit-Attention: Tom Sepez <tse...@chromium.org>
Gerrit-Comment-Date: Tue, 23 Jun 2026 23:07:31 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

Tom Sepez (Gerrit)

unread,
Jun 23, 2026, 7:15:27 PM (2 days ago) Jun 23
to Lei Zhang, pdfium...@luci-project-accounts.iam.gserviceaccount.com, pdfium-...@googlegroups.com

Tom Sepez voted and added 1 comment

Votes added by Tom Sepez

Commit-Queue+2

1 comment

File core/fxge/win32/cwin32_platform.cpp
Line 131, Patchset 3: ByteString* last_family,
Lei Zhang . resolved

Should this be a reference? Is it ever nullptr?

Tom Sepez

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: Ib5a79bd4ef31360ea5cab496d706eecf59b35381
    Gerrit-Change-Number: 150610
    Gerrit-PatchSet: 4
    Gerrit-Comment-Date: Tue, 23 Jun 2026 23:15:21 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    Comment-In-Reply-To: Lei Zhang <the...@chromium.org>
    satisfied_requirement
    open
    diffy

    pdfium-scoped@luci-project-accounts.iam.gserviceaccount.com (Gerrit)

    unread,
    Jun 23, 2026, 7:49:39 PM (2 days ago) Jun 23
    to Tom Sepez, Lei Zhang, pdfium-...@googlegroups.com

    pdfium...@luci-project-accounts.iam.gserviceaccount.com submitted the change with unreviewed changes

    Unreviewed changes

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

    ```
    The name of the file: core/fxge/win32/cwin32_platform.cpp
    Insertions: 5, Deletions: 5.

    @@ -128,7 +128,7 @@
    void DeleteFont(void* hFont) override;

    void AddInstalledFont(CFX_FontMapper* mapper,
    - ByteString* last_family,
    + ByteString& last_family,
    const LOGFONTA* plf,
    uint32_t font_type);

    @@ -162,7 +162,7 @@
    uint32_t font_type,
    LPARAM lParam) {
    auto* arg = reinterpret_cast<FontEnumCallbackArg*>(lParam);
    - arg->font_info->AddInstalledFont(arg->mapper, &arg->last_family, plf,
    + arg->font_info->AddInstalledFont(arg->mapper, arg->last_family, plf,
    font_type);
    return 1;
    }
    @@ -195,7 +195,7 @@
    }

    void CFX_Win32FontInfo::AddInstalledFont(CFX_FontMapper* mapper,
    - ByteString* last_family,
    + ByteString& last_family,
    const LOGFONTA* plf,
    uint32_t font_type) {
    ByteString name(plf->lfFaceName);
    @@ -203,7 +203,7 @@
    return;
    }

    - if (name == *last_family) {
    + if (name == last_family) {
    mapper->AddInstalledFont(name, FX_GetCharsetFromInt(plf->lfCharSet));
    return;
    }
    @@ -214,7 +214,7 @@
    }

    mapper->AddInstalledFont(name, FX_GetCharsetFromInt(plf->lfCharSet));
    - *last_family = name;
    + last_family = name;
    }

    void CFX_Win32FontInfo::EnumFontList(CFX_FontMapper* pMapper) {
    ```

    Change information

    Commit message:
    Pass CFX_FontMapper to SystemFontInfoIface::MapFont

    Currently, SystemFontInfoIface implementations (like CFX_Win32FontInfo)
    store a pointer to CFX_FontMapper during EnumFontList() because they
    need it later during MapFont() calls.

    This CL changes SystemFontInfoIface::MapFont() signature to accept
    CFX_FontMapper* as the first argument. Since CFX_FontMapper is always
    the caller of MapFont(), it can pass itself. This allows removing the
    mapper_ member variable from SystemFontInfoIface implementations.

    For CFX_Win32FontInfo, the GDI callback state (last_family) is also
    moved out of the class and into a local FontEnumCallbackArg struct
    used only during enumeration. AddInstalledFont() is decoupled from
    this struct by passing the required pointers directly.

    TAG=agy
    CONV=30003669-9b4b-42c1-bdbf-15c9e0075074
    Change-Id: Ib5a79bd4ef31360ea5cab496d706eecf59b35381
    Reviewed-by: Lei Zhang <the...@chromium.org>
    Commit-Queue: Tom Sepez <tse...@chromium.org>
    Files:
    • M core/fxge/android/cfx_androidfontinfo.cpp
    • M core/fxge/android/cfx_androidfontinfo.h
    • M core/fxge/android/cfx_androidfontinfo_unittest.cpp
    • M core/fxge/apple/capple_platform.cpp
    • M core/fxge/cfx_folderfontinfo.cpp
    • M core/fxge/cfx_folderfontinfo.h
    • M core/fxge/cfx_fontmapper.cpp
    • M core/fxge/cfx_fontmapper_unittest.cpp
    • M core/fxge/linux/fx_linux_impl.cpp
    • M core/fxge/systemfontinfo_iface.h
    • M core/fxge/win32/cwin32_platform.cpp
    • M fpdfsdk/fpdf_sysfontinfo.cpp
    • M testing/test_fonts.cpp
    Change size: M
    Delta: 13 files changed, 86 insertions(+), 53 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: Ib5a79bd4ef31360ea5cab496d706eecf59b35381
    Gerrit-Change-Number: 150610
    Gerrit-PatchSet: 5
    Gerrit-Owner: Tom Sepez <tse...@chromium.org>
    Gerrit-Reviewer: Lei Zhang <the...@chromium.org>
    Gerrit-Reviewer: Tom Sepez <tse...@chromium.org>
    open
    diffy
    satisfied_requirement
    Reply all
    Reply to author
    Forward
    0 new messages