(function(window){
// 1) Do we have a mechanism for binding implicit get/set?
if(!Object.defineProperty) {
throw("Font.js requires Object.defineProperty, which this browser does not support.");
}
// 2) Do we have Canvas2D available?
if(!document.createElement("canvas").getContext) {
throw("Font.js requires <canvas> and the Canvas2D API, which this browser does not support.");
}
// Make sure type arrays are available in IE9
// Code borrowed from pdf.js (https://gist.github.com/1057924)
(function(window) {
try { var a = new Uint8Array(1); return; } catch (e) { }
function subarray(start, end) { return this.slice(start, end); }
function set_(array, offset) {
var i, n = array.length;
if (arguments.length < 2) { offset = 0; }
for (i = 0; i < n; ++i, ++offset) { this[offset] = array[i] & 0xFF; }}
function TypedArray(arg1) {
var result, i;
if (typeof arg1 === "number") {
result = new Array(arg1);
for (i = 0; i < arg1; ++i) { result[i] = 0; }
} else { result = arg1.slice(0); }
result.subarray = subarray;
result.buffer = result;
result.byteLength = result.length;
result.set = set_;
if (typeof arg1 === "object" && arg1.buffer) {
result.buffer = arg1.buffer; }
return result; }
window.Uint8Array = TypedArray;
window.Uint32Array = TypedArray;
window.Int32Array = TypedArray;
}(window));
// Also make sure XHR understands typing.
// Code based on pdf.js (https://gist.github.com/1057924)
(function(window) {
// shortcut for Opera - it's already fine
if(window.opera) return;
// shortcuts for browsers that already implement XHR minetyping
if ("response" in XMLHttpRequest.prototype ||
"mozResponseArrayBuffer" in XMLHttpRequest.prototype ||
"mozResponse" in XMLHttpRequest.prototype ||
"responseArrayBuffer" in XMLHttpRequest.prototype) { return; }
var getter;
// If we have access...
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Console
Debug your Fiddle with a minimal built-in JavaScript console.