ansilove.js

A script to display ANSi and artscene related file formats on web pages
Log | Files | Refs | README | LICENSE

commit a93f9cd119dede1ccb30209e1812c387dfed6d1c
parent 68cb84eb499ac02081694b881c6a37797cb435d4
Author: Andy Herbert <andy.herbert@gmail.com>
Date:   Mon, 28 Oct 2013 19:19:09 +0000

Removed part of previous commit due to bug.

Diffstat:
Mansilove.js | 13++++---------
1 file changed, 4 insertions(+), 9 deletions(-)

diff --git a/ansilove.js b/ansilove.js @@ -123,7 +123,7 @@ var AnsiLove = (function () { } Font = (function () { - var FONT_PRESETS, FONT_PRESET_NAMES, presetBuffer; + var FONT_PRESETS, FONT_PRESET_NAMES; FONT_PRESETS = { "b-strict": { @@ -240,8 +240,6 @@ var AnsiLove = (function () { } }; - presetBuffer = {}; - (function () { var name; FONT_PRESET_NAMES = []; @@ -353,12 +351,9 @@ var AnsiLove = (function () { if (!FONT_PRESETS.hasOwnProperty(name)) { return undefined; } - if (!presetBuffer[name]) { - file = new File(base64ToBin(FONT_PRESETS[name].data)); - fontWidth = file.get(); - presetBuffer[name] = read(file, fontWidth, (file.size - 1) / 256 * 8 / fontWidth, 256, FONT_PRESETS[name].amigaFont); - } - return presetBuffer[name]; + file = new File(base64ToBin(FONT_PRESETS[name].data)); + fontWidth = file.get(); + return read(file, fontWidth, (file.size - 1) / 256 * 8 / fontWidth, 256, FONT_PRESETS[name].amigaFont); } function xbin(file, fontHeight, char512) {