joshuawwright/ngx-autosize-input

letter-spacing is not taken into account when calculating size

Closed this issue · 3 comments

letter-spacing: 0.03125em; is not taken into account when calculating style for rendering text.

const { fontStyle, fontVariant, fontWeight, fontSize, fontFamily } = this.style;

// font string format: {normal, normal, 700, 20px, Roboto, "Helvetica Neue", sans-serif}
ctx.font = fontStyle + ' ' + fontVariant + ' ' + fontWeight + ' ' + fontSize + ' ' + fontFamily;

As the result, if input style sets letter-spacing (such as Angular 15 body-1 typography level), text overflows the control.

@skand888 Thanks I will look into it.

@skand888 This has been fixed in version 15.0.0. Cheers!

Thanks a lot! It works well now.