Add a parser for woff fonts

It's a bit of a hack to have a parser dedicated to fonts. We'll replace
it with a mechanism that handles generic binary data
print-window-tiddler
Jeremy Ruston 2013-05-01 13:04:27 +01:00
rodzic b672e12fef
commit 408fcd8aa3
2 zmienionych plików z 29 dodań i 0 usunięć

Wyświetl plik

@ -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

Wyświetl plik

@ -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;
})();