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") {
|
if (typeof italicAngle !== "number") {
|
||||||
italicAngle = 0;
|
italicAngle = 0;
|
||||||
}
|
}
|
||||||
|
let fontWeight = descriptor.get("FontWeight");
|
||||||
|
if (typeof fontWeight !== "number") {
|
||||||
|
fontWeight = 400;
|
||||||
|
}
|
||||||
|
|
||||||
const properties = {
|
const properties = {
|
||||||
type,
|
type,
|
||||||
@ -4623,6 +4627,7 @@ class PartialEvaluator {
|
|||||||
capHeight,
|
capHeight,
|
||||||
flags,
|
flags,
|
||||||
italicAngle,
|
italicAngle,
|
||||||
|
fontWeight,
|
||||||
isType3Font,
|
isType3Font,
|
||||||
cssFontInfo,
|
cssFontInfo,
|
||||||
scaleFactors: glyphScaleFactors,
|
scaleFactors: glyphScaleFactors,
|
||||||
|
|||||||
@ -91,6 +91,7 @@ const EXPORT_DATA_PROPERTIES = [
|
|||||||
"fallbackName",
|
"fallbackName",
|
||||||
"fontExtraProperties",
|
"fontExtraProperties",
|
||||||
"fontMatrix",
|
"fontMatrix",
|
||||||
|
"fontWeight",
|
||||||
"isInvalidPDFjsFont",
|
"isInvalidPDFjsFont",
|
||||||
"isType3Font",
|
"isType3Font",
|
||||||
"italic",
|
"italic",
|
||||||
@ -1036,6 +1037,7 @@ class Font {
|
|||||||
this.descent = properties.descent / PDF_GLYPH_SPACE_UNITS;
|
this.descent = properties.descent / PDF_GLYPH_SPACE_UNITS;
|
||||||
this.lineHeight = this.ascent - this.descent;
|
this.lineHeight = this.ascent - this.descent;
|
||||||
this.fontMatrix = properties.fontMatrix;
|
this.fontMatrix = properties.fontMatrix;
|
||||||
|
this.fontWeight = properties.fontWeight;
|
||||||
this.bbox = properties.bbox;
|
this.bbox = properties.bbox;
|
||||||
this.defaultEncoding = properties.defaultEncoding;
|
this.defaultEncoding = properties.defaultEncoding;
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user