Set bold and italic flag translated font
This commit is contained in:
parent
de7179fd74
commit
b162611016
@ -4606,6 +4606,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,
|
||||||
@ -4630,6 +4634,7 @@ class PartialEvaluator {
|
|||||||
capHeight,
|
capHeight,
|
||||||
flags,
|
flags,
|
||||||
italicAngle,
|
italicAngle,
|
||||||
|
fontWeight,
|
||||||
isType3Font,
|
isType3Font,
|
||||||
cssFontInfo,
|
cssFontInfo,
|
||||||
scaleFactors: glyphScaleFactors,
|
scaleFactors: glyphScaleFactors,
|
||||||
|
|||||||
@ -1042,6 +1042,16 @@ class Font {
|
|||||||
this.fontMatrix = properties.fontMatrix;
|
this.fontMatrix = properties.fontMatrix;
|
||||||
this.bbox = properties.bbox;
|
this.bbox = properties.bbox;
|
||||||
this.defaultEncoding = properties.defaultEncoding;
|
this.defaultEncoding = properties.defaultEncoding;
|
||||||
|
if (typeof properties.fontWeight === "number") {
|
||||||
|
if (properties.fontWeight === 900) {
|
||||||
|
this.black = true;
|
||||||
|
} else if (properties.fontWeight >= 700) {
|
||||||
|
this.bold = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (typeof properties.italicAngle === "number" && properties.italicAngle) {
|
||||||
|
this.italic = true;
|
||||||
|
}
|
||||||
|
|
||||||
this.toUnicode = properties.toUnicode;
|
this.toUnicode = properties.toUnicode;
|
||||||
this.toFontChar = [];
|
this.toFontChar = [];
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user