From 78917bab91355c8907ca20c696cd4685e058dcbf Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Sun, 12 Jan 2020 18:54:10 +0100 Subject: [PATCH] Update `src/display/{annotation_layer.js, svg.js}` to determine the `fontWeight` in the same way as with canvas (PR 6091 and 7839 follow-up) --- src/display/annotation_layer.js | 8 +------- src/display/svg.js | 8 +------- 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/src/display/annotation_layer.js b/src/display/annotation_layer.js index 4bc768f27..1b09a210a 100644 --- a/src/display/annotation_layer.js +++ b/src/display/annotation_layer.js @@ -510,13 +510,7 @@ class TextWidgetAnnotationElement extends WidgetAnnotationElement { return; } - style.fontWeight = font.black - ? font.bold - ? "900" - : "bold" - : font.bold - ? "bold" - : "normal"; + style.fontWeight = font.black ? "900" : font.bold ? "bold" : "normal"; style.fontStyle = font.italic ? "italic" : "normal"; // Use a reasonable default font if the font doesn't specify a fallback. diff --git a/src/display/svg.js b/src/display/svg.js index 8c466446f..0451b0630 100644 --- a/src/display/svg.js +++ b/src/display/svg.js @@ -942,13 +942,7 @@ if (typeof PDFJSDev === "undefined" || PDFJSDev.test("GENERIC")) { ? fontObj.fontMatrix : FONT_IDENTITY_MATRIX; - const bold = fontObj.black - ? fontObj.bold - ? "bolder" - : "bold" - : fontObj.bold - ? "bold" - : "normal"; + const bold = fontObj.black ? "900" : fontObj.bold ? "bold" : "normal"; const italic = fontObj.italic ? "italic" : "normal"; if (size < 0) {