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 1 month 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
5 Answers
Paul Frankowski
Paul Frankowski
Accepted Answer
Senior Staff 1 week ago #227587

look down

0
M
Martin
Accepted Answer
1 week ago #227598

Thanks Paul :)

0
Paul Frankowski
Paul Frankowski
Accepted Answer
Senior Staff 1 month 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
1 month ago #224568

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

0
M
Martin
Accepted Answer
1 week ago #227577

Hi Paul,

I hope you're doing well.

I wanted to ask if there has been any feedback from the developer team regarding this issue.

I recently checked the current SP Page Builder version (6.6.2) and it looks like the affected code is still unchanged, so the font weight filtering for local/custom fonts does not seem to be fixed yet.

I completely understand that there have been more urgent priorities recently, especially with the security-related work. I was just curious whether there is already any update or status information from the developers.

Thanks in advance. :)

Best regards, Martin

0