WordPress.org

Ready to get started?Download WordPress

Forums

Open Sans typeface in twentytwelve theme... (5 posts)

  1. Cr00zng
    Member
    Posted 1 year ago #

    The twentytwelve theme includes the Open Sans typeface that is referenced somewhere in the code. The font is not stored on the server, instead it is called in a style sheet:

    <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' />

    The content of the referenced style sheet is:

    @font-face {
      font-family: 'Open Sans';
      font-style: normal;
      font-weight: 700;
      src: local('Open Sans Bold'), local('OpenSans-Bold'), url(https://themes.googleusercontent.com/static/fonts/opensans/v6/k3k702ZOKiLJc3WVjuplzBa1RVmPjeKy21_GQJaLlJI.woff) format('woff');
    }
    @font-face {
      font-family: 'Open Sans';
      font-style: italic;
      font-weight: 700;
      src: local('Open Sans Bold Italic'), local('OpenSans-BoldItalic'), url(https://themes.googleusercontent.com/static/fonts/opensans/v6/PRmiXeptR36kaC0GEAetxoUt79146ZFaIJxILcpzmhI.woff) format('woff');
    }
    @font-face {
      font-family: 'Open Sans';
      font-style: italic;
      font-weight: 400;
      src: local('Open Sans Italic'), local('OpenSans-Italic'), url(https://themes.googleusercontent.com/static/fonts/opensans/v6/xjAJXh38I15wypJXxuGMBtIh4imgI8P11RFo6YPCPC0.woff) format('woff');
    }
    @font-face {
      font-family: 'Open Sans';
      font-style: normal;
      font-weight: 400;
      src: local('Open Sans'), local('OpenSans'), url(https://themes.googleusercontent.com/static/fonts/opensans/v6/u-WUoqrET9fUeobQW7jkRT8E0i7KZn-EPnyo3HZu7kw.woff) format('woff');
    }

    The new installation of 3.5 had been searched to remove the references to the Open Sans typeface. The search had found 38 references to the word "google" in 16 files. The match ranged from a simple google link for cookie explanation to calling js scripts to load from google.

    The reference to the style sheet in question is found in the "..wp-content\themes\twentytwelve\functions.php" file, line # 139:

    wp_enqueue_style( 'twentytwelve-fonts', add_query_arg( $query_args, "$protocol://fonts.googleapis.com/css" ), array(), null );

    Can this and other related lines be removed without breaking the twentytwelve theme?

    Alternatively and since the typeface is open sourced, can it be stored on the server and update the links?

    TIA...

  2. Rev. Voodoo
    Volunteer Moderator
    Posted 1 year ago #

    The font is brought in through functions.php

    You can take a look starting line 106

    There are notes in the file about the usage. You can dequeue the font and run your own, or probably dequeue and enqueue your own (local or whatever)

    With the font dequeued you could really do what you want, and adjust the css accordingly from your child theme

    You would never edit 2012 directly of course http://vudu.me/child

  3. Cr00zng
    Member
    Posted 1 year ago #

    Thanks Voodoo...

    I've never liked depending on a third-party site for my blog, even if the site is google. For the time being I'll stick with twentyeleven + child theme.

    Since the twentytwelve theme will not be used, can it be deleted? To my recollection, the answer is yes...

    TIA...

  4. Rev. Voodoo
    Volunteer Moderator
    Posted 1 year ago #

    Actually, I don't believe so...

    If I'm not mistaken, on WP 3.5, 2012 became the default theme... which makes it the fallback WP relies on for troubleshooting, etc. It basically fills the role 2011 and 2010 did previously

    As far as fonts go, I tend to prefer loading them from Google, same thing for jQuery when possible. Reduces bottleneck by avoiding http requests off the same URL. But of course, there are + and - for that decision, and each person has a different priority!

  5. Cr00zng
    Member
    Posted 1 year ago #

    Actually, you can...

    I have two live site that have 2011 and child themes only where the WP version is 3.5; both the guests and authenticated users have no problems accessing the sites. The more worrisome were the plugins that may rely on the latest theme, but they are a OK as well.

    Just out of curiosity, I've done some tests in my preview installation of WP 3.5. Deleting all the themes in the ..\wp-content\themes folder had the expected results. Guest got a blank page with no error message, while the direct link to the administrator login and managing the site features worked just fine.

    Seemingly, there are no dependencies between the ..\wp-content\themes and ..\wp-admin folders. That actually makes sense since the theme is just window dressing...

    You are correct that in WP 3.5, 2012 is the default theme. Without any theme installed the admin interface did show 2012 theme as the default theme. Evidently, some of the developers have some sense of humor popping up this message with no themes installed:

    You only have one theme installed right now. Live a little!...

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.