← Back to team overview

mahara-contributors team mailing list archive

[Bug 1518832] Re: Reduce size of HTML export zip

 

The fonts that are used form this directory are included in the css via
the @font-face option.

On the export we could find the places this occurs and then find out
exactly which fonts we need to include via <link> tags in the header of
the export html.

So for example this code in the raw theme css

@font-face {
    font-family: "Open Sans";
    font-style: italic;
    font-weight: 300;
    src: url("../fonts/opensans/OpenSansLightItalic.eot") format("embedded-opentype"), url("../fonts/opensans/OpenSansLightItalic.woff2") format("woff2"), url("../fonts/opensans/OpenSansLightItalic.woff") format("woff"), url("../fonts/opensans/OpenSansLightItalic.ttf") format("truetype"), url("../fonts/opensans/OpenSansLightItalic.svg#OpenSansLightItalic") format("svg");
}

we would find out the font-family, font-style, and font-weight so we can make a 
<link href='https://fonts.googleapis.com/css?family=Open+Sans:i300' rel='stylesheet' type='text/css'>

To fetch the correct font

It would be worth doing a check of what the google api returns so that
if google doesn't know about the font we still include the local one in
the zip

-- 
You received this bug notification because you are a member of Mahara
Contributors, which is subscribed to Mahara.
Matching subscriptions: Subscription for all Mahara Contributors -- please ask on #mahara-dev or mahara.org forum before editing or unsubscribing it!
https://bugs.launchpad.net/bugs/1518832

Title:
  Reduce size of HTML export zip

Status in Mahara:
  Confirmed

Bug description:
  With Bug 1515826 we're now including all the theme assets for a page,
  in its HTML export file.

  Unfortunately, this bumps the unzipped web archive contents up over
  8MB. Which isn't a whole lot in the scheme of things I suppose, but
  before we did this, it was about 500kB. The main culprit is the
  raw/static/fonts directory included in the export, which is 8MB on its
  own. The opensans folder alone is about 6MB.

  The typical use-case for these fonts is for people to include them
  with a rel link to a remote server, like this: <link
  href='https://fonts.googleapis.com/css?family=Open+Sans'
  rel='stylesheet' type='text/css'>

  We should see if we could make that happen with our export code, in
  order to reduce the size of the export.

To manage notifications about this bug go to:
https://bugs.launchpad.net/mahara/+bug/1518832/+subscriptions


References