+ Post New Thread
Results 1 to 3 of 3
Web Development Thread, Double Google Fonts in Moodle in Coding and Web Development; Evening People, We've found a way of embedding Google fonts in our Moodle 1.9.7 courses through the use of a ...
  1. #1

    garethedmondson's Avatar
    Join Date
    Oct 2008
    Location
    Gowerton, Swansea
    Posts
    2,309
    Thank Post
    973
    Thanked 326 Times in 194 Posts
    Blog Entries
    11
    Rep Power
    170

    Double Google Fonts in Moodle

    Evening People,

    We've found a way of embedding Google fonts in our Moodle 1.9.7 courses through the use of a bit of javascript (taken from the Google fonts site) and some iinline stylesheet codes.

    I"m wondering if anyone has found a way of embedding two Google fonts in a web page using the Javascript files?

    Here is the first one we use:

    <script type="text/javascript">
    WebFontConfig = {
    google: { families: [ 'Open+Sans:300italic,400italic,600italic,700italic ,800italic,400,700,300,600,800:latin' ] }
    };
    (function() {
    var wf = document.createElement('script');
    wf.src = ('https:' == document.location.protocol ? 'https' : 'http') +
    '://ajax.googleapis.com/ajax/libs/webfont/1/webfont.js';
    wf.type = 'text/javascript';
    wf.async = 'true';
    var s = document.getElementsByTagName('script')[0];
    s.parentNode.insertBefore(wf, s);
    })(); </script>
    This is followed by the following codes:

    <style>
    p {font-family: 'Open Sans', serif;
    font-size: 20px;

    a {font-family: 'Open Sans', serif;
    font-size: 20px;

    li.liststyle { font-family: 'Open Sans', serif;
    font-size: 20px;
    }
    </style>
    Our next step is to find if we can use two different fonts. Alas I cannot find a way of doing it and wondered if anyone has seen a way?

    Many thanks

    Gareth

  2. #2

    TechMonkey's Avatar
    Join Date
    Dec 2005
    Location
    South East
    Posts
    3,336
    Thank Post
    227
    Thanked 433 Times in 315 Posts
    Rep Power
    172
    Change the google line to add the other font you would like seperated by a comma eg:
    google: { families: [ Open+Sans:300italic,400italic,600italic,700italic ,800italic,400,700,300,600,800:latin', 'Eater::latin' ] }

  3. Thanks to TechMonkey from:

    garethedmondson (14th June 2012)

  4. #3

    garethedmondson's Avatar
    Join Date
    Oct 2008
    Location
    Gowerton, Swansea
    Posts
    2,309
    Thank Post
    973
    Thanked 326 Times in 194 Posts
    Blog Entries
    11
    Rep Power
    170
    Hi @TechMonkey,

    Thanks for that - managed to work it out last night. Great idea from Google and it works on an LEA controlled Moodle where we have no access to the backend/installation of stylesheets.

    Gareth



SHARE:
+ Post New Thread

Similar Threads

  1. Fonts in Outlook 2003
    By FN-GM in forum Educational Software
    Replies: 3
    Last Post: 3rd April 2008, 06:12 PM
  2. Missing fonts in Publisher 2003
    By Kyle in forum Windows
    Replies: 1
    Last Post: 17th October 2007, 11:05 AM
  3. Testing in moodle.
    By Quackers in forum Virtual Learning Platforms
    Replies: 7
    Last Post: 4th October 2006, 05:25 PM
  4. help with centre section in moodle
    By beeswax in forum Virtual Learning Platforms
    Replies: 11
    Last Post: 3rd May 2006, 07:44 PM
  5. Replies: 5
    Last Post: 14th November 2005, 01:24 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •