0
Welcome Guest! Login
0 items Join Now

ROCKETTHEME IS CLOSING ON JUNE 30, 2025. As a thank-you to our community, enjoy 50% off all themes with the promo code THANKYOU before we shut down. Read our Farewell Blog Post for more details.

Google font subset (script) selection

    • DenisBz's Avatar
    • DenisBz
    • Jr. Rocketeer
    • Posts: 31
    • Thanks: 0

    Google font subset (script) selection

    Posted 11 years 1 month ago
    • Please add Google Font subset selection, named 'script' on Google Fonts site. Currently Latin script is used by default and hardcoded in Gantry files (on Joomla it is /libraries/gantry/features/font.php). To choose another font script I change the code to llok like below, but with every Gantry update it is lost. Would be great to see it in settings in the backend. Thanks.
      	function _addGoogleFont($name, $variant)
      	{
      		/** @var $gantry Gantry */
      		global $gantry;
      
      		$variant = $variant ? $variant : '';
      
      		$protocol = JUri::getInstance()->isSSL() ? 'https' : 'http';
      		$gantry->addStyle("{$protocol}://fonts.googleapis.com/css?family=" . str_replace(" ", "+", $name) . $variant . "&subset=cyrillic-ext,latin,latin-ext,cyrillic");
      		$gantry->addInlineStyle("h1, h2 { font-family: '" . $name . "', 'Helvetica', arial, serif; }");
      	}
    • Last Edit: 11 years 1 month ago by DenisBz.
    • Henning's Avatar
    • Henning
    • Preeminent Rocketeer
    • Posts: 29363
    • Thanks: 957
    • Volunteer

    Re: Google font subset (script) selection

    Posted 11 years 1 month ago
    • Just copy
      /libraries/gantry/features/font.php
      into the features folder of the template.

      Change the code for your needs.
      You won't loose that file when you update Gantry ot the template.


      Not really hardcoded ... in fact Gantry is "overridable" in many aspects ... and pretty flexible.
      You can see the font.php just as an exmaple how a feature-concept in Gantry works.
      It's a "real" framework ...
    • Last Edit: 11 years 1 month ago by Henning.
    • DenisBz's Avatar
    • DenisBz
    • Jr. Rocketeer
    • Posts: 31
    • Thanks: 0

    Re: Google font subset (script) selection

    Posted 11 years 1 month ago
    • Great, thank you for a quick response!
    • Yulya's Avatar
    • Yulya
    • Newbie
    • Posts: 6
    • Thanks: 0

    Re: Google font subset (script) selection

    Posted 10 years 6 months ago
    • hi, where is that file in WP?
      i have the same problem.
    • Henning's Avatar
    • Henning
    • Preeminent Rocketeer
    • Posts: 29363
    • Thanks: 957
    • Volunteer

    Re: Google font subset (script) selection

    Posted 10 years 6 months ago

Time to create page: 0.081 seconds