From 8e5a8fb49fb0faabc97ed5877a1df4bde3406dc0 Mon Sep 17 00:00:00 2001 From: Kalervo Kujala Date: Mon, 12 Sep 2011 20:37:33 +0300 Subject: [PATCH 1/2] Fix Mode comment lines. --- crypto.js | 2 +- fonts.js | 2 +- glyphlist.js | 2 +- metrics.js | 3 +++ test/driver.js | 2 +- utils/cffStandardStrings.js | 2 +- utils/fonts_utils.js | 2 +- web/compatibility.js | 2 +- web/viewer.js | 2 +- worker/canvas.js | 2 +- worker/client.js | 2 +- worker/console.js | 2 +- worker/font.js | 2 +- worker/pdf.js | 2 +- 14 files changed, 16 insertions(+), 13 deletions(-) diff --git a/crypto.js b/crypto.js index bfffa1f44..a91f9e41d 100644 --- a/crypto.js +++ b/crypto.js @@ -1,4 +1,4 @@ -/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- / +/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */ 'use strict'; diff --git a/fonts.js b/fonts.js index 3deb09825..d0d42a941 100755 --- a/fonts.js +++ b/fonts.js @@ -1,4 +1,4 @@ -/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- / +/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */ 'use strict'; diff --git a/glyphlist.js b/glyphlist.js index 9be0e8d5a..5691f8546 100644 --- a/glyphlist.js +++ b/glyphlist.js @@ -1,4 +1,4 @@ -/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- / +/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */ 'use strict'; diff --git a/metrics.js b/metrics.js index 973d9543a..9cb8eb0e6 100644 --- a/metrics.js +++ b/metrics.js @@ -1,3 +1,6 @@ +/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */ + var Metrics = { 'Courier': 600, 'Courier-Bold': 600, diff --git a/test/driver.js b/test/driver.js index 265de0852..f3e45a53d 100644 --- a/test/driver.js +++ b/test/driver.js @@ -1,4 +1,4 @@ -/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- / +/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */ /* diff --git a/utils/cffStandardStrings.js b/utils/cffStandardStrings.js index 09c408ee7..326f298b0 100644 --- a/utils/cffStandardStrings.js +++ b/utils/cffStandardStrings.js @@ -1,4 +1,4 @@ -/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- / +/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */ 'use strict'; diff --git a/utils/fonts_utils.js b/utils/fonts_utils.js index 7665906a1..4826a09a1 100644 --- a/utils/fonts_utils.js +++ b/utils/fonts_utils.js @@ -1,4 +1,4 @@ -/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- / +/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */ 'use strict'; diff --git a/web/compatibility.js b/web/compatibility.js index e9a769163..63ebecb63 100755 --- a/web/compatibility.js +++ b/web/compatibility.js @@ -1,4 +1,4 @@ -/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- / +/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */ // Checking if the typed arrays are supported diff --git a/web/viewer.js b/web/viewer.js index 5752cf84e..d7c9d6b66 100644 --- a/web/viewer.js +++ b/web/viewer.js @@ -1,4 +1,4 @@ -/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- / +/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */ 'use strict'; diff --git a/worker/canvas.js b/worker/canvas.js index c2a9f4763..5a9237d9a 100644 --- a/worker/canvas.js +++ b/worker/canvas.js @@ -1,4 +1,4 @@ -/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- / +/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */ 'use strict'; diff --git a/worker/client.js b/worker/client.js index a00eab59e..a20a4179f 100644 --- a/worker/client.js +++ b/worker/client.js @@ -1,4 +1,4 @@ -/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- / +/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */ 'use strict'; diff --git a/worker/console.js b/worker/console.js index 29f511407..fc49583a6 100644 --- a/worker/console.js +++ b/worker/console.js @@ -1,4 +1,4 @@ -/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- / +/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */ 'use strict'; diff --git a/worker/font.js b/worker/font.js index 32e22198c..549b73101 100644 --- a/worker/font.js +++ b/worker/font.js @@ -1,4 +1,4 @@ -/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- / +/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */ 'use strict'; diff --git a/worker/pdf.js b/worker/pdf.js index 0d5008d80..8cb6342db 100644 --- a/worker/pdf.js +++ b/worker/pdf.js @@ -1,4 +1,4 @@ -/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- / +/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */ 'use strict'; From b5412c13d88d376bb0c0d98a4fb6d8b9550782f6 Mon Sep 17 00:00:00 2001 From: Kalervo Kujala Date: Mon, 12 Sep 2011 20:42:55 +0300 Subject: [PATCH 2/2] Fix gjslint warnings. --- fonts.js | 7 ++++--- pdf.js | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/fonts.js b/fonts.js index d0d42a941..9ba1d876e 100755 --- a/fonts.js +++ b/fonts.js @@ -434,7 +434,7 @@ var Font = (function Font() { // Use 'name' instead of 'fontName' here because the original // name ArialBlack for example will be replaced by Helvetica. - this.black = (name.search(/Black/g) != -1) + this.black = (name.search(/Black/g) != -1); this.loadedName = fontName.split('-')[0]; this.loading = false; @@ -986,7 +986,7 @@ var Font = (function Font() { font.pos = (font.start ? font.start : 0) + header.offset; font.pos += header.length - 2; var numOfMetrics = int16(font.getBytes(2)); - + var numOfSidebearings = numGlyphs - numOfMetrics; var numMissing = numOfSidebearings - ((hmtx.length - numOfMetrics * 4) >> 1); @@ -1807,7 +1807,8 @@ var Type1Parser = function() { if ('undefined' == typeof(properties.differences[index])) { var mapping = properties.encoding[index] || {}; mapping.unicode = GlyphsUnicode[glyph] || index; - properties.glyphs[glyph] = properties.encoding[index] = mapping; + properties.glyphs[glyph] = properties.encoding[index] = + mapping; } getToken(); // read the in 'put' } diff --git a/pdf.js b/pdf.js index ccd90951d..939d9e21c 100644 --- a/pdf.js +++ b/pdf.js @@ -876,8 +876,8 @@ var JpegStream = (function() { function fixYcckImage(bytes) { // Inserting 'EMBED' marker after JPEG signature - var embedMarker = new Uint8Array([0xFF, 0xEC, 0, 8, - 0x45, 0x4D, 0x42, 0x45, 0x44, 0]); + var embedMarker = new Uint8Array([0xFF, 0xEC, 0, 8, 0x45, 0x4D, 0x42, 0x45, + 0x44, 0]); var newBytes = new Uint8Array(bytes.length + embedMarker.length); newBytes.set(bytes, embedMarker.length); // copy JPEG header