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)

This commit is contained in:
Jonas Jenwald 2020-01-12 18:54:10 +01:00
parent 6590cc32f2
commit 78917bab91
2 changed files with 2 additions and 14 deletions

View File

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

View File

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