Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-46728

WOFF2 fonts are not supported in themes.

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide

      Using the Clean theme:

      1. Apply the patch.
      2. Place the file 'https://tracker.moodle.org/secure/attachment/42496/font-awesome-MDL-46728.css' in the 'theme/clean/style' folder.
      3. Create a new folder 'theme/clean/fonts' and place the files on it
        • 'https://tracker.moodle.org/secure/attachment/42493/fontawesome-webfont.woff2'
        • 'https://tracker.moodle.org/secure/attachment/42495/fontawesome-webfont.eot'
      4. In the 'theme/clean/config.php' file, add "$THEME->sheets[] = 'font-awesome-MDL-46728';" after "$THEME->sheets = array('custom');".
      5. Using a modern browser that supports the WOFF2 format, 'Chrome Version 40.0.2214.93 m' for example.
      6. Purge all caches.
      7. In a course (topic course format), create a label and with the editor (ATTO) in 'HTML' mode ('Show more buttons' button -> 'HTML' button), add the markup '<i class="fa fa-train"></i>FontAwesome 4.3.0 test.'.
      8. Save and return to the course.
      9. Observe that the label has a 'train' icon in front of the words 'FontAwesome 4.3.0 test.'.
      10. Press F12 to open the developer web tools and reload the page so that the 'fontawesome-webfont.woff2' file will be reported in the network tab. Confirm that the mime-type is 'fontawesome-webfont.woff2' as shown in the 'Response Headers' of the packet that delivered the file. Please see 'https://tracker.moodle.org/secure/attachment/42497/2015-01-29%2013_06_40-Course_%20Topics_MDL-46728.jpg'.
      11. Open up Internet Explorer 11 (11.0.9600.17501 used to test) which does not support WOFF2 files but instead EOT files. Go to the course and label you created and observe that the label has a 'train' icon in front of the words 'FontAwesome 4.3.0 test.'. This demonstrates that EOT files are served as before and the 'if' sequence is unharmed.
      Show
      Using the Clean theme: Apply the patch. Place the file 'https://tracker.moodle.org/secure/attachment/42496/font-awesome-MDL-46728.css' in the 'theme/clean/style' folder. Create a new folder 'theme/clean/fonts' and place the files on it 'https://tracker.moodle.org/secure/attachment/42493/fontawesome-webfont.woff2' 'https://tracker.moodle.org/secure/attachment/42495/fontawesome-webfont.eot' In the 'theme/clean/config.php' file, add "$THEME->sheets[] = 'font-awesome- MDL-46728 ';" after "$THEME->sheets = array('custom');". Using a modern browser that supports the WOFF2 format, 'Chrome Version 40.0.2214.93 m' for example. Purge all caches. In a course (topic course format), create a label and with the editor (ATTO) in 'HTML' mode ('Show more buttons' button -> 'HTML' button), add the markup '<i class="fa fa-train"></i>FontAwesome 4.3.0 test.'. Save and return to the course. Observe that the label has a 'train' icon in front of the words 'FontAwesome 4.3.0 test.'. Press F12 to open the developer web tools and reload the page so that the 'fontawesome-webfont.woff2' file will be reported in the network tab. Confirm that the mime-type is 'fontawesome-webfont.woff2' as shown in the 'Response Headers' of the packet that delivered the file. Please see 'https://tracker.moodle.org/secure/attachment/42497/2015-01-29%2013_06_40-Course_%20Topics_MDL-46728.jpg'. Open up Internet Explorer 11 (11.0.9600.17501 used to test) which does not support WOFF2 files but instead EOT files. Go to the course and label you created and observe that the label has a 'train' icon in front of the words 'FontAwesome 4.3.0 test.'. This demonstrates that EOT files are served as before and the 'if' sequence is unharmed.
    • Affected Branches:
      MOODLE_26_STABLE, MOODLE_27_STABLE, MOODLE_28_STABLE, MOODLE_29_STABLE
    • Fixed Branches:
      MOODLE_29_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      wip_MDL-46728_master

      Description

      Google has begun adding the woff2 fonts to their font libraries (depending on the user agent).

      http://www.w3.org/TR/WOFF2/

      The font.php file needs to be updated to allow the woff2 format. Chrome makes use of this font exclusively if available

      I added support for that here in my local moodle 26 branch: https://github.com/jhoopes/moodle/tree/MDL-46728-updatefonts

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              gb2048 Gareth J Barnard
              Reporter:
              jhoopes John Hoopes
              Peer reviewer:
              Dave Cooper
              Integrator:
              David Monllaó
              Tester:
              Jetha Chan
              Participants:
              Component watchers:
              Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias, Bas Brands
              Votes:
              7 Vote for this issue
              Watchers:
              11 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                11/May/15