BUG: SPPB - Font Weight Dropdown Not Filtered For Local Fonts (custom-fonts) - Question | JoomShaper

BUG: SPPB - Font Weight Dropdown Not Filtered For Local Fonts (custom-fonts)

M

Martin

SP Page Builder 6 days ago

The font weight dropdown in the Typography control shows all weights (Thin -> Black) for local/custom-uploaded fonts, regardless of which weights the font actually provides. Weight filtering works correctly for Google Fonts.

Root cause (in bundle.min.js, module 680):

The function that builds the font dropdown options only includes variants for Google Fonts:

{label: e.family_name, value: e.family_name, type: e.type}, "google" === e.type && {variants: e.data.variants} // ^^^^^^^^^^^^^^^^^^^^^^^^^^ // local fonts: variants never added to the option object

The weight filter then evaluates:

q && Array.isArray(q.variants) // -> false for local fonts, because q.variants === undefined // -> falls back to showing all weight options unfiltered

Expected behavior:

The variants array is already stored correctly in #sppagebuilder_fonts.data for local fonts (both for fonts uploaded via SPPB's own font manager and third-party integrations). The filter logic is already in place - it just needs "google" to be replaced with a check that also covers "local":

// Suggested fix: (e.type === "google" || e.type === "local") && {variants: e.data.variants}

Affected: All local/custom fonts, including fonts uploaded through SPPB's own font manager.

SP Page Builder version: 6.6.0

0
2 Answers
Paul Frankowski
Paul Frankowski
Accepted Answer
Senior Staff 6 days ago #224566

Big Thanks Martin.

For sure I will share to our developer team, I hope it can be corrected in next update.

I guess you noticed that during testing of your Local Font extension, right ;)

0
M
Martin
Accepted Answer
6 days ago #224568

You guessed it - give me 5 minutes, and I'll have an important update about ODLF. :D

0