Site logo

[Resolved] Adding Local font which is not google web font

Home Forums Support [Resolved] Adding Local font which is not google web font

Home Forums Support Adding Local font which is not google web font

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1853781
    Ragunaath

    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?

    #1853938
    David
    Staff
    Customer Support

    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

    #1868817
    Ragunaath

    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

    #1868953
    David
    Staff
    Customer Support

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

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