Reduce size of HTML export zip
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Mahara |
Won't Fix
|
Low
|
Unassigned |
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:/
We should see if we could make that happen with our export code, in order to reduce the size of the export.
tags: | added: html |
Changed in mahara: | |
status: | Confirmed → Won't Fix |
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 { /fonts/ opensans/ OpenSansLightIt alic.eot" ) format( "embedded- opentype" ), url(".. /fonts/ opensans/ OpenSansLightIt alic.woff2" ) format("woff2"), url(".. /fonts/ opensans/ OpenSansLightIt alic.woff" ) format("woff"), url(".. /fonts/ opensans/ OpenSansLightIt alic.ttf" ) format("truetype"), url(".. /fonts/ opensans/ OpenSansLightIt alic.svg# OpenSansLightIt alic") format("svg");
font-family: "Open Sans";
font-style: italic;
font-weight: 300;
src: url("..
}
we would find out the font-family, font-style, and font-weight so we can make a /fonts. googleapis. com/css? family= Open+Sans: i300' rel='stylesheet' type='text/css'>
<link href='https:/
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