Feature · Gutenberg · Blockenberg

Typography control: a shared font popover and Google Fonts loader

Typography is not a separate block. Blocks that expose a TypographyControl in their inspector share one script. Published pages load only the Google families actually used in those attributes.

Get Blockenberg

Blockenberg is a Gutenberg block library. These features are plugin-wide editor tools, not Elementor extensions.

Get Blockenberg

What it actually does

Default typography object keys: family, sizeDesktop/Tablet/Mobile + sizeUnit, weight, transform, style, decoration, lineHeight* + unit, letterSpacing* + unit, wordSpacing* + unit.

Front-end loader runs on wp_enqueue_scripts only for singular posts with blocks. It walks parsed blocks named blockenberg/*, finds attributes whose key ends with Typo or starts with typo, and if family is not in the system list (Arial, Georgia, Helvetica, Tahoma, Times New Roman, Trebuchet MS, Verdana), enqueues https://fonts.googleapis.com/css2?family=…:wght@300;400;500;600;700;800;900&display=swap.

Where it lives in WordPress

In the editor, open a Blockenberg block that has a typography control (often labeled Title Typography or similar). Script handle bkbg-typography-control is registered on init so block scripts can depend on it. wp_localize_script exposes window.bkbgGoogleFonts from bkbg_google_fonts_list() in assets/php/google-fonts.php. The control also sets window.bkbgTypographyControl, window.bkbgTypoCssVars, and window.bkbgLoadGoogleFont.

How to use it

  1. Select a text-heavy Blockenberg block. Open the typography popover on the control that uses TypographyControl.
  2. Pick a family. Google list is injected as bkbgGoogleFonts. System fonts will not enqueue a Google request.
  3. Set desktop size, then tablet/mobile. Each device has its own size/line-height/spacing fields.
  4. Publish a singular post/page. The PHP walker only runs on singular views with blocks.
  5. Confirm the network tab. You should see fonts.googleapis.com only for non-system families actually stored on blocks.

Controls and behavior

PieceWhat the plugin does
familyTriggers Google Fonts enqueue unless it is in the system list (Arial, Georgia, Helvetica, Tahoma, Times New Roman, Trebuchet MS, Verdana).
bkbg_google_fonts_list()PHP list localized as window.bkbgGoogleFonts for the popover.
size / lineHeight / letterSpacing / wordSpacingPer desktop, tablet, mobile with units.
weight / transform / style / decorationStandard CSS font properties.

When this is the right tool

Notes from the code

Archives and non-singular templates do not run this walker — only singular posts/pages. blockenberg.com.

FAQ

Font looks fine in the editor but not on the blog index.

Google Fonts enqueue is hooked for singular posts only.

Can I use a custom hosted font?

The loader is Google CSS2 URLs plus a system-font skip list. Custom files need your theme or Custom CSS.

Other plugin features

Get Blockenberg

Install the plugin from WordPress.org, then use this feature in the native block editor.

Get Blockenberg