Skip to content

Commit

Permalink
issue #108
Browse files Browse the repository at this point in the history
  • Loading branch information
bassjobsen committed Feb 11, 2014
1 parent 4e883a4 commit c9b4d4d
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 144 deletions.
4 changes: 2 additions & 2 deletions functions/jbst-less-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
add_filter( 'add_extra_less_code', 'add_custom_fonts_path');

if ( ! function_exists( 'add_custom_fonts_path' ) ) :
function add_custom_fonts_path()
function add_custom_fonts_path($less)
{
return '@custom-font-dir: "'.get_stylesheet_directory_uri().'/assets/fonts/";';
return $less."\n".'@custom-font-dir: "'.get_stylesheet_directory_uri().'/assets/fonts/";';
}
endif;

Expand Down
5 changes: 3 additions & 2 deletions functions/template-customizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ public function render_content() {
}
/* FONT OPTIONS */
global $fontchoices;
/* Websafe Fonts */ $fontchoices = array( 'Helvetica Neue' => 'Helvetica Neue', 'Arial' => 'Arial', 'Lucida Bright' => 'Lucida Bright', 'Georgia' => 'Georgia', 'Times New Roman' => 'Times New Roman', /* Google Fonts */ 'Abel' => 'Abel', 'Amaranth' => 'Amaranth', 'Amatic+SC' => 'Amatic SC', 'Anonymous+Pro' => 'Anonymous Pro', 'Anton' => 'Anton', 'Architects+Daughter' => 'Architects Daughter', 'Arimo' => 'Arimo', 'Arvo' => 'Arvo', 'Asap' => 'Asap', 'Bitter' => 'Bitter', 'Black+Ops+One' => 'Black Ops One', 'Bree+Serif' => 'Bree Serif', 'Cabin' => 'Cabin', 'Cabin+Condensed' => 'Cabin Condensed', 'Calligraffitti' => 'Calligraffitti', 'Cantarell' => 'Cantarell', 'Changa+One' => 'Changa One', 'Cherry+Cream+Soda' => 'Cherry Cream Soda', 'Chewy' => 'Chewy', 'Chivo' => 'Chivo', 'Coming Soon' => 'Coming Soon', 'Copse' => 'Copse', 'Covered+By+Your+Grace' => 'Covered By Your Grace', 'Crafty+Girls' => 'Crafty Girls', 'Crimson+Text' => 'Crimson Text', 'Crushed' => 'Crushed', 'Cuprum' => 'Cuprum', 'Dancing+Script' => 'Dancing Script', 'Dosis' => 'Dosis', 'Droid+Sans' => 'Droid Sans', 'Droid+Sans+Mono' => 'Droid Sans Mono', 'Droid+Serif' => 'Droid Serif', 'Exo' => 'Exo', 'Francois+One' => 'Francois One', 'Fredoka+One' => 'Fredoka One', 'Gloria+Hallelujah' => 'Gloria Hallelujah', 'Goudy+Bookletter+1911' => 'Goudy Bookletter 1911', 'Happy+Monkey' => 'Happy Monkey', 'Homemade+Apple' => 'Homemade Apple', 'Istok+Web' => 'Istok Web', 'Josefin+Sans' => 'Josephin Sans', 'Josefin+Slab' => 'Josefin Slab', 'Judson' => 'Judson', 'Just+Me+Again+Down+Here' => 'Just Me Again Down Here', 'Kreon' => 'Kreon', 'Lora' => 'Lora', 'Lato' => 'Lato', 'Limelight' => 'Limelight', 'Lobster' => 'Lobster', 'Luckiest+Guy' => 'Luckiest Guy', 'Marvel' => 'Marvel', 'Maven+Pro' => 'Maven Pro', 'Merriweather' => 'Merriweather', 'Metamorphous' => 'Metamorphous', 'Molengo' => 'Molengo', 'Muli' => 'Muli', 'News+Cycle' => 'News Cycle', 'Nobile' => 'Nobile', 'Nothing+You+Could+Do' => 'Nothing You Could Do', 'Nunito' => 'Nunito', 'Open+Sans' => 'Open Sans', 'Open+Sans' => 'Open Sans', 'Oswald' => 'Oswald', 'Pacifico' => 'Pacifico', 'Paytone+One' => 'Paytone One', 'Permanent+Marker' => 'Permanent Marker', 'Philosopher' => 'Philosopher', 'Play' => 'Play', 'Pontano+Sans' => 'Pontano Sans', 'PT+Sans' => 'PT Sans', 'PT+Sans+Narrow' => 'PT Sans Narrow', 'PT+Sans+Caption' => 'PT Sans Caption', 'PT+Serif' => 'PT Serif', 'Questrial' => 'Questrial', 'Quicksand' => 'Quicksand', 'Raleway' => 'Raleway', 'Reenie+Beanie' => 'Reenie Beanie', 'Righteous' => 'Righteous', 'Rock+Salt' => 'Rock Salt', 'Rokkitt' => 'Rokkitt', 'Shadows+Into+Light' => 'Shadows Into Light', 'Signika' => 'Signika', 'Source+Sans+Pro' => 'Source Sans Pro', 'Squada+One' => 'Squada One', 'Sunshiney' => 'Sunshiney', 'Syncopate' => 'Syncopate', 'Tangerine' => 'Tangerine', 'The+Girl+Next+Door' => 'The Girl Next Door', 'Ubuntu' => 'Ubuntu', 'Ubuntu+Condensed' => 'Ubuntu Condensed', 'Unkempt' => 'Unkempt', 'Vollkorn' => 'Vollkorn', 'Voltaire' => 'Voltaire', 'Walter+Turncoat' => 'Walter Turncoat', 'Yanone+Kaffeesatz' => 'Yanone Kaffeesatz', );
/* Websafe Fonts */


