how to change fonts

Community Forums Forums Design Tips and Tricks how to change fonts

This topic is: not resolved

This topic contains 1 reply, has 2 voices, and was last updated by  nutsandbolts 8 months, 2 weeks ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #77833

    Sabine
    Member
    Post count: 18

    Hi,

    in the tutorials I found the info, that it is better to change the code for the fonts. But how do I do that?

    In the modern-Portfolio style.css the code is now:

    @import url(http://fonts.googleapis.com/css?family=Lato:300,400|Merriweather:300,400);

    In the tutorial this code is mentioned:

    /* Enqueue Lato Google font 
     add_action( 'wp_enqueue_scripts', 'sp_load_google_fonts' ); 
     function sp_load_google_fonts() { 
     	wp_enqueue_style( 'google-font-lato', '//fonts.googleapis.com/css?family=Lato:300,700', array(), CHILD_THEME_VERSION ); 
     } 

    Do I have to delete the font first in the style.css?

    As the code in the tutorial is different to the one in the style.css, would this be the correct code? I changed the 700 to 400 and added the Merriweather.

    /* Enqueue Lato Google font 
     add_action( 'wp_enqueue_scripts', 'sp_load_google_fonts' ); 
     function sp_load_google_fonts() { 
     	wp_enqueue_style( 'google-font-lato', '//fonts.googleapis.com/css?family=Lato:300,400|Merriweather:300,400', array(), CHILD_THEME_VERSION ); 
     } 

    I bought one font. It’s not from Google and want to use it on my Website too.

    How does the correct code look like, that I can use it?

    Thanks for your help!

    #77834

    nutsandbolts
    Moderator
    Post count: 3113

    You’ve got two different methods – the first thing you pasted in from your theme is pulling the font through the stylesheet. The other example you pasted in is a function that would go in functions.php. Either method is fine for getting the font, but since your theme uses the CSS method, that’s what I would stick to.

    I’m not sure I understand what you’re wanting to do, since your current stylesheet uses Lato and Merriweather, and the function is also using Lato and Merriweather. It wouldn’t change anything as far as which fonts the theme is prepared to use.

    If you want to use a third party font, there should be some instructions on the website where you purchased (assuming the font is web safe). Did your download include all the files you’d need to use it on a website?


    Andrea Whitmer, Owner, Nuts and Bolts Media
    I provide dev and training services for web designers • Find me on Twitter and Google+

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.