Merge pull request #13455 from calixteman/italic

Italic angle is defined clockwise in CSS when it's counterclockwise in PDF
This commit is contained in:
Jonas Jenwald 2021-05-28 11:49:48 +02:00 committed by GitHub
commit 2cc3b96351
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -901,7 +901,11 @@ class PDFDocument {
}
const fontFamily = descriptor.get("FontFamily");
const fontWeight = descriptor.get("FontWeight");
const italicAngle = descriptor.get("ItalicAngle");
// Angle is expressed in degrees counterclockwise in PDF
// when it's clockwise in CSS
// (see https://drafts.csswg.org/css-fonts-4/#valdef-font-style-oblique-angle)
const italicAngle = -descriptor.get("ItalicAngle");
const cssFontInfo = { fontFamily, fontWeight, italicAngle };
if (!validateCSSFont(cssFontInfo)) {