Site logo

Archived topic

Adding Local font which is not google web font

3 replies · Started by Ragunaath on July 13, 2021

Viewing posts 1–4 of 4

Hi, I've seen threads and docs on adding web font locally, I want to add font of my language, which is Tamil, there are few Google Tamil web fonts, also there's set of "Goolge Noto Fonts" which is Sans and Serif whcih is not available in google webfonts. How to add and reference it?

I'm using Child theme and uploaded selected Noto Sans and Serfit fons in /fonts folder

Also I see there are no of formats being reference, say ttf, woft, svg, but as of NOTO fonts is it same?

Hi there,

the method we provide here:

https://docs.generatepress.com/article/adding-local-fonts/

Will work for any font, whether it be a google font in the customizer list or not - or a non google font.

You just need to ensure the fonts are locally stored, and the @font-face CSS URLs point to those fonts

I've stored fonts locally both in child theme and main theme, also added the php snippet to add the Tamil google web fonts with the plugin WP Code box, site is https://moneypechu.com/home

<?php 

add_filter( 'generate_typography_default_fonts', function( $fonts ) {
    $fonts[] = 'Arima Madurai';
    $fonts[] = 'Catamaran';
    $fonts[] = 'Meera Inimai';
    $fonts[] = 'Mukta Malar';

    return $fonts;
} );

And another snippet to remove the google font

<?php 

add_action( 'admin_init', function() {
    add_filter( 'generate_google_fonts_array', '__return_empty_array' );
} );

When I search for added Tamil fonts in theme customizer, it doesn't show up, but when I search in a Gutenberg blog Mazagine plugin called PostX, it shows up there when typography is searched with in that.

I've uploaded font through ftp in the fonts folder, is this CSS referencing correct?

https://moneypechu.com/wp-content/themes/generatepress_child

Would like to know, what I did wrong

Those font listings should appear under the System fonts in Customizer > Typography > Body ( for example ).
Can you clear any caches and recheck there?

This archived topic is closed to new replies.