/* FONT SIZES */
global $fontsizes;
Expand Down Expand Up @@ -611,7 +612,7 @@ function jbst_typography_customizer_options($wp_customize) {

/* Heading Font Family */
$wp_customize->add_setting( 'heading_font_family', array(
'default' => 'Helvetica Neue',
'default' => heading_font_family,
) );

$wp_customize->add_control( 'heading_font_family', array(
Expand Down
2 changes: 1 addition & 1 deletion library/assets/css/wpless2css.css

Large diffs are not rendered by default.

130 changes: 0 additions & 130 deletions library/assets/google-fonts-array.php

This file was deleted.

14 changes: 11 additions & 3 deletions library/core.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
global $optionscheck;
$optionscheck = 0;

/* set fonts */

global $webfonts,$fontchoices;
$webfonts = apply_filters('jbst_set_webfonts',array('Helvetica Neue' => 'Helvetica Neue', 'Arial' => 'Arial', 'Lucida Bright' => 'Lucida Bright','Georgia' => 'Georgia', 'Times New Roman' => 'Times New Roman'));
$fontchoices = array_merge($webfonts,array(/* Google Fonts */ 'Abel' => 'Abel', 'Amaranth' => 'Amaranth', 'Amatic+SC' => 'Amatic SC', 'Anonymous+Pro' => 'Anonymous Pro', 'Anton' => 'Anton', 'Architects+Daughter' => 'Architects Daughter', 'Arimo' => 'Arimo', 'Arvo' => 'Arvo', 'Asap' => 'Asap', 'Bitter' => 'Bitter', 'Black+Ops+One' => 'Black Ops One', 'Bree+Serif' => 'Bree Serif', 'Cabin' => 'Cabin', 'Cabin+Condensed' => 'Cabin Condensed', 'Calligraffitti' => 'Calligraffitti', 'Cantarell' => 'Cantarell', 'Changa+One' => 'Changa One', 'Cherry+Cream+Soda' => 'Cherry Cream Soda', 'Chewy' => 'Chewy', 'Chivo' => 'Chivo', 'Coming Soon' => 'Coming Soon', 'Copse' => 'Copse', 'Covered+By+Your+Grace' => 'Covered By Your Grace', 'Crafty+Girls' => 'Crafty Girls', 'Crimson+Text' => 'Crimson Text', 'Crushed' => 'Crushed', 'Cuprum' => 'Cuprum', 'Dancing+Script' => 'Dancing Script', 'Dosis' => 'Dosis', 'Droid+Sans' => 'Droid Sans', 'Droid+Sans+Mono' => 'Droid Sans Mono', 'Droid+Serif' => 'Droid Serif', 'Exo' => 'Exo', 'Francois+One' => 'Francois One', 'Fredoka+One' => 'Fredoka One', 'Gloria+Hallelujah' => 'Gloria Hallelujah', 'Goudy+Bookletter+1911' => 'Goudy Bookletter 1911', 'Happy+Monkey' => 'Happy Monkey', 'Homemade+Apple' => 'Homemade Apple', 'Istok+Web' => 'Istok Web', 'Josefin+Sans' => 'Josephin Sans', 'Josefin+Slab' => 'Josefin Slab', 'Judson' => 'Judson', 'Just+Me+Again+Down+Here' => 'Just Me Again Down Here', 'Kreon' => 'Kreon', 'Lora' => 'Lora', 'Lato' => 'Lato', 'Limelight' => 'Limelight', 'Lobster' => 'Lobster', 'Luckiest+Guy' => 'Luckiest Guy', 'Marvel' => 'Marvel', 'Maven+Pro' => 'Maven Pro', 'Merriweather' => 'Merriweather', 'Metamorphous' => 'Metamorphous', 'Molengo' => 'Molengo', 'Muli' => 'Muli', 'News+Cycle' => 'News Cycle', 'Nobile' => 'Nobile', 'Nothing+You+Could+Do' => 'Nothing You Could Do', 'Nunito' => 'Nunito', 'Open+Sans' => 'Open Sans', 'Open+Sans' => 'Open Sans', 'Oswald' => 'Oswald', 'Pacifico' => 'Pacifico', 'Paytone+One' => 'Paytone One', 'Permanent+Marker' => 'Permanent Marker', 'Philosopher' => 'Philosopher', 'Play' => 'Play', 'Pontano+Sans' => 'Pontano Sans', 'PT+Sans' => 'PT Sans', 'PT+Sans+Narrow' => 'PT Sans Narrow', 'PT+Sans+Caption' => 'PT Sans Caption', 'PT+Serif' => 'PT Serif', 'Questrial' => 'Questrial', 'Quicksand' => 'Quicksand', 'Raleway' => 'Raleway', 'Reenie+Beanie' => 'Reenie Beanie', 'Righteous' => 'Righteous', 'Rock+Salt' => 'Rock Salt', 'Rokkitt' => 'Rokkitt', 'Shadows+Into+Light' => 'Shadows Into Light', 'Signika' => 'Signika', 'Source+Sans+Pro' => 'Source Sans Pro', 'Squada+One' => 'Squada One', 'Sunshiney' => 'Sunshiney', 'Syncopate' => 'Syncopate', 'Tangerine' => 'Tangerine', 'The+Girl+Next+Door' => 'The Girl Next Door', 'Ubuntu' => 'Ubuntu', 'Ubuntu+Condensed' => 'Ubuntu Condensed', 'Unkempt' => 'Unkempt', 'Vollkorn' => 'Vollkorn', 'Voltaire' => 'Voltaire', 'Walter+Turncoat' => 'Walter Turncoat', 'Yanone+Kaffeesatz' => 'Yanone Kaffeesatz'));

/*
==========================================================
SET DEFAULT SETTINGS
Expand Down Expand Up @@ -55,6 +61,8 @@ function jbst_default_settings()

/* */
if(!defined('container_width'))define('container_width','1200');

if(!defined('heading_font_family'))define('heading_font_family','Helvetica Neue');
}


Expand Down Expand Up @@ -226,11 +234,11 @@ function jbst_comments_js() {
add_action('jbst_head', 'jbst_add_google_fonts', 5);
function jbst_add_google_fonts() {
$googlefonts = false;
$webfonts = array('Helvetica Neue','Georgia','Lucida Bright','Arial','Times New Roman');
global $webfonts;

$logofont = get_theme_mod('logo_font_family', 'Helvetica Neue');
$bodyfont = get_theme_mod('body_font_family', 'Helvetica Neue');
$headingfont = get_theme_mod('heading_font_family', 'Helvetica Neue');
$headingfont = get_theme_mod('heading_font_family', heading_font_family);
$navbarfont = get_theme_mod('navbar_font_family', 'Helvetica Neue');

if (!in_array($logofont, $webfonts)) {$googlefonts .= $logofont.'|';}
Expand All @@ -252,7 +260,7 @@ function jbst_add_google_fonts() {
function jbst_typography() {
echo 'a.navbar-brand {font-family:"'.str_replace("+", " ", get_theme_mod('logo_font_family', 'Helvetica Neue')).'","Helvetica Neue",sans-serif;}';
echo 'body {font-family:"'.str_replace("+", " ", get_theme_mod('body_font_family', 'Helvetica Neue')).'","Helvetica Neue",sans-serif;}';
echo 'h1,h2,h3 {font-family:"'.str_replace("+", " ", get_theme_mod('heading_font_family', 'Helvetica Neue')).'","Helvetica Neue",sans-serif;}';
echo 'h1,h2,h3 {font-family:"'.str_replace("+", " ", get_theme_mod('heading_font_family', heading_font_family)).'","Helvetica Neue",sans-serif;}';
echo '.navbar-inner {font-family:"'.str_replace("+", " ", get_theme_mod('navbar_font_family', 'Helvetica Neue')).'","Helvetica Neue",sans-serif;}';

}
Expand Down
12 changes: 6 additions & 6 deletions wpless2css/jbstmixins.less
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
.include-custom-font(@family: arial, @path: @custom-font-dir, @weight: normal, @style: normal){
.include-custom-font(@family: arial,@font-path, @path: @custom-font-dir, @weight: normal, @style: normal){
@font-face{
font-family: @family;
src:url('@{path}/@{family}.eot');
src:url('@{path}/@{family}.eot?#iefix') format('embedded-opentype'),
url('@{path}/@{family}.woff') format('woff'),
url('@{path}/@{family}.ttf') format('truetype'),
url('@{path}/@{family}.svg#icon') format('svg');
src:url('@{path}@{font-path}.eot');
src:url('@{path}@{font-path}.eot?#iefix') format('embedded-opentype'),
url('@{path}@{font-path}.woff') format('woff'),
url('@{path}@{font-path}.ttf') format('truetype'),
url('@{path}@{font-path}.svg#icon') format('svg');
font-weight: @weight;
font-style: @style;
}
Expand Down

0 comments on commit c9b4d4d

Please sign in to comment.