Newsmag 3.1 – changing default font stack

Posted in: Newsmag
Post count: 9544

Hi, folks
I’m “re-tuning” the NM 3.1 – having moved from v2 (finally!). Working great with the beta TD Composer so far, but barely touched that.

I’m looking to completely remove these loading from theme:

http://fonts.googleapis.com/css?family=Open+Sans%3A300%2C400%2C600%2C700&ver=4.6
http://fonts.googleapis.com/css?family=Roboto%3A400%2C300%2C700%2C700italic%2C400italic%2C300italic&ver=4.6

and instead use the new default font stack used by WordPress 4.6x in place of Open Sans.

This new font stack is a little better than the one I have been using (noted in my epic optimization tutorial thread near the end) as it is tuned for modern mobile devices much better than my desktop focused version:

font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;

(REF: https://make.wordpress.org/core/2016/07/07/native-fonts-in-4-6/ )

This would make a nice “default” setup for Newsmag, “unless Google fonts chosen,” vs default having Google fonts chosen.

In any case, if you can help me out by pointing me at the correct files to tweak to make this change would be awesome. Things have moved around a bit, so the old search/replace in style.css not quite same method now 🙂

I have no problem hacking a core file to remove Google font calls, as I’m prepared to do that each theme update for my other tweaks.

THANKS!

Post count: 9544

Okay…. was able to do good ol’ search/replace in style.css

now on hunt in classic /wp-booster/wp_booster_functions.php hack…

which looks like it’s around lines 270-304 …
forget which stuff to comment out here ….. Hmmmm……

=====
**/theme/style.css v3.1

<< do search/replace for ‘string’ using text editor like BBEdit, TextPad, etc.) >>

lines 352 + 866 + 962 + 1663 + 1752 + 1861 + 2608 + 5355 + 5388 + 5450 + 5691 + 5734 + 7303 + 7340 + 7565 + 7608 ((ETC.)),
replace: font-family: ‘Open Sans’, arial, sans-serif;

with modern font stack:
font-family: -apple-system, BlinkMacSystemFont, “Segoe UI”, Roboto, Oxygen-Sans, Ubuntu, Cantarell, “Helvetica Neue”, sans-serif;

lines 379 + 387 + 473 + 1968 + 2006 + 2118 + 2160 + 2301 + 2625 + 7500 ((ETC.)),
replace: font-family: ‘Roboto’, sans-serif;

font-family: -apple-system, BlinkMacSystemFont, “Segoe UI”, Roboto, Oxygen-Sans, Ubuntu, Cantarell, “Helvetica Neue”, sans-serif;

Post count: 9544

found it … // answered my own query 😉 //

**/theme/includes/td_config.php

/remove google font calls for defalt roboto and open sans

lines 3247-3259 — remove:

/**
* the default fonts used by the theme. For a list of fonts ids @see td_fonts::$font_names_google_list
*/
td_global::$default_google_fonts_list = array (
'438' => array(
'css_style_id' => 'google_font_open_sans',
'url' => td_global::$http_or_https . '://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700'
),
'522' => array(
'css_style_id' => 'google_font_roboto_cond',
'url' => td_global::$http_or_https . '://fonts.googleapis.com/css?family=Roboto:400,300,700,700italic,400italic,300italic'
),
);

Post count: 6535

Hi @Chris

We’re glad you have managed do sort this out.
Thanks for letting us know, for the message and for all your help here 🙂

Have a nice day!

Viewing 4 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic.