Are you a GenerateCustomer?

Do you have an active GP Premium or GenerateBlocks Pro license key?

Create a GenerateSupport account for GeneratePress and GenerateBlocks support in one dedicated place.

Create an account
Already have a GenerateSupport account? Login

Just browsing?

Feel free to browse the forums. Support for our free versions is provided on WordPress.org (GeneratePress, GenerateBlocks).

Want to become a premium user? Learn more below.

Add custom fonts without Font library

  • Hello there, I am trying to add a new font family in the Typography dropdown menu. I have followed this code but it seems that is not working.

    https://docs.generateblocks.com/article/add-custom-fonts-to-font-family-dropdown-list/

    Note that i am not using GeneratePress in order to use Font Library, I am just using GenerateBlocks with a custom theme.

    Any help would be much appreciated.

  • Hi there,

    The filter was for v1 GB blocks. Are you using v2 blocks?

    Let me know 🙂

  • Hello, yes i am using v2 of blocks.

  • Hi there,

    The filter should still work. Have you installed the font you want to add to the block typography settings on your site?

  • I am not sure how to do this.

  • You mentioned using a custom theme. Does the theme have a Typography option, usually found in the Customizer?

  • I am registering fonts in the head like this

    and after this I am using the fonts in the css variables like this:

    :root {
    --my-font: 'Poppins';
    }

    The css file which contains the variables is loaded also in the Gutenberg editor via the enqueue_block_editor_assets action in order to use the variables in the backend and the font this way is working if I use the variable rule but for the end users is more friendly to have the font in the dropdown menu from start thats why I am trying to register also my font to the Typography dropdown.

  • I checked with the dev team, and they confirm that the GB filter has a bug, it currently doesn’t work, unfortunately!

  • Nice to hear that is not my mistake. Can we expect a fix on this on a later version?

  • If it’s a simple fix, it should be possible to include it in the next minor update.

    You can stay up to date with the issue here: https://github.com/tomusborne/generateblocks/issues/1790

Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.