WordPress.org

Ready to get started?Download WordPress

Forums

Twenty Twelve
[resolved] An optional display font. Where? (9 posts)

  1. GaryManners
    Member
    Posted 1 year ago #

    Description says "an optional display font..."
    Am I missing the setting for this?

    http://wordpress.org/extend/themes/twentytwelve/

  2. Tomas Mackevicius
    Member
    Posted 1 year ago #

    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.

  3. GaryManners
    Member
    Posted 1 year ago #

    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.

  4. Tomas Mackevicius
    Member
    Posted 1 year ago #

    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 );
    	 */
  5. GaryManners
    Member
    Posted 1 year ago #

    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?

  6. 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.

  7. gruts
    Member
    Posted 1 year ago #

    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?

  8. Andrew
    Forum Moderator
    Posted 1 year ago #

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

  9. gruts
    Member
    Posted 1 year ago #

    Andrew Nevins, sorry, will do.

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic