-
mikedo
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 🙂
-
mikedo
Hello, yes i am using v2 of blocks.
-
Alvind
Hi there,
The filter should still work. Have you installed the font you want to add to the block typography settings on your site?
-
mikedo
I am not sure how to do this.
-
Alvind
You mentioned using a custom theme. Does the theme have a Typography option, usually found in the Customizer?
-
mikedo
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!
-
mikedo
Nice to hear that is not my mistake. Can we expect a fix on this on a later version?
-
Alvind
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
- You must be logged in to reply to this topic.