mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-29 07:37:57 +02:00
Fix warnings in strict mode
This commit is contained in:
parent
2c6935f868
commit
674d6a7d18
4 changed files with 25 additions and 10 deletions
14
fonts.js
14
fonts.js
|
@ -710,7 +710,13 @@ var Font = (function Font() {
|
|||
};
|
||||
|
||||
function createOS2Table(properties, override) {
|
||||
var override = override || {};
|
||||
override = override || {
|
||||
unitsPerEm: 0,
|
||||
yMax: 0,
|
||||
yMin: 0,
|
||||
ascent: 0,
|
||||
descent: 0
|
||||
};
|
||||
|
||||
var ulUnicodeRange1 = 0;
|
||||
var ulUnicodeRange2 = 0;
|
||||
|
@ -1322,7 +1328,8 @@ var Font = (function Font() {
|
|||
'OS/2': stringToArray(createOS2Table(properties)),
|
||||
|
||||
// Character to glyphs mapping
|
||||
'cmap': createCMapTable(charstrings.slice(), font.glyphIds),
|
||||
'cmap': createCMapTable(charstrings.slice(),
|
||||
('glyphIds' in font) ? font.glyphIds: null),
|
||||
|
||||
// Font header
|
||||
'head': (function fontFieldsHead() {
|
||||
|
@ -2612,7 +2619,8 @@ var Type2CFF = (function type2CFF() {
|
|||
if (unicode <= 0x1f || (unicode >= 127 && unicode <= 255))
|
||||
unicode += kCmapGlyphOffset;
|
||||
|
||||
var width = isNum(mapping.width) ? mapping.width : defaultWidth;
|
||||
var width = ('width' in mapping) && isNum(mapping.width) ? mapping.width
|
||||
: defaultWidth;
|
||||
properties.encoding[code] = {
|
||||
unicode: unicode,
|
||||
width: width
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue