Merge pull request #683 from vingtetun/master

Fix issue #681
This commit is contained in:
notmasteryet 2011-10-18 18:05:57 -07:00
commit e27e87aeef
4 changed files with 15 additions and 12 deletions

View File

@ -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

View File

@ -8,6 +8,10 @@ body {
padding: 0px;
}
[hidden] {
display: none;
}
/* === Toolbar === */
#controls {
background-color: #eee;

View File

@ -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">

View File

@ -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) {