Skip to content

Commit

Permalink
[GeckoView] Don't use the system fonts (bug 1882613)
Browse files Browse the repository at this point in the history
On Android there's almost no chance we find a substitution font so
just use one of the font embedded in pdf.js.
  • Loading branch information
calixteman committed May 24, 2024
1 parent 1c3195b commit adb2bb5
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions web/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down

0 comments on commit adb2bb5

Please sign in to comment.