commit
e27e87aeef
7
fonts.js
7
fonts.js
@ -1329,7 +1329,7 @@ var Font = (function Font() {
|
||||
|
||||
// Character to glyphs mapping
|
||||
'cmap': createCMapTable(charstrings.slice(),
|
||||
('glyphIds' in font) ? font.glyphIds: null),
|
||||
('glyphIds' in font) ? font.glyphIds : null),
|
||||
|
||||
// Font header
|
||||
'head': (function fontFieldsHead() {
|
||||
@ -2613,14 +2613,13 @@ var Type2CFF = (function type2CFF() {
|
||||
var glyph = charsets[i];
|
||||
var code = glyphMap[glyph] || 0;
|
||||
|
||||
var mapping = glyphs[code] || glyphs[glyph] || {};
|
||||
var mapping = glyphs[code] || glyphs[glyph] || { width: defaultWidth };
|
||||
var unicode = mapping.unicode;
|
||||
|
||||
if (unicode <= 0x1f || (unicode >= 127 && unicode <= 255))
|
||||
unicode += kCmapGlyphOffset;
|
||||
|
||||
var width = ('width' in mapping) && isNum(mapping.width) ? mapping.width
|
||||
: defaultWidth;
|
||||
var width = isNum(mapping.width) ? mapping.width : defaultWidth;
|
||||
properties.encoding[code] = {
|
||||
unicode: unicode,
|
||||
width: width
|
||||
|
@ -8,6 +8,10 @@ body {
|
||||
padding: 0px;
|
||||
}
|
||||
|
||||
[hidden] {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* === Toolbar === */
|
||||
#controls {
|
||||
background-color: #eee;
|
||||
|
@ -82,7 +82,7 @@
|
||||
<div id="sidebarScrollView">
|
||||
<div id="sidebarView"></div>
|
||||
</div>
|
||||
<div id="outlineScrollView" style="display:none">
|
||||
<div id="outlineScrollView" hidden='true'>
|
||||
<div id="outlineView"></div>
|
||||
</div>
|
||||
<div id="sidebarControls">
|
||||
|
@ -186,7 +186,7 @@ var PDFView = {
|
||||
|
||||
load: function pdfViewLoad(data, scale) {
|
||||
var loadingIndicator = document.getElementById('loading');
|
||||
loadingIndicator.style.display = 'none';
|
||||
loadingIndicator.setAttribute('hidden', 'true');
|
||||
|
||||
var sidebar = document.getElementById('sidebarView');
|
||||
sidebar.parentNode.scrollTop = 0;
|
||||
@ -282,14 +282,14 @@ var PDFView = {
|
||||
var outlineSwitchButton = document.getElementById('outlineSwitch');
|
||||
switch (view) {
|
||||
case 'thumbs':
|
||||
thumbsScrollView.style.display = 'block';
|
||||
outlineScrollView.style.display = 'none';
|
||||
thumbsScrollView.removeAttribute('hidden');
|
||||
outlineScrollView.setAttribute('hidden', 'true');
|
||||
thumbsSwitchButton.setAttribute('data-selected', true);
|
||||
outlineSwitchButton.removeAttribute('data-selected');
|
||||
break;
|
||||
case 'outline':
|
||||
thumbsScrollView.style.display = 'none';
|
||||
outlineScrollView.style.display = 'block';
|
||||
thumbsScrollView.setAttribute('hidden', 'true');
|
||||
outlineScrollView.removeAttribute('hidden');
|
||||
thumbsSwitchButton.removeAttribute('data-selected');
|
||||
outlineSwitchButton.setAttribute('data-selected', true);
|
||||
break;
|
||||
@ -592,7 +592,7 @@ window.addEventListener('load', function webViewerLoad(evt) {
|
||||
PDFView.open(params.file || kDefaultURL, parseFloat(scale));
|
||||
|
||||
if (!window.File || !window.FileReader || !window.FileList || !window.Blob)
|
||||
document.getElementById('fileInput').style.display = 'none';
|
||||
document.getElementById('fileInput').setAttribute('hidden', 'true');
|
||||
else
|
||||
document.getElementById('fileInput').value = null;
|
||||
}, true);
|
||||
@ -677,7 +677,7 @@ window.addEventListener('change', function webViewerChange(evt) {
|
||||
document.title = file.name;
|
||||
|
||||
// URL does not reflect proper document location - hiding bookmark icon.
|
||||
document.getElementById('viewBookmark').style.display = 'none';
|
||||
document.getElementById('viewBookmark').setAttribute('hidden', 'true');
|
||||
}, true);
|
||||
|
||||
window.addEventListener('transitionend', function webViewerTransitionend(evt) {
|
||||
|
Loading…
Reference in New Issue
Block a user