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") {
|
||||
italicAngle = 0;
|
||||
}
|
||||
let fontWeight = descriptor.get("FontWeight");
|
||||
if (typeof fontWeight !== "number") {
|
||||
fontWeight = 400;
|
||||
}
|
||||
|
||||
const properties = {
|
||||
type,
|
||||
@ -4630,6 +4634,7 @@ class PartialEvaluator {
|
||||
capHeight,
|
||||
flags,
|
||||
italicAngle,
|
||||
fontWeight,
|
||||
isType3Font,
|
||||
cssFontInfo,
|
||||
scaleFactors: glyphScaleFactors,
|
||||
|
||||
@ -1042,6 +1042,16 @@ class Font {
|
||||
this.fontMatrix = properties.fontMatrix;
|
||||
this.bbox = properties.bbox;
|
||||
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.toFontChar = [];
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user