Uutiset:

Wondering if this will always be free?  See why free is better.

Main Menu
Advertisement:

Using Google Font API in index.template.php

Aloittaja Nolt, elokuu 22, 2011, 11:39:07 AP

« edellinen - seuraava »

Nolt

Hi,

I just wondering where to add Google Font API in index.template.php if I want use a different font in theme.
I put an example where I put it, could anyone tell me if it good place or I should put it somewhere else?

// Show right to left and the character set for ease of translating.
    echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"', $context['right_to_left'] ? ' dir="rtl"' : '', '>
<head>';

   //my_desired_font
     echo'<style>body { font-family: my_desired_font; }</style>
     <link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=my_desired_font:regular,italic,bold&subset=Latin">';


Of course I've added "my_desired_font" into CSS:
/* Set a fontsize that will look the same in all browsers. */
body
{
    background: #FFF url(../images/theme/backdrop.png);
    font: 80%/130% 'my_desired_font', "Verdana", "Arial", "Helvetica", sans-serif;
    margin: 0 auto;
    padding: 15px 0;
}


Ricky.

Well, its fine to put it over there and CSS properties are expected to be placed on top always !

Advertisement: