We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 543b356 commit 064194fCopy full SHA for 064194f
src/jspdf.js
@@ -3907,14 +3907,13 @@ function jsPDF(options) {
3907
for (var l = 0; l < len; l++) {
3908
newY = l === 0 ? getVerticalCoordinate(y) : -leading;
3909
newX = l === 0 ? getHorizontalCoordinate(x) : 0;
3910
+
3911
+ const numSpaces = da[l].split(" ").length - 1;
3912
+ const spacing =
3913
+ numSpaces > 0 ? (maxWidth - lineWidths[l]) / numSpaces : 0;
3914
3915
if (l < len - 1) {
- wordSpacingPerLine.push(
- hpf(
- scale(
- (maxWidth - lineWidths[l]) / (da[l].split(" ").length - 1)
- )
3916
3917
- );
+ wordSpacingPerLine.push(hpf(scale(spacing)));
3918
} else {
3919
wordSpacingPerLine.push(0);
3920
}
0 commit comments