Site logo

Archived topic

Custom Font Not Detecting In Customizer

3 replies · Started by Akhil on October 18, 2018

Viewing posts 1–4 of 4

Hi,

I followed your documentation for custom fonts. https://docs.generatepress.com/article/adding-local-fonts/

But the font is not showing in the customizer.

I added this to style.css of child:

@font-face {
    font-family: geomanist;
    src: url(fonts/geomanist/geomanist-light-webfont.eot);
    src: url(fonts/geomanist/geomanist-light-webfont.eot?#iefix) format("embedded-opentype"), url(fonts/geomanist/geomanist-light-webfont.woff2) format("woff2"), url(fonts/geomanist/geomanist-light-webfont.woff) format("woff"), url(fonts/geomanist/geomanist-light-webfont.ttf) format("truetype"), url(fonts/geomanist/geomanist-light-webfont.svg#geomanistlight) format("svg");
    font-weight: 300;
    font-style: normal
}

I added this to functions.php of child:

add_filter( 'generate_typography_default_fonts', 'tu_add_local_fonts' );
function tu_add_local_fonts( $fonts ) {
    $fonts[] = 'geomanist';
    return $fonts;
}

Is this is because that I'm using custom directory name for my child theme? Child theme name and directory name is custom.

Note: Typography is disabled on the generatepress options.

Thanks!

That should work. You're not seeing the font under the "System Fonts" section of the dropdown? It should be at the end.

Hi,

I have fixed it.

Thanks!

No problem :)

This archived topic is closed to new replies.