Site logo

[Support request] I want to use my own Custom Font

Home Forums Support [Support request] I want to use my own Custom Font

Home Forums Support I want to use my own Custom Font

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #2525453
    Rohan Verma

    Hello
    , I am trying to use the HK Grotesk font. I have downloaded all of the font variants (woff2 >> 400, 500, 700) and uploaded the fonts to media with the code snippet. However, when I add HK Grotesk to Typography, it is not working. Is there something I am missing? Could you please offer assistance?

    I followed some tutorials but nothing worked so currently using Custom Font plugin to show the font. But I want to use the font without any plugins.

    #2525467
    Fernando
    Customer Support

    Hi Rohan,

    Have you followed all the steps here including adding the @font-face rules?: https://docs.generatepress.com/article/adding-local-fonts/

    #2525473
    Rohan Verma

    Using @font-face for Google fonts right. How can I get it for “HK Grotesk”?

    #2525487
    Fernando
    Customer Support

    For none Google Font fonts, you would need to create your own @font-face rules.
    Here is an article that may assist you: https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face

    Also see: https://css-tricks.com/snippets/css/using-font-face-in-css/

    There are also several tools online that can do @font-face generation like this one: https://www.fontsquirrel.com/tools/webfont-generator

    #2526234
    Rohan Verma

    Yes fontsquirrel generated this @font-face

    /*! Generated by Font Squirrel (https://www.fontsquirrel.com) on February 7, 2023 */

    @font-face {
    font-family: ‘hk_groteskmedium’;
    src: url(‘hkgrotesk-medium-webfont.woff2’) format(‘woff2’),
    url(‘hkgrotesk-medium-webfont.woff’) format(‘woff’);
    font-weight: normal;
    font-style: normal;

    }

    @font-face {
    font-family: ‘hk_groteskregular’;
    src: url(‘hkgrotesk-regular-webfont.woff2’) format(‘woff2’),
    url(‘hkgrotesk-regular-webfont.woff’) format(‘woff’);
    font-weight: normal;
    font-style: normal;

    }

    @font-face {
    font-family: ‘hk_groteskbold’;
    src: url(‘hkgrotesk-bold-webfont.woff2’) format(‘woff2’),
    url(‘hkgrotesk-bold-webfont.woff’) format(‘woff’);
    font-weight: normal;
    font-style: normal;

    }

    @font-face {
    font-family: ‘hk_groteskbold_italic’;
    src: url(‘hkgrotesk-bolditalic-webfont.woff2’) format(‘woff2’),
    url(‘hkgrotesk-bolditalic-webfont.woff’) format(‘woff’);
    font-weight: normal;
    font-style: normal;

    }

    @font-face {
    font-family: ‘hk_groteskitalic’;
    src: url(‘hkgrotesk-italic-webfont.woff2’) format(‘woff2’),
    url(‘hkgrotesk-italic-webfont.woff’) format(‘woff’);
    font-weight: normal;
    font-style: normal;

    }

    #2526567
    Fernando
    Customer Support

    Great! Now, you can add that through Appearance > Customize > Additional CSS. Make sure the source of the font files is updated. You can get the URL in the Media Library. Example: https://share.getcloudapp.com/z8uleqwq

    With that, you can now use the font family names you’ve added like “hk_groteskmedium”.

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