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