Add font weight to font instance.
This commit is contained in:
parent
7fa50712c9
commit
3fcb77a1a2
@ -4599,6 +4599,10 @@ class PartialEvaluator {
|
||||
if (typeof italicAngle !== "number") {
|
||||
italicAngle = 0;
|
||||
}
|
||||
let fontWeight = descriptor.get("FontWeight");
|
||||
if (typeof fontWeight !== "number") {
|
||||
fontWeight = 400;
|
||||
}
|
||||
|
||||
const properties = {
|
||||
type,
|
||||
@ -4623,6 +4627,7 @@ class PartialEvaluator {
|
||||
capHeight,
|
||||
flags,
|
||||
italicAngle,
|
||||
fontWeight,
|
||||
isType3Font,
|
||||
cssFontInfo,
|
||||
scaleFactors: glyphScaleFactors,
|
||||
|
||||
@ -91,6 +91,7 @@ const EXPORT_DATA_PROPERTIES = [
|
||||
"fallbackName",
|
||||
"fontExtraProperties",
|
||||
"fontMatrix",
|
||||
"fontWeight",
|
||||
"isInvalidPDFjsFont",
|
||||
"isType3Font",
|
||||
"italic",
|
||||
@ -1036,6 +1037,7 @@ class Font {
|
||||
this.descent = properties.descent / PDF_GLYPH_SPACE_UNITS;
|
||||
this.lineHeight = this.ascent - this.descent;
|
||||
this.fontMatrix = properties.fontMatrix;
|
||||
this.fontWeight = properties.fontWeight;
|
||||
this.bbox = properties.bbox;
|
||||
this.defaultEncoding = properties.defaultEncoding;
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user