Where are the magic numbers come from in `fabric.js`?

Viewed 101
2 Answers

_fontSizeFraction is approximately equal to 2/9, but my impression is that this value would be used to decrease the default size of the font.

Text Line proportion to font Size (in pixels)

_fontSizeMult increases values by 13%. It takes the font height, increases it by 13% to give you the total line height including line-spacing.

These variables look like defaults and were likely chosen by the developer based on personal preference.

They work for finding the text size because the text size is likely defined by these variables.

Related