0
Welcome Guest! Login
0 items Join Now

applying gantry fonts to the whole website

    • tonnick's Avatar
    • tonnick
    • Hero Rocketeer
    • Posts: 393
    • Thanks: 3

    applying gantry fonts to the whole website

    Posted 13 years 5 months ago
    • hello !

      I would like to use the gantry's option google font to apply it to my whole website. problem is that I cannot find the file to modify to explain for example that for any <p> I would like the google font.

      it's only for h1 and I would need to extand it to any other text.

      any idea would be a great help !

      thx

      fab.
    • tonnick's Avatar
    • tonnick
    • Hero Rocketeer
    • Posts: 393
    • Thanks: 3

    Re: applying gantry fonts to the whole website

    Posted 13 years 5 months ago
    • ok I found it !

      just had to modifiy in /components/com_gantry/features/webfonts.php this line :

      $gantry->addInlineStyle("h1, h2 { font-family: '".$font_family."', 'Helvetica', arial, serif; }");

      to

      $gantry->addInlineStyle("p, ........, h1, h2 { font-family: '".$font_family."', 'Helvetica', arial, serif; }");

      solved topic ! sorry :oops:
    • The following users have thanked you: AndrzejB, Julian Pardo

  • Re: applying gantry fonts to the whole website

    Posted 11 years 1 month ago
    • Thank you for addInlineStyle info.
      Meanwhile I realizaed this solution could be affected by gantry update. I added following lines of code to template index.php
      		$params = $gantry->getParams();
      		$gantry->addInlineStyle("body { font-family: '".substr($params['font-family']['value'], 2)."', arial, serif; }");

      after
      $gantry->init();

      and it worked for me

      The crazy substr() finction was necessary hence $params returned something like 'g:mychosenfont'.
      Hope that helps someone.
    • Last Edit: 11 years 1 month ago by AndrzejB.

Time to create page: 0.079 seconds