• Hey,

    I’m trying to change the font of my home page’s text with the css3 command “@font-face”

    -> I downloaded the webkit
    -< I put the different font files in my ftp server (in the same folder of my children theme, which is blocksy)
    -> I coped the CSS directly from the css output generated by Squirrel font. (with checking the path).

    then i tried to change the font of my text (with a tag -> class), directly in the “style.css” and in the menu “additional css” of my theme. Neither work…
    The class tag works because i can change the color or the size but not the font.

    I don’t know where the problem come from..
    I use a child theme of the blocksy theme
    here the @font-face in the “style.css” file:

    @font-face {
        font-family: 'metroregular';
        src: url('Metro-webfont.eot');
        src: url('Metro-webfont.eot?#iefix') format('embedded-opentype'),
             url('Metro-webfont.woff2') format('woff2'),
             url('Metro-webfont.woff') format('woff'),
             url('Metro-webfont.ttf') format('truetype'),
             url('Metro-webfont.svg#metroregular') format('svg');
        font-weight: normal;
        font-style: normal;
    }
    • This topic was modified 5 years, 6 months ago by jiibuser.

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter jiibuser

    (@jiibuser)

    I just noticed that even, when try to change the color of my text in the style.css file and then i upload it on my ftp server, it doesn’t work !
    The problem come from the ftp i guess ? It looks like that the child theme do not use the style.css file

    • This reply was modified 5 years, 6 months ago by jiibuser.
    Thread Starter jiibuser

    (@jiibuser)

    Here’s the functions.php of my child theme :

    <?php
    if (! defined('WP_DEBUG')) {
    	die( 'Direct access forbidden.' );
    }
    add_action( 'wp_enqueue_scripts', function () {
    	wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
    });
    
    // Delete the compression ratio for Jpeg pictures
    add_filter( 'jpeg_quality', create_function( '', 'return 100;' ) );
    ?>
Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Adding custom fonts with CSS3 @font-face’ is closed to new replies.