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:
parent
6590cc32f2
commit
78917bab91
@ -510,13 +510,7 @@ class TextWidgetAnnotationElement extends WidgetAnnotationElement {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
style.fontWeight = font.black
|
style.fontWeight = font.black ? "900" : font.bold ? "bold" : "normal";
|
||||||
? font.bold
|
|
||||||
? "900"
|
|
||||||
: "bold"
|
|
||||||
: font.bold
|
|
||||||
? "bold"
|
|
||||||
: "normal";
|
|
||||||
style.fontStyle = font.italic ? "italic" : "normal";
|
style.fontStyle = font.italic ? "italic" : "normal";
|
||||||
|
|
||||||
// Use a reasonable default font if the font doesn't specify a fallback.
|
// Use a reasonable default font if the font doesn't specify a fallback.
|
||||||
|
@ -942,13 +942,7 @@ if (typeof PDFJSDev === "undefined" || PDFJSDev.test("GENERIC")) {
|
|||||||
? fontObj.fontMatrix
|
? fontObj.fontMatrix
|
||||||
: FONT_IDENTITY_MATRIX;
|
: FONT_IDENTITY_MATRIX;
|
||||||
|
|
||||||
const bold = fontObj.black
|
const bold = fontObj.black ? "900" : fontObj.bold ? "bold" : "normal";
|
||||||
? fontObj.bold
|
|
||||||
? "bolder"
|
|
||||||
: "bold"
|
|
||||||
: fontObj.bold
|
|
||||||
? "bold"
|
|
||||||
: "normal";
|
|
||||||
const italic = fontObj.italic ? "italic" : "normal";
|
const italic = fontObj.italic ? "italic" : "normal";
|
||||||
|
|
||||||
if (size < 0) {
|
if (size < 0) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user