mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-20 23:28:06 +02:00
Move the disableFontFace
option from the global PDFJS
object and into getDocument
instead
This commit is contained in:
parent
f3900c4e57
commit
c7c583583b
5 changed files with 19 additions and 17 deletions
|
@ -210,10 +210,10 @@ let PDFViewerApplication = {
|
|||
PDFJS.disableAutoFetch = value;
|
||||
}),
|
||||
preferences.get('disableFontFace').then(function resolved(value) {
|
||||
if (PDFJS.disableFontFace === true) {
|
||||
if (AppOptions.get('disableFontFace') === true) {
|
||||
return;
|
||||
}
|
||||
PDFJS.disableFontFace = value;
|
||||
AppOptions.set('disableFontFace', value);
|
||||
}),
|
||||
preferences.get('useOnlyCssZoom').then(function resolved(value) {
|
||||
AppOptions.set('useOnlyCssZoom', value);
|
||||
|
@ -269,7 +269,8 @@ let PDFViewerApplication = {
|
|||
PDFJS.disableAutoFetch = (hashParams['disableautofetch'] === 'true');
|
||||
}
|
||||
if ('disablefontface' in hashParams) {
|
||||
PDFJS.disableFontFace = (hashParams['disablefontface'] === 'true');
|
||||
AppOptions.set('disableFontFace',
|
||||
hashParams['disablefontface'] === 'true');
|
||||
}
|
||||
if ('disablehistory' in hashParams) {
|
||||
AppOptions.set('disableHistory',
|
||||
|
@ -1604,7 +1605,7 @@ function webViewerInitialized() {
|
|||
if (typeof PDFJSDev !== 'undefined' &&
|
||||
PDFJSDev.test('FIREFOX || MOZCENTRAL') &&
|
||||
!PDFViewerApplication.supportsDocumentFonts) {
|
||||
PDFJS.disableFontFace = true;
|
||||
AppOptions.set('disableFontFace', true);
|
||||
PDFViewerApplication.l10n.get('web_fonts_disabled', null,
|
||||
'Web fonts are disabled: unable to use embedded PDF fonts.').
|
||||
then((msg) => {
|
||||
|
|
|
@ -139,6 +139,11 @@ const defaultOptions = {
|
|||
'../external/bcmaps/' : '../web/cmaps/'),
|
||||
kind: OptionKind.API,
|
||||
},
|
||||
disableFontFace: {
|
||||
/** @type {boolean} */
|
||||
value: false,
|
||||
kind: OptionKind.API,
|
||||
},
|
||||
isEvalSupported: {
|
||||
/** @type {boolean} */
|
||||
value: true,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue