clean up string conversion functions
This commit is contained in:
parent
5fc806823e
commit
c978c026fa
4 changed files with 47 additions and 68 deletions
|
@ -14,7 +14,8 @@
|
|||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
/* globals PDFJS, shadow, isWorker, assert, warn, bytesToString, globalScope */
|
||||
/* globals PDFJS, shadow, isWorker, assert, warn, bytesToString, string32,
|
||||
globalScope */
|
||||
|
||||
'use strict';
|
||||
|
||||
|
@ -163,13 +164,6 @@ var FontLoader = {
|
|||
(data.charCodeAt(offset + 3) & 0xff);
|
||||
}
|
||||
|
||||
function string32(value) {
|
||||
return String.fromCharCode((value >> 24) & 0xff) +
|
||||
String.fromCharCode((value >> 16) & 0xff) +
|
||||
String.fromCharCode((value >> 8) & 0xff) +
|
||||
String.fromCharCode(value & 0xff);
|
||||
}
|
||||
|
||||
function spliceString(s, offset, remove, insert) {
|
||||
var chunk1 = data.substr(0, offset);
|
||||
var chunk2 = data.substr(offset + remove);
|
||||
|
@ -297,7 +291,7 @@ var FontFace = (function FontFaceClosure() {
|
|||
return null;
|
||||
}
|
||||
|
||||
var data = bytesToString(this.data);
|
||||
var data = bytesToString(new Uint8Array(this.data));
|
||||
var fontName = this.loadedName;
|
||||
|
||||
// Add the font-face rule to the document
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue