Support » Theme: Twenty Twelve » [Theme: Twenty Twelve] An optional display font. Where?

Viewing 8 replies - 1 through 8 (of 8 total)
  • By default it is ON.

    Load your page and check the source. If you see BODY having the class custom-font-enabled, that shows it’s ON.

    Thread Starter GaryManners

    (@garymanners)

    So this is a setting or a hook for developers rather than a theme option for casual users?

    I searched the codex for how to utilize this function but had no luck.

    This is not about WordPress it is about theme.

    If you would open functions.php you would find:

    /*
    	 * Loads our special font CSS file.
    	 *
    	 * The use of Open Sans by default is localized. For languages that use
    	 * characters not supported by the font, the font can be disabled.
    	 *
    	 * To disable in a child theme, use wp_dequeue_style()
    	 * function mytheme_dequeue_fonts() {
    	 *     wp_dequeue_style( 'twentytwelve-fonts' );
    	 * }
    	 * add_action( 'wp_enqueue_scripts', 'mytheme_dequeue_fonts', 11 );
    	 */
    Thread Starter GaryManners

    (@garymanners)

    I don’t mean to sound dense. But I don’t get it.

    When the theme says it has “an optional display font,”
    What does that mean?
    What does that allow me to do exactly?

    Hi Gary,

    The display font (Open Sans) is optional but turned ON by default. The reason it’s labeled as “optional” is because it doesn’t necessarily handle all possible languages very well. You’re correct however in believing this is more of a developer-geared feature. As TomasM showed a few comments ago it’s possible to programmatically disable this “optional” font by dequeueing the script but that’s really the only way to do it correctly.

    Hope that helps.

    My TwentyTwelve site loads very slowly, and my current thinking is that the loading of the Open Sans font is to blame. I want to disable it anyway.

    I’ve tried disabling the font in my child theme by including the suggested code (see ThomasM’s second comment above) in my child theme’s functions.php, i.e.

    function mytheme_dequeue_fonts() {
         wp_dequeue_style( 'twentytwelve-fonts' );
    }
    add_action( 'wp_enqueue_scripts', 'mytheme_dequeue_fonts', 11 );

    …But, when I view my site’s header, it still reads:

    <link rel='stylesheet' id='twentytwelve-fonts-css' href='http://fonts.googleapis.com/css?family=Open+Sans:400italic,700italic,400,700&subset=latin,latin-ext' type='text/css' media='all' />

    Am I missing the point? Is there any way to tell my theme not to load the Open Sans font from the Google site?

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    @gruts
    You can create your own thread for support with your own issue.

    Andrew Nevins, sorry, will do.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘[Theme: Twenty Twelve] An optional display font. Where?’ is closed to new replies.