BUG: SPPB - Font Weight dropdown not filtered for local fonts (custom-fonts) - Forum | JoomShaper
Solved SP Page Builder

BUG: SPPB - Font Weight dropdown not filtered for local fonts (custom-fonts)

Asked by Martin Grunert 4 months ago Last activity 3 weeks 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

Accepted answer

Marked as the solution

7 more replies

Paul Frankowski Senior Staff

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 ;)

Martin Grunert Asked this

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

Martin Grunert Asked this

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

Paul Frankowski Senior Staff

look down

Martin Grunert Asked this

Thanks Paul :)

Martin Grunert Asked this

Hi Paul,

I checked this again with the current SP Page Builder 6.8.0 code.

The issue is still present for local fonts, including local variable fonts. The font data in #__sppagebuilder_fonts.data can contain the available variants correctly, but the Typography control does not allow them to be used for fonts with type: "local".

There are two related issues:

First, local font options should carry their stored variants, just like Google Fonts:

(e.type === "google" || e.type === "local") && {
    variants: e.data?.variants ?? []
}

Second, and more importantly, the current Typography component explicitly treats every local font as Regular only. It reduces the available weights to 400 / Normal and renders the Font Weight control as disabled whenever:

q?.type === "local"

As a result, even when a local font provides variants such as 100 through 900, or is a variable font with font-weight: 100 900, SP Page Builder forces it to 400 and prevents selecting another weight.

Could you please forward this to the SP Page Builder development team? Local fonts should use their stored data.variants for filtering and selection, rather than being hard-coded as Regular / 400. The issue can be reproduced with OD Local Fonts 1.5.0 and SP Page Builder 6.8.0.

Thanks :)

Paul Frankowski Senior Staff

I shared topic, but developer answered that so far must be as it's. I tried.

Martin Grunert Asked this

Paul, to be honest, I’m pretty speechless.

Is this restriction deliberately built into the code to impose a functional limitation on your own product, even though everything required is already present?

Even in your Quickstart packages, this restriction is bypassed: several templates use fonts that have already been uploaded as variable fonts. So the capability is used internally, but it is locked for customers in the Typography editor.

What makes this even more difficult to understand is that Helix Ultimate does not impose this restriction and allows local variable font weights to be selected normally.

By the way, this capability has been requested by customers and discussed more than once in the forum. The current implementation now makes clear that the restriction is deliberate rather than a missing technical capability.

Paul Frankowski Senior Staff
1 month ago · edited

I understand, but what I can do :/

by now try to find alternative way to manage that. McGyver style...

Martin Grunert Asked this

Hi Paul,

thanks for getting back to me. And of course I don't blame you for this limitation. You supported me throughout the development of ODLF and gave me a lot of valuable feedback that I was able to act on.

What I find hard to understand is this: the styles are clearly there. In the Font Book both of my fonts show up with 9 styles each, so the data is present and SP Page Builder knows about it. https://prnt.sc/dRL09wS2Wgu0 Yet the font weight field in the editor is disabled for local fonts, so none of those styles can actually be selected.

The Font Book does let you upload individual cuts, but only one at a time - a variable font file containing the full weight range isn't processed as such. So this isn't really about third-party extensions like ODLF. It's a limitation that applies to SP Page Builder's own font management as well.

JoomShaper is aware of the topic and knows it's technically possible, but doesn't give users the option. For whatever reason.

Without modifying the SP Page Builder code there's no way for me to work around this. So as things stand - and apparently as intended - variable fonts simply can't be used in SP Page Builder.

What makes it even more curious: Helix Ultimate doesn't have this restriction. (And don't you dare add it there now!) 😉

Best regards,
Martin

Martin Grunert Asked this

One more thing: this isn't only my case. In forum post https://www.joomshaper.com/forum/question/44620 your colleague Atick confirmed it back in May - "The system only supports adding one font style per upload." Another user then pointed out the practical problem: uploading 14 styles one by one means reworking every page that already uses the font.

So the limitation is known and documented on your side, independently of ODLF.

It's a shame that selecting font weights is reserved for Google Fonts, while local fonts are deliberately locked out - even though the styles are right there in the Font Book.

Mon Amour Massage

Now and then, the JoomShaper team comes up with "brilliant" ideas that make life harder for those of us who buy and use their product.

After the "brilliant idea" of removing the backend editor from SPPB three years ago, they're now back to turning off the font weight field for local fonts.

As a buyer and user, I expect SPPB to help us and simplify our work, not the other way around. And, just as happened three years ago—when they reinstated the backend editor following numerous user protests—I expect you to remove this restriction.

Martin Grunert Asked this

I am sorry for the inconvenience this has caused you. I have tried to obtain a clear explanation from JoomShaper regarding this restriction, but unfortunately the fundamental reason for it still has not been explained.

Based on their responses, broader support for local fonts does not currently appear to be intended. What makes this difficult to understand is that JoomShaper’s own templates and Quickstart packages can apparently use internal functionality for local fonts and multiple weights, while the same capability is not provided to users or third-party developers through a documented extension mechanism.

It is also questionable that Google Fonts continue to receive full support while locally hosted fonts are restricted in the editor. JoomShaper has referred generally to security and technical considerations, but has not identified any specific additional risk caused by local fonts or third-party extensions. If the functionality is safe for their own products, this difference deserves an explanation.

You can find the related discussion, including my complaint and JoomShaper’s responses, here:

https://www.joomshaper.com/forum/question/46600

I am sorry that this limitation affects you as an OD Local Fonts customer. The decision and its consequences ultimately lie with JoomShaper.

Log in to reply.