From adb2bb5af89ab289b4484d87e99b2b483fb34aea Mon Sep 17 00:00:00 2001 From: Calixte Denizet Date: Thu, 23 May 2024 22:22:29 +0200 Subject: [PATCH] [GeckoView] Don't use the system fonts (bug 1882613) On Android there's almost no chance we find a substitution font so just use one of the font embedded in pdf.js. --- web/app.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/web/app.js b/web/app.js index e91829797aab3..9d10550845e91 100644 --- a/web/app.js +++ b/web/app.js @@ -1004,6 +1004,16 @@ const PDFViewerApplication = { AppOptions.set("docBaseUrl", this.baseUrl); } + // On Android, there is almost no chance to have the font we want so we + // don't use the system fonts in this case. + if ( + typeof PDFJSDev === "undefined" + ? window.isGECKOVIEW + : PDFJSDev.test("GECKOVIEW") + ) { + args.useSystemFonts = false; + } + // Set the necessary API parameters, using all the available options. const apiParams = AppOptions.getAll(OptionKind.API); const loadingTask = getDocument({