(fontSize)
| 120 | // This function is deprecated and replaced with calculateLineHeight. |
| 121 | // It remains present here because of the backward compatibility. |
| 122 | export function formatLineHeight(fontSize) { |
| 123 | // adds required padding to lineHeight to support |
| 124 | // different alphabets (Kanji, Greek, etc.) |
| 125 | |
| 126 | // eslint-disable-next-line no-console |
| 127 | console.warn( |
| 128 | 'formatLineHeight is deprecated and will be removed. Please use calculateLineHeight instead, it can simply be renamed as it takes the same argument and returns the same expected value, but more consistently across all fontSize.', |
| 129 | ); |
| 130 | |
| 131 | if (fontSize < 22) { |
| 132 | // minimum lineHeight for different alphabets is 25 |
| 133 | return 25; |
| 134 | } |
| 135 | |
| 136 | return fontSize + 3; |
| 137 | } |
| 138 | |
| 139 | export function calculateLineHeight(fontSize) { |
| 140 | return fontSize * 1.5; |
nothing calls this directly
no outgoing calls
no test coverage detected