Open
Description
Font size is being shrink and causes extra space below paragraphs. Please see attatched image.
Expected Behavior
Font size should not be shrink so that paragraphs should not have extra spaces below
Current Behavior
Font size is being shrink causing paragraphs to have extra spaces below
Possible Solution
On src/clone-node.ts file, cloneCSSStyle function, i think it's better to have an optional parameter for shrinking font-sizes. Thank you
Optional Parameter example
{
shrinkFontSize: false,
shrinkValue: 0,
shrinkAbsolute: false
}
code snippet
if (name === 'font-size' && value.endsWith('px') && shrinkFontsize && shrinkValue) {
const reducedFont = shrinkAbsolute ? Math.floor(parseFloat(value.substring(0, value.length - 2))) - shrinkValue : parseFloat(value.substring(0, value.length - 2)) - shrinkValue;
value = `${reducedFont}px`
}
Your Environment
- html-to-image: [e.g. 0.1.0]
- OS: [e.g. macOS Sierra 10.12.3]
- Browser: [e.g. chrome 78.0.3904.108]