<?php
/**
 * WordPress.com specifics
 *
 * @package: Newsworthy
 */

global $themecolors;

/**
 * Set a default theme color array for WP.com.
 *
 * @global array $themecolors
 */
$themecolors = array(
	'bg'     => 'f2f2f2',
	'border' => 'cccccc',
	'text'   => '333333',
	'link'   => '01a0db',
	'url'    => '01a0db',
);

// Dequeue the font script if the blog has WP.com Custom Design.
function newsworthy_dequeue_fonts() {
	if ( class_exists( 'TypekitData' ) && class_exists( 'CustomDesign' ) ) {
		if ( CustomDesign::is_upgrade_active() ) {
			$customfonts = TypekitData::get( 'families' );

			if ( ! $customfonts )
				return;

			$site_title = $customfonts['site-title'];
			$headings = $customfonts['headings'];
			$body_text = $customfonts['body-text'];

			if ( $site_title['id'] && $headings['id'] && $body_text['id'] ) {
				wp_dequeue_style( 'oswald' );
			}
		}
	}
}
add_action( 'wp_enqueue_scripts', 'newsworthy_dequeue_fonts' );