Skip to content

Commit 2cc3b96

Browse files
Merge pull request #13455 from calixteman/italic
Italic angle is defined clockwise in CSS when it's counterclockwise in PDF
2 parents d285580 + 1b00060 commit 2cc3b96

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/core/document.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -901,7 +901,11 @@ class PDFDocument {
901901
}
902902
const fontFamily = descriptor.get("FontFamily");
903903
const fontWeight = descriptor.get("FontWeight");
904-
const italicAngle = descriptor.get("ItalicAngle");
904+
905+
// Angle is expressed in degrees counterclockwise in PDF
906+
// when it's clockwise in CSS
907+
// (see https://drafts.csswg.org/css-fonts-4/#valdef-font-style-oblique-angle)
908+
const italicAngle = -descriptor.get("ItalicAngle");
905909
const cssFontInfo = { fontFamily, fontWeight, italicAngle };
906910

907911
if (!validateCSSFont(cssFontInfo)) {

0 commit comments

Comments
 (0)