diff --git a/boot/boot.js b/boot/boot.js index a9c23be5f..6d38e55fd 100644 --- a/boot/boot.js +++ b/boot/boot.js @@ -1235,6 +1235,7 @@ $tw.boot.startup = function() { $tw.utils.registerFileType("image/png","base64",".png"); $tw.utils.registerFileType("image/gif","base64",".gif"); $tw.utils.registerFileType("image/svg+xml","utf8",".svg"); + $tw.utils.registerFileType("application/font-woff","base64",".woff"); // Create the wiki store for the app $tw.wiki = new $tw.Wiki(); // Install built in tiddler fields modules diff --git a/core/modules/parsers/fontparser.js b/core/modules/parsers/fontparser.js new file mode 100644 index 000000000..e8597debd --- /dev/null +++ b/core/modules/parsers/fontparser.js @@ -0,0 +1,28 @@ +/*\ +title: $:/core/modules/parsers/fontparser.js +type: application/javascript +module-type: parser + +The font parser parses fonts into URI encoded base64 + +\*/ +(function(){ + +/*jslint node: true, browser: true */ +/*global $tw: false */ +"use strict"; + +var FontParser = function(type,text,options) { + this.tree = [{ + type: "element", + tag: "span", + children: [ + {type: "text", text: "data:" + type + ";base64," + text} + ] + }]; +}; + +exports["application/font-woff"] = FontParser; + +})(); +